org.bioquery.query
Class Query.QueryDescriptor

java.lang.Object
  |
  +--org.bioquery.query.Query.QueryDescriptor
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
Query

public class Query.QueryDescriptor
extends java.lang.Object
implements java.io.Serializable

Inner class holds data about the file this Query is saved in, and the details about automatic submission. This class is automatically created with the Query. To access it's data, get a reference to the QuerySubmitter using the getQueryDescriptor method in the Query, and then call the public methods of this class.

See Also:
Serialized Form

Method Summary
 boolean autoSubmitOn()
          Returns whether the Query should automatically be submitted at some interval.
 java.util.Date getCreated()
          The Date the Query was created.
 java.lang.String getEmailAddress()
          Returns the EMail address that the results of this Query should be sent to (if getSendEmail() == true).
 java.lang.String getFilePath()
          The path on the server this file is saved to.
 int getIncrementNumber()
          Returns the number of time units in between each automatic submission of this Query.
 java.util.Date getLastModified()
          The date the Query was last modified.
 java.util.Date getLastSubmitted()
          The Date of the last time the Query was submitted.
 java.util.Date getNextSubmitDate()
          Returns the Date at which the next automatic submission should occur.
 java.util.Date getReferencePoint()
          Returns the Reference Point: a Date that simply marks a point in time.
 java.lang.String getSaveDirectory()
          Returns the path to the Directory that the results of this Query should be saved to (if getSaveToFile() == true).
 boolean getSaveToFile()
          Returns whether the user wishes to have the results of this Query saved to a file.
 boolean getSendEmail()
          Returns whether the user wishes to have the results of this Query sent to them by Email.
 int getSubmitIncrement()
          Returns an int that is the unit of how often the Query is automatically submitted.
 java.lang.String getSubmitIncrementText()
          Returns the auto-submit increment unit in textual format.
 int getSubmitLineNumber()
          Returns the QueryLine line number that will be submitted to the database.
 java.lang.String[] getTimeIncrements()
          Gets an array of Strings representing the human-readable options for time increments (for example: 'Day', 'Week', or 'Month').
 java.lang.String getTimeUnit(int unit)
          Converts the int constant time increment (from the Calendar class) to the human-readable time increment.
 int getTimeUnit(java.lang.String unit)
          Converts a human-readable time increment into the int constant time increment (from the Calendar class).
 void incrementNextSubmitDate()
          Resets the Next Submit Date.
 void setAutoSubmit(boolean submit)
          Switch that determines whether the Query should automatically be submitted at some interval.
protected  void setCreated(java.util.Date dateCreated)
          The Date the Query was created.
 void setEmailAddress(java.lang.String emailAddress)
          Sets the EMail address that the results of this Query should be sent to (if getSendEmail() == true).
 void setFilePath(java.lang.String path)
          The path on the server this file is saved to.
 void setIncrementNumber(int number)
          Sets the number of time units in between each automatic submission of this Query.
 void setLastModified(java.util.Date dateLastModified)
          The date the Query was last modified.
 void setLastSubmitted(java.util.Date dateLastSubmitted)
          The Date of the last time the Query was submitted.
 void setNextSubmitDate()
          This calculates and sets the NextSubmitDate based on the interval between automatic submissions and the ReferencePoint Date.
 void setNextSubmitDate(java.util.Date date)
          Explicitly sets the Next Submit Date to the given value.
 void setReferencePoint(java.util.Date date)
          Sets the Reference Point: a Date that simply marks a point in time.
 void setSaveDirectory(java.lang.String saveDirectory)
          Sets the path to the Directory that the results of this Query should be saved to (if getSaveToFile() == true).
 void setSaveToFile(boolean saveToFile)
          Sets whether the user wishes to have the results of this Query saved to a file.
 void setSendEmail(boolean sendEmail)
          Sets whether the user wishes to have the results of this Query sent to them by Email.
 void setSubmitIncrement(int increment)
          Sets the units used to determine how often the Query is automatically submitted.
 void setSubmitIncrement(java.lang.String unit)
          Sets the units used to determine how often the Query is automatically submitted.
 void setSubmitLineNumber(int lineNum)
          Sets which QueryLine will be submitted to the database.
 void updateLastModified()
          Sets the date the Query was last modified to Now.
 void updateLastSubmitted()
          Sets the lastSubmitted date to Now.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFilePath

public java.lang.String getFilePath()
The path on the server this file is saved to.

setFilePath

public void setFilePath(java.lang.String path)
The path on the server this file is saved to.

getCreated

public java.util.Date getCreated()
The Date the Query was created.

setCreated

protected void setCreated(java.util.Date dateCreated)
The Date the Query was created.

getLastSubmitted

public java.util.Date getLastSubmitted()
The Date of the last time the Query was submitted. This is not automatically set when the QuerySubmitter sends the Query. It should be programmatically set using setLastSubmitter.

setLastSubmitted

public void setLastSubmitted(java.util.Date dateLastSubmitted)
The Date of the last time the Query was submitted.

updateLastSubmitted

public void updateLastSubmitted()
Sets the lastSubmitted date to Now.

getLastModified

public java.util.Date getLastModified()
The date the Query was last modified.

setLastModified

public void setLastModified(java.util.Date dateLastModified)
The date the Query was last modified.

updateLastModified

public void updateLastModified()
Sets the date the Query was last modified to Now.

autoSubmitOn

public boolean autoSubmitOn()
Returns whether the Query should automatically be submitted at some interval.

