@Immutable public class CoordinateTime2D extends CoordinateTimeAbstract implements Coordinate
Modifier and Type | Class and Description |
---|---|
static class |
CoordinateTime2D.Builder1 |
static class |
CoordinateTime2D.Builder2 |
static class |
CoordinateTime2D.Time2D |
Coordinate.Type
cdf, code, MIXED_INTERVALS, name, refDate, time2runtime, timeUnit
Constructor and Description |
---|
CoordinateTime2D(int code,
CalendarPeriod timeUnit,
java.util.List<CoordinateTime2D.Time2D> vals,
CoordinateRuntime runtime,
CoordinateTimeAbstract otime,
java.util.List<Coordinate> times,
int[] time2runtime)
Ctor.
|
CoordinateTime2D(int code,
CalendarPeriod timeUnit,
java.util.List<CoordinateTime2D.Time2D> vals,
CoordinateRuntime runtime,
java.util.List<Coordinate> times,
int[] time2runtime)
Ctor.
|
CoordinateTime2D(int code,
CalendarPeriod timeUnit,
java.util.List<CoordinateTime2D.Time2D> vals,
CoordinateRuntime runtime,
java.util.List<Coordinate> regList,
java.util.List<Coordinate> times,
int[] time2runtime)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
Counters |
calcDistributions() |
boolean |
equals(java.lang.Object o) |
int |
estMemorySize() |
int |
findTimeIndexFromVal(int runIdx,
java.lang.Object val)
Find index in time coordinate from the time value
|
boolean |
getIndex(CoordinateTime2D.Time2D want,
int[] wholeIndex)
find the run and time indexes of want
the inverse of getOrgValue
|
int |
getIndex(java.lang.Object val) |
int |
getNCoords() |
int |
getNruns() |
int |
getNtimes() |
int |
getOffset(int runIndex) |
java.util.List<?> |
getOffsetsSorted()
Get a sorted list of the unique time coordinates
|
CoordinateTime2D.Time2D |
getOrgValue(int runIdx,
int timeIdx)
Get the time coordinate at the given indices, into the 2D time coordinate array
|
CalendarDate |
getRefDate(int runIdx) |
java.lang.Iterable<java.lang.Integer> |
getRegularHourOffsets() |
CoordinateTimeAbstract |
getRegularTimeCoordinate(int hour) |
long |
getRuntime(int runIdx) |
CoordinateRuntime |
getRuntimeCoordinate() |
int |
getSize() |
CoordinateTimeAbstract |
getTimeCoordinate(int runIdx) |
int[] |
getTimeIndicesFromMrutp(int timeIdx) |
java.lang.String |
getTimeIntervalName()
Check if all time intervals have the same length.
|
java.util.List<? extends Coordinate> |
getTimesForSerialization()
public by accident - do not use
|
Coordinate.Type |
getType() |
java.lang.Object |
getValue(int idx) |
java.util.List<?> |
getValues() |
int |
hashCode() |
boolean |
hasUniqueTimes() |
boolean |
isOrthogonal() |
boolean |
isRegular() |
boolean |
isTimeInterval() |
protected CoordinateTimeAbstract |
makeBestFromComplete(int[] best,
int n) |
CoordinateTimeAbstract |
makeBestTimeCoordinate(CoordinateRuntime master) |
CalendarDateRange |
makeCalendarDateRange(Calendar cal) |
CoordinateTimeAbstract |
makeTime2Runtime(CoordinateRuntime master) |
int |
matchTimeCoordinate(int runIdx,
CoordinateTime2D.Time2D value)
Find the index matching a runtime and time coordinate
|
void |
setName(java.lang.String name) |
void |
showCoords(java.util.Formatter info) |
void |
showInfo(java.util.Formatter info,
Indent indent) |
getCode, getMasterRuntimeIndex, getName, getOffsetInTimeUnits, getRefDate, getTime2runtime, getTimeUdUnit, getTimeUnit, getUnit, makeBestFromComplete, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getCode, getName, getUnit
public CoordinateTime2D(int code, CalendarPeriod timeUnit, java.util.List<CoordinateTime2D.Time2D> vals, CoordinateRuntime runtime, java.util.List<Coordinate> times, int[] time2runtime)
code
- pdsFirst.getTimeUnit()timeUnit
- time duration, based on codevals
- complete set of Time2D values, may be null (used only during creation)runtime
- list of runtimestimes
- list of times, one for each runtime, offsets relative to its runtime, may not be nullpublic CoordinateTime2D(int code, CalendarPeriod timeUnit, java.util.List<CoordinateTime2D.Time2D> vals, CoordinateRuntime runtime, CoordinateTimeAbstract otime, java.util.List<Coordinate> times, int[] time2runtime)
code
- pdsFirst.getTimeUnit()timeUnit
- time duration, based on codevals
- complete set of Time2D values, may be null (used only during creation)runtime
- list of runtimesotime
- list of offsets, all the same for each runtimetimes
- list of times, one for each runtime, offsets relative to its runtime, may be null (Only available
during creation, not stored in index)public CoordinateTime2D(int code, CalendarPeriod timeUnit, java.util.List<CoordinateTime2D.Time2D> vals, CoordinateRuntime runtime, java.util.List<Coordinate> regList, java.util.List<Coordinate> times, int[] time2runtime)
code
- pdsFirst.getTimeUnit()timeUnit
- time duration, based on codevals
- complete set of Time2D values, may be null (used only during creation)runtime
- list of runtimesregList
- list of offsets, one each for each possible runtime hour of day.times
- list of times, one for each runtime, offsets relative to its runtime, may be null (Only available
during creation, not stored in index)public void setName(java.lang.String name)
setName
in class CoordinateTimeAbstract
public CoordinateRuntime getRuntimeCoordinate()
public boolean isTimeInterval()
public boolean isOrthogonal()
public boolean isRegular()
public int getNtimes()
public int getNruns()
public int getOffset(int runIndex)
public java.lang.Iterable<java.lang.Integer> getRegularHourOffsets()
public void showInfo(java.util.Formatter info, Indent indent)
showInfo
in interface Coordinate
public void showCoords(java.util.Formatter info)
showCoords
in interface Coordinate
public Counters calcDistributions()
calcDistributions
in interface Coordinate
public java.util.List<?> getValues()
getValues
in interface Coordinate
public java.lang.Object getValue(int idx)
getValue
in interface Coordinate
public int getIndex(java.lang.Object val)
getIndex
in interface Coordinate
public int getSize()
getSize
in interface Coordinate
public int getNCoords()
getNCoords
in interface Coordinate
getNCoords
in class CoordinateTimeAbstract
public int estMemorySize()
estMemorySize
in interface Coordinate
public Coordinate.Type getType()
getType
in interface Coordinate
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
@Nullable public java.lang.String getTimeIntervalName()
public CalendarDateRange makeCalendarDateRange(Calendar cal)
makeCalendarDateRange
in class CoordinateTimeAbstract
public CoordinateTimeAbstract getTimeCoordinate(int runIdx)
public CoordinateTimeAbstract getRegularTimeCoordinate(int hour)
public CalendarDate getRefDate(int runIdx)
public long getRuntime(int runIdx)
public CoordinateTime2D.Time2D getOrgValue(int runIdx, int timeIdx)
runIdx
- run indextimeIdx
- time indexpublic boolean getIndex(CoordinateTime2D.Time2D want, int[] wholeIndex)
want
- find time coordinate that matcheswholeIndex
- return index herepublic int matchTimeCoordinate(int runIdx, CoordinateTime2D.Time2D value)
runIdx
- which runvalue
- time coordinateprotected CoordinateTimeAbstract makeBestFromComplete(int[] best, int n)
makeBestFromComplete
in class CoordinateTimeAbstract
public CoordinateTimeAbstract makeTime2Runtime(CoordinateRuntime master)
public CoordinateTimeAbstract makeBestTimeCoordinate(CoordinateRuntime master)
public boolean hasUniqueTimes()
public int[] getTimeIndicesFromMrutp(int timeIdx)
public java.util.List<? extends Coordinate> getTimesForSerialization()
public int findTimeIndexFromVal(int runIdx, java.lang.Object val)
val
- TimeCoordIntvValue or Integerpublic java.util.List<?> getOffsetsSorted()