Package hec.heclib.dss
Class HecDss
java.lang.Object
hec.heclib.dss.HecDss
HecDss objects are used to retrieve and store data sets in a DSS file,
as well as several utility functions for DSS files. Data is retrieved
and stored using DataContainers. DataContainers are simple classes that are
database independent and are how most Hec classes exchange data.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DssDataManagerThe DSS data managerprotected Stringthe default end of the timewindowprotected StringThe DSS file that this object representsprotected intprotected intprotected Stringthe default start of the timewindowprotected booleanspecifies whether to trim missing values from start and end of regular time-series -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidclose()Explicitly close the DSS fileintcopyRecordsFrom(String toDSSFilename, String[] pathnameList) intcopyRecordsFrom(String toDSSFilename, Vector pathnameList) intcopyRecordsInto(String fromDSSFilename, String[] pathnameList) intcopyRecordsInto(String fromDSSFilename, Vector pathnameList) intintvoiddone()Release the DSS file for this objectintduplicateRecords(String[] pathnameList, String[] newPathnameList) intduplicateRecords(Vector pathnameList, Vector newPathnameList) voidprotected DataContainerget(DataReference dataSet) get(DSSIdentifier dssId) 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.Returns a condensed list of pathnames in the file This means that each data set is in one data reference, which spans all time for that set, regardless of the number of records.static booleangetDssFilename(String inputFilename, stringContainer outputFilename, boolean alwaysGetCanonical) Retrieves the path for an input DSS file name, adding the ".dss" extension if necessaryget the timewindow end timeget the filenameintGets a unsorted list of all pathnames in the file (This can be time consuming, so don't do often)intget the timewindow start timebooleangetTimeSeriesExtents(String pathname, HecTime start, HecTime end) Gets the time of the first data and last data in a data set, (not just a single pathname)booleanGets the "trim missing data" statebooleanisOpened()booleanisRemote()static HecDssstatic HecDssstatic HecDssstatic HecDssstatic HecDssstatic HecDssstatic HecDssvoidput(DataContainer dataContainer) voidbooleanrecordExists(String pathname) recordsUpdated(long startTime) intrecordsUpdated(long startTime, Vector<String> pathnames, Vector<Long> updateTimes, Vector<Integer> recordTypes) Retrieves information about records updated since the specified time.recordsUpdated(HecTime startTime) intrecordsUpdated(HecTime startTime, Vector<String> pathnames, Vector<Long> updateTimes, Vector<Integer> recordTypes) recordsUpdated(String startTime) intrecordsUpdated(String startTime, Vector<String> pathnames, Vector<Long> updateTimes, Vector<Integer> recordTypes) intrenameRecords(String[] pathnameList, String[] newPathnameList) intrenameRecords(Vector pathnameList, Vector newPathnameList) searchPathnames(String scanString) Deprecated.voidsetFilename(String filename) Sets the filenamevoidsetIrregularStoreMethod(int method) voidsetRegularStoreMethod(int method) voidsetTimeWindow(String timeWindow) Sets the time windowvoidsetTimeWindow(String startTime, String endTime) Sets the time windowvoidsetTrimMissing(boolean trimMissing) Sets the "trim missing data" stateintintintwrite(DataContainer dataContainer) intwrite(DataContainerTransformer transformer)
-
Field Details
-
_dataManager
The DSS data manager -
_filename
The DSS file that this 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
-
HecDss
-
-
Method Details
-
open
- Throws:
Exception
-
open
- Throws:
Exception
-
open
- Throws:
Exception
-
open
- Throws:
Exception
-
open
- Throws:
Exception
-
open
- Throws:
Exception
-
open
public static HecDss open(String dssFileName, boolean mustExist, boolean isRemote, int dssVersion) throws Exception - Throws:
Exception
-
getDssFilename
public static boolean getDssFilename(String inputFilename, stringContainer outputFilename, boolean alwaysGetCanonical) throws IOException Retrieves the path for an input DSS file name, adding the ".dss" extension if necessary- Parameters:
inputFilename- The relative or absolute path of a DSS file, with or without the extensionoutputFilename- The (possibly absolute) path of the DSS file with the extensionalwaysGetCanonical- Specifies whether to retrieve the absolute path for the DSS file even if the file doesn't exist.- Returns:
- Whether the DSS file exists
- Throws:
IOException
-
isOpened
public boolean isOpened() -
get
- Throws:
Exception
-
get
- Throws:
Exception
-
get
- Throws:
Exception
-
get
- Throws:
Exception
-
get
- Throws:
Exception
-
put
- Throws:
Exception
-
put
- Throws:
Exception
-
read
- Throws:
Exception
-
read
- Throws:
Exception
-
read
- Throws:
Exception
-
read
public IHecMath read(String pathname, String startTime, String endTime, boolean trimMissing) throws Exception - Throws:
Exception
-
write
- Throws:
Exception
-
write
- Throws:
Exception
-
write
- Throws:
Exception
-
write
- Throws:
Exception
-
getTimeSeriesExtents
Gets the time of the first data and last data in a data set, (not just a single pathname)- Parameters:
pathname- Stringstart- HecTime - time of first piece of dataend- HecTime - time of last piece of data- Returns:
- boolean - true if found and time series; false if not TS
-
recordExists
-
getPathnameList
Gets a unsorted list of all pathnames in the file (This can be time consuming, so don't do often)- Returns:
- Vector of strings with pathnames
-
getCondensedCatalog
Returns a condensed list of pathnames in the file This means that each data set is in one data reference, which spans all time for that set, regardless of the number of records. This is very intensive, requiring sorting and such, so use sparingly- Returns:
- Vector
-
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 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- Returns:
- true if 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 information about records 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- Parameters:
filename- the new filename
-
setTimeWindow
Sets the time window- 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 time window- 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" stateIf 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
-
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.- Returns:
- The list of matching pathnames.
-
searchPathnames
Deprecated.UsegetCatalogedPathnames(String)instead. -
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.forceNew- Specifies whether to refresh the catalog before performing the search.- Returns:
- The list of matching pathnames.
-
checkForError
- Throws:
Exception
-
getCatalogedPathnames(String)instead.