com.isti.trinetwatch.emailer
Class StationReportBlock

java.lang.Object
  extended bycom.isti.trinetwatch.emailer.StationReportBlock
All Implemented Interfaces:
java.lang.Comparable, ReportDataBlock

public class StationReportBlock
extends java.lang.Object
implements ReportDataBlock

Class StationReportBlock contains the data items necessary for a report item on a station change event.


Field Summary
 java.lang.String newSLevelName
           
 java.lang.String newULevelName
           
static java.lang.String noneStr
           
 java.lang.String oldSLevelName
           
 java.lang.String oldULevelName
           
 java.util.Vector paramsVec
           
 java.lang.String stationName
           
 long timeVal
           
 
Constructor Summary
StationReportBlock(java.lang.String stationName, StatusLevelTag oldSLevelTag, StatusLevelTag newSLevelTag, UsageLevelTag oldULevelTag, UsageLevelTag newULevelTag, long timeVal)
          Creates a data block of items necessary for a report on a station change event.
StationReportBlock(java.lang.String stationName, java.lang.String oldSLevelName, java.lang.String newSLevelName, java.lang.String oldULevelName, java.lang.String newULevelName, long timeVal)
          Creates a data block of items necessary for a report on a station change event.
 
Method Summary
 int compareTo(java.lang.Object cmpObj)
          Compares this object with the given object for order.
 java.lang.String getDetailDisplayString(boolean shortFlag, java.lang.String indentStr)
          Returns a report-format display string of the "detail" items in this data block.
 java.lang.String getDisplayString(boolean showTimeFlag)
          Returns a report-format display string of the items in this data block.
 java.lang.String getDisplayString(boolean showTimeFlag, boolean noNameFlag)
          Returns a report-format display string of the items in this data block.
 java.lang.String getName()
          Returns the station name.
 java.lang.String getShortDisplayString()
          Returns a short-version report-format display string of the items in this data block.
 long getTimeVal()
          Returns the time value associated with the data (in seconds since 1/1/1970).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

noneStr

public static final java.lang.String noneStr
See Also:
Constant Field Values

stationName

public final java.lang.String stationName

oldSLevelName

public final java.lang.String oldSLevelName

newSLevelName

public final java.lang.String newSLevelName

oldULevelName

public final java.lang.String oldULevelName

newULevelName

public final java.lang.String newULevelName

timeVal

public final long timeVal

paramsVec

public final java.util.Vector paramsVec
Constructor Detail

StationReportBlock

public StationReportBlock(java.lang.String stationName,
                          java.lang.String oldSLevelName,
                          java.lang.String newSLevelName,
                          java.lang.String oldULevelName,
                          java.lang.String newULevelName,
                          long timeVal)
Creates a data block of items necessary for a report on a station change event.

Parameters:
stationName - station name.
oldSLevelName - "old" status level name.
newSLevelName - "new" status level name.
oldULevelName - "old" usage level name.
newULevelName - "new" usage level name.
timeVal - the time value associated with the data (in seconds since 1/1/1970).

StationReportBlock

public StationReportBlock(java.lang.String stationName,
                          StatusLevelTag oldSLevelTag,
                          StatusLevelTag newSLevelTag,
                          UsageLevelTag oldULevelTag,
                          UsageLevelTag newULevelTag,
                          long timeVal)
Creates a data block of items necessary for a report on a station change event.

Parameters:
stationName - station name.
oldSLevelTag - "old" status level tag object.
newSLevelTag - "new" status level tag object.
oldULevelTag - "old" usage level tag object.
newULevelTag - "new" usage level tag object.
timeVal - the time value associated with the data (in seconds since 1/1/1970).
Method Detail

getName

public java.lang.String getName()
Returns the station name.

Specified by:
getName in interface ReportDataBlock
Returns:
The station name.

getTimeVal

public long getTimeVal()
Returns the time value associated with the data (in seconds since 1/1/1970).

Specified by:
getTimeVal in interface ReportDataBlock
Returns:
The time value associated with the data (in seconds since 1/1/1970).

getDisplayString

public java.lang.String getDisplayString(boolean showTimeFlag,
                                         boolean noNameFlag)
Returns a report-format display string of the items in this data block.

Specified by:
getDisplayString in interface ReportDataBlock
Parameters:
showTimeFlag - true to display the time value with the data.
noNameFlag - true to not display the station name and to put the time value after the data, false to display the station name and to put the time value before the data.
Returns:
A report-format display string of the items in this data block.

getDisplayString

public java.lang.String getDisplayString(boolean showTimeFlag)
Returns a report-format display string of the items in this data block.

Specified by:
getDisplayString in interface ReportDataBlock
Parameters:
showTimeFlag - true to display the time value after the data.
Returns:
A report-format display string of the items in this data block.

getShortDisplayString

public java.lang.String getShortDisplayString()
Returns a short-version report-format display string of the items in this data block.

Specified by:
getShortDisplayString in interface ReportDataBlock
Returns:
A short-version report-format display string of the items in this data block.

getDetailDisplayString

public java.lang.String getDetailDisplayString(boolean shortFlag,
                                               java.lang.String indentStr)
Returns a report-format display string of the "detail" items in this data block.

Specified by:
getDetailDisplayString in interface ReportDataBlock
Parameters:
shortFlag - if true then a short version of the display string is returned.
indentStr - indentation to use, or null for default indentation.
Returns:
A report-format display string of the items in this data block.

compareTo

public int compareTo(java.lang.Object cmpObj)
Compares this object with the given object for order. The 'stationName' string is used for the comparison, with the network code prefix (i.e. "CI-") used as a secondary comparison value.

Specified by:
compareTo in interface ReportDataBlock
Parameters:
cmpObj - a 'StationReportBlock' object to compare to.
Returns:
A negative integer, zero or a positive integer as this object is less than, equal to or greater than the given object.
Throws:
'ClassCastException' - if the given object is not of type 'StationReportBlock'.