Package org.jblas.ranges
Class IntervalRange
- java.lang.Object
-
- org.jblas.ranges.IntervalRange
-
- All Implemented Interfaces:
Range
public class IntervalRange extends java.lang.Object implements Range
Range which varies from a given interval. Endpoint is exclusive! "new IntervalRange(0, 3)" enumerates 0, 1, 2.
-
-
Constructor Summary
Constructors Constructor Description IntervalRange(int a, int b)
Construct new interval range.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasMore()
More indices available?int
index()
Consecutive numbering of current index.void
init(int lower, int upper)
Initialize Range to available indicesint
length()
Total number of indices.void
next()
Increase counter.java.lang.String
toString()
int
value()
Get current index.
-
-
-
Constructor Detail
-
IntervalRange
public IntervalRange(int a, int b)
Construct new interval range. Endpoints are inclusive.
-
-
Method Detail
-
init
public void init(int lower, int upper)
Description copied from interface:Range
Initialize Range to available indices
-
index
public int index()
Description copied from interface:Range
Consecutive numbering of current index.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-