setAutoSubmit

public void setAutoSubmit(boolean submit)
Switch that determines whether the Query should automatically be submitted at some interval.

getSubmitLineNumber

public int getSubmitLineNumber()
Returns the QueryLine line number that will be submitted to the database.

setSubmitLineNumber

public void setSubmitLineNumber(int lineNum)
Sets which QueryLine will be submitted to the database.

getReferencePoint

public java.util.Date getReferencePoint()
Returns the Reference Point: a Date that simply marks a point in time. This is used to calculate the Date of the next automatic submission of the Query.

setReferencePoint

public void setReferencePoint(java.util.Date date)
Sets the Reference Point: a Date that simply marks a point in time. This is used to calculate the automatic submit Date relative to this point. A Date is a very compact way to save a point in time that, when looked up in a Calendar, tells you what day of the week, month, year, etc. is saved.

getSubmitIncrementText

public java.lang.String getSubmitIncrementText()
Returns the auto-submit increment unit in textual format. That is, this text can complete the sentence "This Query will be submitted every: " with an appropriate word such as "Day", "Week", "Month", "Monday", etc. The number of these units is independently retrieved with getIncrementNumber.

getSubmitIncrement

public int getSubmitIncrement()
Returns an int that is the unit of how often the Query is automatically submitted. This int relates to the time unit constants in the Calendar class such as Calendar.MONTH etc.

setSubmitIncrement

public void setSubmitIncrement(int increment)
Sets the units used to determine how often the Query is automatically submitted. This int relates to the time unit constants in the Calendar class such as Calendar.MONTH etc.

setSubmitIncrement

public void setSubmitIncrement(java.lang.String unit)
Sets the units used to determine how often the Query is automatically submitted. This is based on a String representation of the unit such as those retireved by getSubmitIncrementText

getIncrementNumber

public int getIncrementNumber()
Returns the number of time units in between each automatic submission of this Query. Multiple this number times the Increment Unit retrieved via getTimeIncrementText and you will have the actual interval between automatic submissions.

setIncrementNumber

public void setIncrementNumber(int number)
Sets the number of time units in between each automatic submission of this Query. Multiple this number times the Increment Unit retrieved via getTimeIncrementText and you will have the actual interval between automatic submissions.

getNextSubmitDate

public java.util.Date getNextSubmitDate()
Returns the Date at which the next automatic submission should occur.

setNextSubmitDate

public void setNextSubmitDate()
This calculates and sets the NextSubmitDate based on the interval between automatic submissions and the ReferencePoint Date. Adds the interval (IncrementUnit X IncrementNumber) to the Reference Point repeatedly until a Date is found that is in the future. The Next Submit Date is thus the earliest Date in the future that is a multiple of Intervals after the Reference Point.

setNextSubmitDate

public void setNextSubmitDate(java.util.Date date)
Explicitly sets the Next Submit Date to the given value. Usually it is preferrable to calculate this value via setNextSubmitDate().

incrementNextSubmitDate

public void incrementNextSubmitDate()
Resets the Next Submit Date. This sets the Reference Point to the current Next Submit Date, and then calls setNextSubmitDate. This is the same as calling setNextSubmitDate, except that by moving the Reference Point up it speeds up the calculations for all future calls to setNextSubmitDate.

getSendEmail

public boolean getSendEmail()
Returns whether the user wishes to have the results of this Query sent to them by Email.

setSendEmail

public void setSendEmail(boolean sendEmail)
Sets whether the user wishes to have the results of this Query sent to them by Email.

getSaveToFile

public boolean getSaveToFile()
Returns whether the user wishes to have the results of this Query saved to a file.

setSaveToFile

public void setSaveToFile(boolean saveToFile)
Sets whether the user wishes to have the results of this Query saved to a file.

getEmailAddress

public java.lang.String getEmailAddress()
Returns the EMail address that the results of this Query should be sent to (if getSendEmail() == true).

setEmailAddress

public void setEmailAddress(java.lang.String emailAddress)
Sets the EMail address that the results of this Query should be sent to (if getSendEmail() == true).

getSaveDirectory

public java.lang.String getSaveDirectory()
Returns the path to the Directory that the results of this Query should be saved to (if getSaveToFile() == true).

setSaveDirectory

public void setSaveDirectory(java.lang.String saveDirectory)
Sets the path to the Directory that the results of this Query should be saved to (if getSaveToFile() == true).

getTimeIncrements

public java.lang.String[] getTimeIncrements()
Gets an array of Strings representing the human-readable options for time increments (for example: 'Day', 'Week', or 'Month'). Each String corresponds to a Calendar int value for that time increment.
Returns:
an array of Strings that represent all available time increments.

getTimeUnit

public java.lang.String getTimeUnit(int unit)
Converts the int constant time increment (from the Calendar class) to the human-readable time increment. This only works for those increments included as options for the bioquery application (for example: 'Day', 'Week', or 'Month').
Parameters:
unit - A Calendar class time constant (for example: Calendar.DATE).
Returns:
A String representing that time constant (for example: "Day").

getTimeUnit

public int getTimeUnit(java.lang.String unit)
Converts a human-readable time increment into the int constant time increment (from the Calendar class). This only works for those increments included as options for the bioquery application (for example: 'Day', 'Week', or 'Month').
Parameters:
unit - A String representing that time constant (for example: "Day").
Returns:
A Calendar class time constant (for example: Calendar.DATE).