Package hec.hecmath
Class DSSFile
java.lang.Object
hec.hecmath.DSSFile
- Direct Known Subclasses:
HecDss
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DssDataManager
The DSS data managerprotected String
the default end of the timewindowprotected String
The DSS file that this DSSFile object representsprotected int
protected int
protected String
the default start of the timewindowprotected boolean
specifies whether to trim missing values from start and end of regular time-series -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Explicitly close the DSS fileint
copyRecordsFrom
(String toDSSFilename, String[] pathnameList) int
copyRecordsFrom
(String toDSSFilename, Vector pathnameList) int
copyRecordsInto
(String fromDSSFilename, String[] pathnameList) int
copyRecordsInto
(String fromDSSFilename, Vector pathnameList) int
int
void
done()
Release the DSS file for this objectint
duplicateRecords
(String[] pathnameList, String[] newPathnameList) int
duplicateRecords
(Vector pathnameList, Vector newPathnameList) void
Retrieves a list of all cataloged pathnames.getCatalogedPathnames
(boolean forceNew) Retrieves a list of all cataloged pathnames, optionally refreshing the catalog in the process.getCatalogedPathnames
(String scanString) Searches the cataloged pathnames, returning a list of those which match the specified instructions.getCatalogedPathnames
(String scanString, boolean forceNew) Searches the cataloged pathnames, returning a list of those which match the specified instructions - optionally refreshing the catalog in the process.get the timewindow end timeget the DSSFile's filenameint
int
get the timewindow start timeboolean
Gets the "trim missing data" state of the DSSFile object If the "trim missing data" state is TRUE, blocks of missing data will be removed from the start and end of all regular time series recordsboolean
isRemote()
read from the file that this DSSFile represents the DSSPathname specified in pathname.read from the file that this DSSFile represents the DSSPathname specified in pathname with the specified start and end times.read from the file that this DSSFile represents the DSSPathname specified in pathname with the specified start and end times.read from the file that this DSSFile represents the DSSPathname specified in pathname with the specified start and end times.boolean
recordExists
(String pathname) check to see if the record specified bypathname
exists in this filerecordsUpdated
(long startTime) int
recordsUpdated
(long startTime, Vector<String> pathnames, Vector<Long> updateTimes, Vector<Integer> recordTypes) Retrieves infomation about record updated since the specified time.recordsUpdated
(HecTime startTime) int
recordsUpdated
(HecTime startTime, Vector<String> pathnames, Vector<Long> updateTimes, Vector<Integer> recordTypes) recordsUpdated
(String startTime) int
recordsUpdated
(String startTime, Vector<String> pathnames, Vector<Long> updateTimes, Vector<Integer> recordTypes) int
renameRecords
(String[] pathnameList, String[] newPathnameList) int
renameRecords
(Vector pathnameList, Vector newPathnameList) searchPathnames
(String scanString) Searches the DSS file for pathnames, returning a list of those which match the specified instructions.void
setFilename
(String filename) Sets the Filename attribute of the DSSFile objectvoid
setIrregularStoreMethod
(int method) void
setRegularStoreMethod
(int method) void
setTimeWindow
(String timeWindow) Sets the TimeWindow attribute of the DSSFile objectvoid
setTimeWindow
(String startTime, String endTime) Sets the TimeWindow attribute of the DSSFile objectvoid
setTrimMissing
(boolean trimMissing) Sets the "trim missing data" state of the DSSFile object If the "trim missing data" state is TRUE, blocks of missing data will be removed from the start and end of all regular time series recordsint
write the HecMath object out to diskint
write
(TimeSeriesMath mathGuy, String storeMethod) Write a time series to disk with a specified storage method.int
write
(DataContainer dataContainer) write the HecMath object out to diskint
write
(DataContainerTransformer rating) Write a RatingSet object to DSS
-
Field Details
-
_dataManager
The DSS data manager -
_filename
The DSS file that this DSSFile object represents -
_startTime
the default start of the timewindow -
_endTime
the default end of the timewindow -
_trimMissing
protected boolean _trimMissingspecifies whether to trim missing values from start and end of regular time-series -
_regularStoreMethod
protected int _regularStoreMethod -
_irregularStoreMethod
protected int _irregularStoreMethod
-
-
Constructor Details
-
DSSFile
Constructor for the DSSFile object- Parameters:
dataManager
- Description
-
-
Method Details
-
close
public void close()Explicitly close the DSS file -
forceMultiUserAccess
public void forceMultiUserAccess() -
done
public void done()Release the DSS file for this object -
isRemote
public boolean isRemote() -
getFilename
get the DSSFile's filename- Returns:
- the filename
-
getStartTime
get the timewindow start time- Returns:
- the start time
-
getEndTime
get the timewindow end time- Returns:
- the end time
-
getTrimMissing
public boolean getTrimMissing()Gets the "trim missing data" state of the DSSFile object If the "trim missing data" state is TRUE, blocks of missing data will be removed from the start and end of all regular time series records- Returns:
- true of trim missing is on
-
getRegularStoreMethod
public int getRegularStoreMethod() -
getIrregularStoreMethod
public int getIrregularStoreMethod() -
getDataManager
-
recordsUpdated
public int recordsUpdated(long startTime, Vector<String> pathnames, Vector<Long> updateTimes, Vector<Integer> recordTypes) Retrieves infomation about record updated since the specified time.Any of the vector parameters may be null if that information is not required. Any of the vectors that are not null are cleared before being populated.
- Parameters:
startTime
- Time after which to report updated records - in Java millisecondspathnames
- The list of pathnames of the records that have been updated - may be null.updateTimes
- The list of update times of the records that have been updated - may be null.recordTypes
- The list of types of the records that have been updated - may be null.- Returns:
- Zero if successful.
-
recordsUpdated
-
recordsUpdated
-
recordsUpdated
-
recordsUpdated
-
recordsUpdated
-
setFilename
Sets the Filename attribute of the DSSFile object- Parameters:
filename
- the new filename
-
setTimeWindow
Sets the TimeWindow attribute of the DSSFile object- Parameters:
timeWindow
- - a string containing the time window, which can be a relative reference ("T-5D T") or a regular date time span ("18MAR2005 28MAR2005" or "18MAR2005 2400 28MAR2005 2400"
-
setTimeWindow
Sets the TimeWindow attribute of the DSSFile object- Parameters:
startTime
- the default start of the timewindowendTime
- the default end of the timewindow
-
setTrimMissing
public void setTrimMissing(boolean trimMissing) Sets the "trim missing data" state of the DSSFile object If the "trim missing data" state is TRUE, blocks of missing data will be removed from the start and end of all regular time series records- Parameters:
trimMissing
- the "trim missing data" state
-
setRegularStoreMethod
public void setRegularStoreMethod(int method) -
setIrregularStoreMethod
public void setIrregularStoreMethod(int method) -
duplicateRecords
-
duplicateRecords
-
renameRecords
-
renameRecords
-
copyRecordsFrom
-
copyRecordsFrom
-
copyRecordsInto
-
copyRecordsInto
-
delete
-
delete
-
read
read from the file that this DSSFile represents the DSSPathname specified in pathname.- Parameters:
pathname
- DSS Pathname to read- Returns:
- HecMath: Either a TimeSeriesMath for TimeSeries Data or a PairedDataMath for Paired Data , or null if no data found
- Throws:
HecMathException
- DescriptionUnsupportedOperationException
- if the path name requested is not a TimeSeries record or a Paired Data record DSSFileException if there is an error reading the pathname
-
read
read from the file that this DSSFile represents the DSSPathname specified in pathname with the specified start and end times.- Parameters:
pathname
- DSS Pathname to read- Returns:
- HecMath: Either a TimeSeriesMath for TimeSeries Data or a PairedDataMath for Paired Data , or null if no data found
- Throws:
HecMathException
- Description
-
read
read from the file that this DSSFile represents the DSSPathname specified in pathname with the specified start and end times.- Parameters:
pathname
- DSS Pathname to readstartTime
- start of time windowendTime
- end of time window- Returns:
- HecMath: Either a TimeSeriesMath for TimeSeries Data or a PairedDataMath for Paired Data , or null if no data found
- Throws:
HecMathException
- Description
-
read
public HecMath read(String pathname, String startTime, String endTime, boolean trimMissing) throws HecMathException read from the file that this DSSFile represents the DSSPathname specified in pathname with the specified start and end times.- Parameters:
pathname
- DSS Pathname to readstartTime
- start of time windowendTime
- end of time windowtrimMissing
- trim missing from start and end of regular time series- Returns:
- HecMath: Either a TimeSeriesMath for TimeSeries Data or a PairedDataMath for Paired Data , or null if no data found
- Throws:
HecMathException
- Description
-
write
write the HecMath object out to disk- Parameters:
mathGuy
- HecMath object- Returns:
- returns 0 on successful write
- Throws:
HecMathException
- Description
-
write
Write a RatingSet object to DSS- Parameters:
rating
- The rating to store- Returns:
- 0 if successful
- Throws:
HecMathException
-
write
write the HecMath object out to disk- Parameters:
dataContainer
- DataContainer object- Returns:
- returns 0 on successful write
- Throws:
HecMathException
- Description
-
write
Write a time series to disk with a specified storage method.- Parameters:
mathGuy
- The TimeSeriesMath object to write.storeMethod
- The storage method to use. Valid methods (case insensitive) are:
Regular Time Series
"REPLACE_ALL"
"REPLACE_MISSING_VALUES_ONLY"
"REPLACE_ALL_CREATE"
"REPLACE_ALL_DELETE"
"REPLACE_WITH_NON_MISSING"
Irregular Time Series
"MERGE"
"DELETE_INSERT"- Returns:
- 0 if successful. Throws an exception otherwise.
- Throws:
HecMathException
- For invalid parameters or problem with the underlying write.
-
getCatalogedPathnames
Retrieves a list of all cataloged pathnames. The catalog is not refreshed in the process.- Returns:
- The list of cataloged pathnames.
-
getCatalogedPathnames
Retrieves a list of all cataloged pathnames, optionally refreshing the catalog in the process.- Parameters:
forceNew
- Specifies whether to refresh the catalog before retrieving the pathnames- Returns:
- The list of cataloged pathnames.
-
getCatalogedPathnames
Searches the cataloged pathnames, returning a list of those which match the specified instructions. The catalog is not refreshed in the process.- Parameters:
scanString
- The matching instructions for the search. This can be a pattern string with which to match the entire pathname, or it can specify pattern strings with which to match one or more parts of the pathname.Pattern strings have 2 special characters (actually 4, but 2 are aliases for the other 2). Special characters are:
- '@' or '*' - means "match zero or more characters at this location" and can occur anywhere in the matching pattern.
- '#' or '!' - means "negate the sense of this pattern" and can occur only as the first character of the pattern.
- "*FLOW*" matches any pathname that has the characters "FLOW" anywhere in the pathname.
- "B=TULA C=#TEMP@" matches any pathname that has a B part of "TULA" and a C part that does not begin with "TEMP"
- Returns:
- The list of matching pathnames.
-
searchPathnames
Searches the DSS file for pathnames, returning a list of those which match the specified instructions. This function does not use the catalog, but access the DSS file directly. Therefore, the pathnames will be unsorted. In comparison to getCatalogedPathnames, If the DSS file has had pathnames added or removed, then searchPathnames will be the fastest function. If not, and you need to do multiple searches, then getCatalogedPathnames will be faster.- Parameters:
scanString
- The matching instructions for the search. This can be a pattern string with which to match the entire pathname, or it can specify pattern strings with which to match one or more parts of the pathname.Pattern strings have 2 special characters (actually 4, but 2 are aliases for the other 2). Special characters are:
- '@' or '*' - means "match zero or more characters at this location" and can occur anywhere in the matching pattern.
- '#' or '!' - means "negate the sense of this pattern" and can occur only as the first character of the pattern.
- "*FLOW*" matches any pathname that has the characters "FLOW" anywhere in the pathname.
- "B=TULA C=#TEMP@" matches any pathname that has a B part of "TULA" and a C part that does not begin with "TEMP"
- Returns:
- The list of matching pathnames.
-
getCatalogedPathnames
Searches the cataloged pathnames, returning a list of those which match the specified instructions - optionally refreshing the catalog in the process.- Parameters:
scanString
- The matching instructions for the search. This can be a pattern string with which to match the entire pathname, or it can specify pattern strings with which to match one or more parts of the pathname.Pattern strings have 2 special characters (actually 4, but 2 are aliases for the other 2). Special characters are:
- '@' or '*' - means "match zero or more characters at this location" and can occur anywhere in the matching pattern.
- '#' or '!' - means "negate the sense of this pattern" and can occur only as the first character of the pattern.
- "*FLOW*" matches any pathname that has the characters "FLOW" anywhere in the pathname.
- "B=TULA C=#TEMP@" matches any pathname that has a B part of "TULA" and a C part that does not begin with "TEMP"
forceNew
- Specifies whether to refresh the catalog before performing the search.- Returns:
- The list of matching pathnames.
-
recordExists
check to see if the record specified bypathname
exists in this file- Parameters:
pathname
- the DSS pathname to check- Returns:
- true if the record exists.
-