com.codemesh.terp.api
Class Range
java.lang.Object
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)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Range
public Range()
Range
public Range(int lower,
int upper)
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.
Copyright © 2008-2012 by Codemesh, Inc. All Rights Reserved.