Package org.jblas.ranges
Class IntervalRange
java.lang.Object
org.jblas.ranges.IntervalRange
- All Implemented Interfaces:
Range
Range which varies from a given interval. Endpoint is exclusive!
"new IntervalRange(0, 3)" enumerates 0, 1, 2.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasMore()More indices available?intindex()Consecutive numbering of current index.voidinit(int lower, int upper) Initialize Range to available indicesintlength()Total number of indices.voidnext()Increase counter.toString()intvalue()Get current index.
-
Field Details
-
start
private int start -
end
private int end -
value
private int value
-
-
Constructor Details
-
IntervalRange
public IntervalRange(int a, int b) Construct new interval range. Endpoints are inclusive.
-
-
Method Details
-
init
public void init(int lower, int upper) Description copied from interface:RangeInitialize Range to available indices -
length
public int length()Description copied from interface:RangeTotal number of indices. -
next
public void next()Description copied from interface:RangeIncrease counter. -
index
public int index()Description copied from interface:RangeConsecutive numbering of current index. -
value
public int value()Description copied from interface:RangeGet current index. -
hasMore
public boolean hasMore()Description copied from interface:RangeMore indices available? -
toString
-