terp - the Codemesh Modular
Template Interpreter v1.3.309

com.codemesh.terp.api
Class Range

java.lang.Object
  extended by com.codemesh.terp.api.Range
All Implemented Interfaces:
java.lang.Iterable

public final class Range
extends java.lang.Object
implements java.lang.Iterable

An object that maintains two numeric bounds.


Constructor Summary
Range()
           
Range(int lower, int upper)
           
 
Method Summary
 int getLower()
           
 int getUpper()
           
 boolean hasLower()
           
 boolean hasUpper()
           
 java.util.Iterator iterator()
          Iteration is only supported on first-class (qualifiable) ranges, i.e.
 int resolveLower(int size)
           
 int resolveLower(TerpEvaluatorImpl eval, java.lang.Object qualified)
           
 int resolveUpper(int size)
           
 int resolveUpper(TerpEvaluatorImpl eval, java.lang.Object qualified)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Range

public Range()

Range

public Range(int lower,
             int upper)
Method Detail

getLower

public int getLower()

hasLower

public boolean hasLower()

resolveLower

public int resolveLower(TerpEvaluatorImpl eval,
                        java.lang.Object qualified)

resolveLower

public int resolveLower(int size)

getUpper

public int getUpper()

hasUpper

public boolean hasUpper()

resolveUpper

public int resolveUpper(TerpEvaluatorImpl eval,
                        java.lang.Object qualified)

resolveUpper

public int resolveUpper(int size)

iterator

public java.util.Iterator iterator()
Iteration is only supported on first-class (qualifiable) ranges, i.e. ranges of the type [lower..upper]. Qualified ranges, i.e. ranges of the type collection[lower..upper] are not directly iterable because we cannot provide the owning collection as context.

Specified by:
iterator in interface java.lang.Iterable
Returns:
an iterator over integer values.

terp - the Codemesh Modular
Template Interpreter v1.3.309

Copyright © 2008-2012 by Codemesh, Inc. All Rights Reserved.