public interface DomainDivider
Note that the intervals need not be uniformly sized. For example, this would be the case when dividing a time interval into months, or into log spaced intervals.
Implementations should have protected constructors so factory methods in
DomainDividerUtil
can access them.
Modifier and Type | Field and Description |
---|---|
static int |
MAX_BOUNDARIES |
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.
|
DomainDivider |
finerDivider(boolean superset)
Return a new divider with smaller intervals.
|
DatumRange |
rangeContaining(Datum v)
Return a
DatumRange representing the interval containing
the given value. |
static final int MAX_BOUNDARIES
DomainDivider coarserDivider(boolean superset)
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.superset
- true to force boundary alignment with the calling DomainDivider
.
For a given range, the boundaries will be aligned.DomainDivider finerDivider(boolean superset)
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.superset
- true to force boundary alignment with the calling DomainDivider
For a given range, the boundaries will be aligned.DatumVector boundaries(Datum min, Datum max)
min
- the lower boundmax
- the upper boundDatumVector
containing the boundary valueslong boundaryCount(Datum min, Datum max)
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.min
- max
- DatumRange rangeContaining(Datum v)
DatumRange
representing the interval containing
the given value.v
-