org.opengts.war.report
Class ReportConstraints

java.lang.Object
  extended by org.opengts.war.report.ReportConstraints
All Implemented Interfaces:
java.lang.Cloneable

public class ReportConstraints
extends java.lang.Object
implements java.lang.Cloneable


Field Summary
static int WHERE_AND
           
static int WHERE_OR
           
static int WHERE_SET
           
 
Constructor Summary
ReportConstraints()
          Default constructor
ReportConstraints(long timeStart, long timeEnd)
          Constructor
ReportConstraints(long timeStart, long timeEnd, boolean validGPS, EventData.LimitType selLimitType, long selLimit)
          Constructor
ReportConstraints(ReportConstraints rc)
          Copy Constructor
 
Method Summary
protected  void _appendWhere(java.lang.String dbsel, int op)
          Appends the specified DB selection 'WHERE' clause
 void andWhere(java.lang.String dbsel)
          Adds ("AND's) the specified selection clause with the current 'WHERE' selection clause
 java.lang.Object clone()
          Returns a clone of this ReportConstraints instance
 java.lang.String getEmailAddresses()
           
 boolean getOrderAscending()
          Returns true if the data records are to be in ascending order
 long getReportLimit()
          Gets the report limit
 java.lang.String getRuleSelector()
          Gets the rule selector constraint
 long getSelectionLimit()
          Gets the selection limit
 EventData.LimitType getSelectionLimitType()
          Gets the selection limit type
 int[] getStatusCodes()
          Gets the status code constraints
 long getTimeEnd()
          Gets the time 'end' constraint
 long getTimeStart()
          Gets the time 'start' constraint
 java.util.TimeZone getTimeZone()
          Gets the timezone
 boolean getValidGPSRequired()
          Returns true if all events require a valid GPS fix
 java.lang.String getWhere()
          Gets the selection 'WHERE' clause
 boolean hasEmailAddresses()
           
 boolean hasReportLimit()
          Returns true if a report limit has been defined
 boolean hasRuleSelector()
          Return true if a rule selector constraint has been defined
 boolean hasSelectionLimit()
          Returns true if a selection limit has been defined
 boolean hasStatusCodes()
          Return true if status code constraints have been defined
 boolean hasWhere()
          Returns true if a selection 'WHERE' clause has been defined
 void orWhere(java.lang.String dbsel)
          Adds ("OR's) the specified selection clause with the current 'WHERE' selection clause
 void setEmailAddresses(java.lang.String emailAddr)
           
 void setOrderAscending(boolean ascending)
          Sets whether data records are to be in ascending order
 void setReportLimit(long limit)
          Sets the report limit
 void setRuleSelector(java.lang.String ruleSel)
          Sets the rule selector constraint
 void setSelectionLimit(EventData.LimitType limitType, long limit)
          Sets the selection limit and type
 void setSelectionLimit(long limit)
          Sets the selection limit
 void setStatusCodes(int[] sc)
          Sets the status code constraints
 void setTimeEnd(long te)
          Sets the time 'end' constraint
 void setTimeRange(long timeStart, long timeEnd)
          Sets the time 'start'/'end' constraint
 void setTimeStart(long ts)
          Sets the time 'start' constraint
 void setTimeZone(java.util.TimeZone tmz)
          Sets the timezone
 void setValidGPSRequired(boolean reqGPS)
          Sets whether a valid GPS fix is required for all events
 void setWhere(java.lang.String dbsel)
          Sets the selection 'WHERE' clause
 java.lang.String toString()
          Returns a String representation of this ReportConstraints instance
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WHERE_SET

public static final int WHERE_SET
See Also:
Constant Field Values

WHERE_OR

public static final int WHERE_OR
See Also:
Constant Field Values

WHERE_AND

public static final int WHERE_AND
See Also:
Constant Field Values
Constructor Detail

ReportConstraints

public ReportConstraints()
Default constructor


ReportConstraints

public ReportConstraints(long timeStart,
                         long timeEnd)
Constructor

Parameters:
timeStart - Time 'start' constraint
timeEnd - Time 'end' constraint

ReportConstraints

public ReportConstraints(long timeStart,
                         long timeEnd,
                         boolean validGPS,
                         EventData.LimitType selLimitType,
                         long selLimit)
Constructor

Parameters:
timeStart - Time 'start' constraint
timeEnd - Time 'end' constraint
validGPS - If true, only events with a valid GPS fix are allowed, false to allow all events
selLimitType - The Selection limit type (ie. first/last)
selLimit - The Selection limit

ReportConstraints

public ReportConstraints(ReportConstraints rc)
Copy Constructor

Parameters:
rc - The ReportConstraints to copy (shallow copy)
Method Detail

setTimeZone

public void setTimeZone(java.util.TimeZone tmz)
Sets the timezone

Parameters:
tmz - The timezone

getTimeZone

public java.util.TimeZone getTimeZone()
Gets the timezone

Returns:
The timezone (may be null)

setTimeStart

public void setTimeStart(long ts)
Sets the time 'start' constraint

Parameters:
ts - The time 'start' constraint

getTimeStart

public long getTimeStart()
Gets the time 'start' constraint

Returns:
The time 'start' constraint

setTimeEnd

public void setTimeEnd(long te)
Sets the time 'end' constraint

Parameters:
te - The time 'start' constraint

getTimeEnd

public long getTimeEnd()
Gets the time 'end' constraint

Returns:
The time 'end' constraint

setTimeRange

public void setTimeRange(long timeStart,
                         long timeEnd)
Sets the time 'start'/'end' constraint

Parameters:
timeStart - The time 'start' constraint
timeEnd - The time 'end' constraint

getValidGPSRequired

public boolean getValidGPSRequired()
Returns true if all events require a valid GPS fix

Returns:
True if all events require a valid GPS fix

setValidGPSRequired

public void setValidGPSRequired(boolean reqGPS)
Sets whether a valid GPS fix is required for all events

Parameters:
reqGPS - True to require valid a GPS fix, false to allow all events

getOrderAscending

public boolean getOrderAscending()
Returns true if the data records are to be in ascending order

Returns:
True if the data records are to be in ascending order

setOrderAscending

public void setOrderAscending(boolean ascending)
Sets whether data records are to be in ascending order

Parameters:
ascending - True to sort data records in ascending order

getSelectionLimitType

public EventData.LimitType getSelectionLimitType()
Gets the selection limit type

Returns:
The selection limit type

getSelectionLimit

public long getSelectionLimit()
Gets the selection limit

Returns:
The selection limit (-1 for no limit)

hasSelectionLimit

public boolean hasSelectionLimit()
Returns true if a selection limit has been defined

Returns:
True if a selection limit has been defined, false otherwise

setSelectionLimit

public void setSelectionLimit(long limit)
Sets the selection limit

Parameters:
limit - The selection limit, or -1 to specify no limit

setSelectionLimit

public void setSelectionLimit(EventData.LimitType limitType,
                              long limit)
Sets the selection limit and type

Parameters:
limitType - The selection limit type (may be one of EventData.LimitType.FIRST or EventData.LimitType.LAST)
limit - The selection limit

getReportLimit

public long getReportLimit()
Gets the report limit

Returns:
The report limit (-1 for no limit)

hasReportLimit

public boolean hasReportLimit()
Returns true if a report limit has been defined

Returns:
True if a report limit has been defined, false otherwise

setReportLimit

public void setReportLimit(long limit)
Sets the report limit

Parameters:
limit - The report limit, or -1 to specify no limit

getWhere

public java.lang.String getWhere()
Gets the selection 'WHERE' clause

Returns:
The selection 'WHERE' clause

hasWhere

public boolean hasWhere()
Returns true if a selection 'WHERE' clause has been defined

Returns:
True is a selection 'WHERE' clause has been defined

setWhere

public void setWhere(java.lang.String dbsel)
Sets the selection 'WHERE' clause

Parameters:
dbsel - The DB selection 'WHERE' clause

orWhere

public void orWhere(java.lang.String dbsel)
Adds ("OR's) the specified selection clause with the current 'WHERE' selection clause

Parameters:
dbsel - The selection clause to append to the current clause

andWhere

public void andWhere(java.lang.String dbsel)
Adds ("AND's) the specified selection clause with the current 'WHERE' selection clause

Parameters:
dbsel - The selection clause to append to the current clause

_appendWhere

protected void _appendWhere(java.lang.String dbsel,
                            int op)
Appends the specified DB selection 'WHERE' clause

Parameters:
dbsel - The selection clause to append
op - The append operation (WHERE_SET, WHERE_OR, WHERE_AND)

getRuleSelector

public java.lang.String getRuleSelector()
Gets the rule selector constraint

Returns:
The rule selector constraint

hasRuleSelector

public boolean hasRuleSelector()
Return true if a rule selector constraint has been defined

Returns:
True if a rule selector constraint has been defined

setRuleSelector

public void setRuleSelector(java.lang.String ruleSel)
Sets the rule selector constraint

Parameters:
ruleSel - The rule selector constraint

getStatusCodes

public int[] getStatusCodes()
Gets the status code constraints

Returns:
An array of status codes

hasStatusCodes

public boolean hasStatusCodes()
Return true if status code constraints have been defined

Returns:
True if status code constraints have been defined

setStatusCodes

public void setStatusCodes(int[] sc)
Sets the status code constraints

Parameters:
sc - The status code constraints

hasEmailAddresses

public boolean hasEmailAddresses()

getEmailAddresses

public java.lang.String getEmailAddresses()

setEmailAddresses

public void setEmailAddresses(java.lang.String emailAddr)

clone

public java.lang.Object clone()
Returns a clone of this ReportConstraints instance

Overrides:
clone in class java.lang.Object
Returns:
The cloned ReportConstrains instance

toString

public java.lang.String toString()
Returns a String representation of this ReportConstraints instance

Overrides:
toString in class java.lang.Object
Returns:
The String representation