Class LongRange
java.lang.Object
org.apache.commons.functor.generator.BaseGenerator<Long>
org.apache.commons.functor.generator.util.LongRange
A generator for the range from (inclusive) to to (exclusive).
- Since:
- 1.0
- Version:
- $Revision$ $Date$
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static longdefaultStep(long from, long to) Calculate default step to get fromfromtoto.booleaninthashCode()voidrun(UnaryProcedure<? super Long> proc) Generators must implement this method.private static longsignOf(long value) Getvalue/|value|(0L when value == 0L).toString()Methods inherited from class BaseGenerator
getWrappedGenerator, isStopped, stop, to, to, toCollection
-
Field Details
-
from
private final long fromThe start index. -
to
private final long toThe end index. -
step
private final long stepThe increment counter.
-
-
Constructor Details
-
LongRange
-
LongRange
-
LongRange
public LongRange(long from, long to) Create a new LongRange.- Parameters:
from- startto- end
-
LongRange
public LongRange(long from, long to, long step) Create a new LongRange.- Parameters:
from- startto- endstep- increment
-
-
Method Details
-
run
Generators must implement this method.- Parameters:
proc- UnaryProcedure to run
-
toString
-
equals
-
hashCode
-
signOf
private static long signOf(long value) Getvalue/|value|(0L when value == 0L).- Parameters:
value- to test- Returns:
- long
-
defaultStep
private static long defaultStep(long from, long to) Calculate default step to get fromfromtoto.- Parameters:
from- startto- end- Returns:
- long
-