public class LinearDomainDivider extends java.lang.Object implements DomainDivider
DomainDivider
to divide a linear data range into equal segments.
Within a given order of magnitude, this divider will work in increments of one,
two, or five.MAX_BOUNDARIES
Modifier | Constructor and Description |
---|---|
protected |
LinearDomainDivider() |
protected |
LinearDomainDivider(int significand,
int exponent) |
Modifier and Type | Method and Description |
---|---|
DatumVector |
boundaries(Datum min,
Datum max)
Returns the boundaries between intervals on the given data range.
|
long |
boundaryCount(Datum min,
Datum max)
Compute the number of intervals produced by this
DomainDivider
on the given range. |
DomainDivider |
coarserDivider(boolean superset)
Return a new divider with larger intervals.
|
static LinearDomainDivider |
create(int significand,
int exponent)
create a new LinearDomainDivider which will step through
intervals divided by significand * 10 ^ exponent.
|
DomainDivider |
finerDivider(boolean superset)
Return a new divider with smaller intervals.
|
protected int |
getExponent()
protected to provide access to other dividers that delegate to this,
and to support formatter.
|
protected int |
getSignificand()
protected to provide access to other dividers that delegate to this,
and to support formatter.
|
static void |
main(java.lang.String[] args) |
DatumRange |
rangeContaining(Datum v)
Return a
DatumRange representing the interval containing
the given value. |
java.lang.String |
toString() |
protected LinearDomainDivider()
protected LinearDomainDivider(int significand, int exponent)
public static LinearDomainDivider create(int significand, int exponent)
significand
- the multiplier, 1, 2, or 5.exponent
- the exponentpublic DomainDivider coarserDivider(boolean superset)
DomainDivider
superset
parameter is true, the interval boundaries of the new divider are
guaranteed to align with (some) interval boundaries of the existing one.
In other words, the existing divider will subdivide the new one.coarserDivider
in interface DomainDivider
superset
- true to force boundary alignment with the calling DomainDivider
.
For a given range, the boundaries will be aligned.public DomainDivider finerDivider(boolean superset)
DomainDivider
superset
parameter is true, the interval boundaries of the existing divider are
guaranteed to align with (some) intervals of the new one. In other
words, the new divider will subdivide the existing one.finerDivider
in interface DomainDivider
superset
- true to force boundary alignment with the calling DomainDivider
For a given range, the boundaries will be aligned.public DatumVector boundaries(Datum min, Datum max)
DomainDivider
boundaries
in interface DomainDivider
min
- the lower boundmax
- the upper boundDatumVector
containing the boundary valuespublic DatumRange rangeContaining(Datum v)
DomainDivider
DatumRange
representing the interval containing
the given value.rangeContaining
in interface DomainDivider
public long boundaryCount(Datum min, Datum max)
DomainDivider
DomainDivider
on the given range. This allows the DomainDivider to indicate the number
of intervals (e.g. a zillion) without having to enumerate them. When
min or max lay on a boundary, it should be counted (inclusive max). If
min>&eq;max, then zero should be returned.boundaryCount
in interface DomainDivider
protected int getSignificand()
protected int getExponent()
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)