sgtplot.util
Class GeoDateArray
- java.lang.Object
-
- sgtplot.util.GeoDateArray
-
- All Implemented Interfaces:
- java.io.Serializable
public class GeoDateArray extends java.lang.Object implements java.io.SerializableGeoDateArraycreates an efficient storage ofGeoDateobjects. This is accomplished by using an internal storage oflongfor the number of milliseconds since January 1, 1970, 00:00:00 GMT.- Since:
- sgtplot 3.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description GeoDateArray(java.util.Date[] dates)Construct a newGeoDateArrayfrom an array ofDates.GeoDateArray(GeoDate[] dates)Construct a newGeoDateArrayfrom an array ofGeoDates.GeoDateArray(long[] dates)Construct a newGeoDateArrayfrom an array oflongs that represent the number of milliseconds since January 1, 1970, 00:00:00 GMT.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddOffset(int index, long offset)Add offset to single date.voidaddOffset(long offset)Add offset to all dates.GeoDate[]getGeoDate()GeoDategetGeoDate(int index)intgetLength()Get length of array.double[]getOffset(GeoDate ref)Time offset for referenceGeoDate.doublegetOffset(int index, GeoDate ref)Time offset for referenceGeoDate.long[]getOffsetTime(GeoDate ref)Time offset for referenceGeoDate.longgetOffsetTime(int index, GeoDate ref)Time offset for referenceGeoDate.long[]getTime()longgetTime(int index)
-
-
-
Constructor Detail
-
GeoDateArray
public GeoDateArray(GeoDate[] dates)
Construct a newGeoDateArrayfrom an array ofGeoDates.- Parameters:
dates- an array ofGeoDates.
-
GeoDateArray
public GeoDateArray(java.util.Date[] dates)
Construct a newGeoDateArrayfrom an array ofDates.- Parameters:
dates- an array ofDates.
-
GeoDateArray
public GeoDateArray(long[] dates)
Construct a newGeoDateArrayfrom an array oflongs that represent the number of milliseconds since January 1, 1970, 00:00:00 GMT. Missing value for date isLong.MAX_VALUE.- Parameters:
dates- an array oflongs.
-
-
Method Detail
-
getTime
public long[] getTime()
-
getTime
public long getTime(int index)
-
getGeoDate
public GeoDate getGeoDate(int index)
-
getGeoDate
public GeoDate[] getGeoDate()
-
getOffset
public double getOffset(int index, GeoDate ref)Time offset for referenceGeoDate.- Parameters:
ref- referenceGeoDate- Returns:
- offset in days
-
getOffset
public double[] getOffset(GeoDate ref)
Time offset for referenceGeoDate.- Parameters:
ref- referenceGeoDate- Returns:
- offset in days
-
getOffsetTime
public long getOffsetTime(int index, GeoDate ref)Time offset for referenceGeoDate.- Parameters:
ref- referenceGeoDate- Returns:
- offset in milliseconds
-
getOffsetTime
public long[] getOffsetTime(GeoDate ref)
Time offset for referenceGeoDate.- Parameters:
ref- referenceGeoDate- Returns:
- offset in milliseconds
-
addOffset
public void addOffset(long offset)
Add offset to all dates.
-
addOffset
public void addOffset(int index, long offset)Add offset to single date.
-
getLength
public int getLength()
Get length of array.
-
-
DMelt 3.0 © DataMelt by jWork.ORG