Package hec.io
Class TimeSeriesCollectionContainer
java.lang.Object
hec.io.DataContainer
hec.io.TimeSeriesCollectionContainer
- All Implemented Interfaces:
Serializable,Cloneable
TimeSeriesCollectionContainer is a DataContainer holding TimeSeriesContainers
Each individual TimeSeriesContainer may have a different start and end date.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class hec.io.DataContainer
DataContainer.VERTICAL_DATUM, DataContainer.VERTICAL_UNITS -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected String[]protected int[]protected TimeSeriesContainer[]Fields inherited from class hec.io.DataContainer
coordinateID, coordinateSystem, CURRENT_VERTICAL_DATUM_HEADER, CURRENT_VERTICAL_DATUM_KEY, dataType, fileLastWriteTimeMillis, fileName, fullName, horizontalDatum, horizontalUnits, lastWriteTimeMillis, location, locationTimezone, modified, otherInfo, storedAsdoubles, subVersion, supplementalInfo, version, VERTICAL_DATUM_INFO_HEADER, VERTICAL_DATUM_INFO_KEY, verticalDatum, verticalUnits, watershed, xOrdinate, yOrdinate, zOrdinate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(TimeSeriesContainer tsc) Add a single TimeSeriesContainer to the collection.booleanDeprecated.clone()voidclone(TimeSeriesCollectionContainer collection) Creates a deep cloneprotected booleancontains(int[] array, int arrayCount, int value) searchs an array for a specific value.voidCompletes collection when TimeSeriesContainers have been added Re-computes sequences, etc.get()Gets the array of TimeSeriesContainer from this collectionget(int index) Get the TimeSeriesContainer at the array index provided Use numberOfSequences() to determine array lengthGet the TimeSeriesContainer corresponding to this sequence stringString[]Return an array of pathnames in this collectionString[]Gets a String array of sequences in this collectionint[]getTimes()Gets an int array containing all times in all containers in collection.intreturns the number of sequences in this collectionbooleanremove(int index) Remove the TimeSeriesContainer at the index givenbooleanRemove a TimeSeriesContainer from the collectionvoidset(TimeSeriesContainer[] containers) Set an array of TimeSeriesContainers to be this collection Each TimeSeriesContainer must have a valid collection pathname Replaces any existing collection with this set.booleanset(TimeSeriesContainer[] containers, int startingSequenceNumber) Set a clone of time series containers to be this collection, using a given starting sequence number.booleanset(TimeSeriesContainer[] containers, String[] sequences) Set a clone of time series containers to be this collection, using a given set of sequences.voidsetDirty()Tells the collection that sequences need to be recomputed (this is done automatically - don't need to call)intsize()Returns the number of timeSeriesContainers in this collectionMethods inherited from class hec.io.DataContainer
clone, extractVerticalDatum, getFullName, getHorizontalDatum, getLatLong, getName, getStoreAsDoubles, getSupplementalInfo, getVerticalDatum, getVerticalUnits, insertVerticalDatum, setFullName, setHorizontalDatum, setLatLong, setName, setStoreAsDoubles, setSupplementalInfo, setVerticalDatum, setVerticalDatum, setVerticalUnits, setVerticalUnits, toString
-
Field Details
-
timeSeriesContainers
-
sequences
-
times
protected int[] times -
_dirtyTimes
protected boolean _dirtyTimes -
_dirtySequences
protected boolean _dirtySequences
-
-
Constructor Details
-
TimeSeriesCollectionContainer
public TimeSeriesCollectionContainer()
-
-
Method Details
-
clone
-
clone
Creates a deep clone- Parameters:
collection- TimeSeriesCollectionContainer
-
add
Add a single TimeSeriesContainer to the collection. Can be first or any. Call finishedAdding() when done to complete- Parameters:
tsc- TimeSeriesContainer
-
finishedAdding
public void finishedAdding()Completes collection when TimeSeriesContainers have been added Re-computes sequences, etc. -
set
Set an array of TimeSeriesContainers to be this collection Each TimeSeriesContainer must have a valid collection pathname Replaces any existing collection with this set.- Parameters:
containers- TimeSeriesContainer[]
-
set
Set a clone of time series containers to be this collection, using a given starting sequence number. The pathnames in each container must be the same, but do not have to be a collection pathname This will rename them (or renumber them) to collection pathnames with sequences that increment by one.- Parameters:
containers- TimeSeriesContainer[]startingSequenceNumber- int- Returns:
- boolean, true if succcessful
-
set
Set a clone of time series containers to be this collection, using a given set of sequences. The sequences must be the same length as the containers. The pathnames in each container must be the same, but do not have to be a collection pathname This will rename them to collection pathnames.- Parameters:
containers- TimeSeriesContainer[]sequences- String[]- Returns:
- boolean, true if succcessful
-
get
Gets the array of TimeSeriesContainer from this collection- Returns:
- TimeSeriesContainer[]
-
size
public int size()Returns the number of timeSeriesContainers in this collection- Returns:
- int
-
get
Get the TimeSeriesContainer at the array index provided Use numberOfSequences() to determine array length- Parameters:
index- int- Returns:
- TimeSeriesContainer null if empty collection
-
get
Get the TimeSeriesContainer corresponding to this sequence string- Parameters:
sequence- String- Returns:
- TimeSeriesContainer returns null if squence doesn't exist in collection
-
getTimes
public int[] getTimes()Gets an int array containing all times in all containers in collection. (No times duplicated)- Returns:
- int[] returns null if empty set
-
contains
protected boolean contains(int[] array, int arrayCount, int value) searchs an array for a specific value. Used in building the time array- Parameters:
array- int[]arrayCount- intvalue- int- Returns:
- boolean
-
getSequences
Gets a String array of sequences in this collection- Returns:
- String[]
-
getPathnameList
Return an array of pathnames in this collection- Returns:
- String[]
-
numberOfSequences
public int numberOfSequences()returns the number of sequences in this collection- Returns:
- int
-
setDirty
public void setDirty()Tells the collection that sequences need to be recomputed (this is done automatically - don't need to call) -
remove
Remove a TimeSeriesContainer from the collection- Parameters:
tsc- TimeSeriesContainer- Returns:
- boolean if in the collecion
-
remove
public boolean remove(int index) Remove the TimeSeriesContainer at the index given- Parameters:
index- int- Returns:
- boolean if in the collecion
-
checkContainers
Deprecated.Checks that all containers are collections removes containers that are not part of a sequence (don't need to call - automatically called by getSequences() and finishedAdding() )- Returns:
- boolean true if all collections
-