@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, periodName, 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)
Ctor.
|
CoordinateTime2D(int code,
CalendarPeriod timeUnit,
java.util.List<CoordinateTime2D.Time2D> vals,
CoordinateRuntime runtime,
java.util.List<Coordinate> times)
Ctor.
|
CoordinateTime2D(int code,
CalendarPeriod timeUnit,
java.util.List<CoordinateTime2D.Time2D> vals,
CoordinateRuntime runtime,
java.util.List<Coordinate> regList,
java.util.List<Coordinate> times)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
int |
estMemorySize() |
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 |
getNruns() |
int |
getNtimes() |
int |
getOffset(int runIndex) |
java.util.List<? extends java.lang.Object> |
getOffsetsSorted()
Get a sorted list of the unique time coordinates
|
CoordinateTime2D.Time2D |
getOrgValue(int runIdx,
int timeIdx,
boolean debug)
Get the time coordinate at the given indices, into the 2D time coordinate array
|
CalendarDate |
getRefDate(int runIdx) |
long |
getRuntime(int runIdx) |
CoordinateRuntime |
getRuntimeCoordinate() |
int |
getSize() |
CoordinateTimeAbstract |
getTimeCoordinate(int runIdx) |
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<? extends java.lang.Object> |
getValues() |
int |
hashCode() |
boolean |
isOrthogonal() |
boolean |
isRegular() |
boolean |
isTimeInterval() |
protected CoordinateTimeAbstract |
makeBestFromComplete(int[] best,
int n) |
CoordinateTimeAbstract |
makeBestTimeCoordinate(CoordinateRuntime master) |
CalendarDateRange |
makeCalendarDateRange(Calendar cal) |
int |
matchTimeCoordinate(int runIdx,
java.lang.Object value,
CalendarDate refDateOfValue)
Find the index matching a runtime and time coordinate
|
void |
showCoords(java.util.Formatter info) |
void |
showInfo(java.util.Formatter info,
Indent indent) |
getCode, getMasterRuntimeIndex, getName, getPeriod, getRefDate, getTime2runtime, getTimeUnit, getTimeUnitScale, getUnit, makeBestFromComplete, setName
clone, finalize, getClass, notify, notifyAll, toString, 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)
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 reletive 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)
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 reletive 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)
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 reletive to its runtime, may be null (Only available during creation, not stored in index)public CoordinateRuntime getRuntimeCoordinate()
public boolean isTimeInterval()
public boolean isOrthogonal()
public boolean isRegular()
public int getNtimes()
public int getNruns()
public int getOffset(int runIndex)
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 java.util.List<? extends java.lang.Object> 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 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
public java.lang.String getTimeIntervalName()
public CalendarDateRange makeCalendarDateRange(Calendar cal)
makeCalendarDateRange
in class CoordinateTimeAbstract
public CoordinateTimeAbstract getTimeCoordinate(int runIdx)
public CalendarDate getRefDate(int runIdx)
public long getRuntime(int runIdx)
public CoordinateTime2D.Time2D getOrgValue(int runIdx, int timeIdx, boolean debug)
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, java.lang.Object value, CalendarDate refDateOfValue)
runIdx
- which runvalue
- time coordinaterefDateOfValue
- reference time of time coordinateprotected CoordinateTimeAbstract makeBestFromComplete(int[] best, int n)
makeBestFromComplete
in class CoordinateTimeAbstract
public CoordinateTimeAbstract makeBestTimeCoordinate(CoordinateRuntime master)
public java.util.List<? extends Coordinate> getTimesForSerialization()
public java.util.List<? extends java.lang.Object> getOffsetsSorted()