public final class TimeWindow extends Object
| Modifier and Type | Field and Description |
|---|---|
static SimpleDateFormat |
DATE_FORMAT |
static String |
DATE_PATTERN |
static Pattern |
EDGE_PATTERN |
| Constructor and Description |
|---|
TimeWindow(String name) |
TimeWindow(String name,
long start,
long end,
boolean persistent) |
TimeWindow(String name,
String start,
String end,
boolean persistent) |
TimeWindow(TimeWindow seed) |
| Modifier and Type | Method and Description |
|---|---|
static Comparator<TimeWindow> |
compareByName()
Returns comparator that compares time windows by names.
|
static Comparator |
compareByTime()
Returns comparator that compares time windows by last use times, most recent first.
|
long |
getLastUseTime()
Returns the time in milliseconds when this time window was last selected.
|
long |
getLength() |
long |
getLowerEdge()
Returns the current value of the lower edge of this window.
|
long |
getLowerEdge(long currentTime)
Returns the lower edge of this time window at the specified time.
|
long |
getLowerEdgeDelay()
Returns the difference between the lower edge of this time window and the current time.
|
String |
getLowerEdgeString()
Returns the lower edge of this time window in standard format.
|
String |
getName()
Returns the name of this time window.
|
long |
getUpperEdge()
Returns the current value of the upper edge of this window.
|
long |
getUpperEdge(long currentTime)
Returns the upper edge of this time window at the specified time.
|
long |
getUpperEdgeDelay()
Returns the difference between the upper edge of this time window and the current time.
|
String |
getUpperEdgeString()
Returns the lower edge of this time window in standard format.
|
boolean |
isFixed()
Returns true if both edges do not depend on current time.
|
boolean |
isLowerEdgeFixed()
Returns true if lower edge does not depend on current time.
|
boolean |
isPersistent()
Returns true if this time window should be persisted between sessions.
|
boolean |
isUpperEdgeFixed()
Returns true if upper edge does not depend on current time.
|
static TimeWindow |
parseCompressedString(String s)
Parses string representation of this time window used for saving it in application properties.
|
static long |
parseEdge(String edgeString)
Parses string representation of a time window edge in standard format.
|
void |
setLowerEdge(String edge)
Sets lower edge of this time window.
|
void |
setName(String name)
Sets the name of this time window.
|
void |
setPersistent(boolean persistent)
Sets the flag that indicate whether or not this time window should be persisted between sessions.
|
void |
setUpperEdge(String edge)
Sets upper edge of this time window.
|
String |
toCompressedString()
Returns string representation of this time window used for saving it in application properties.
|
String |
toString()
Returns user-readable string representation of this time window.
|
void |
touch()
Sets the time when this time window was last selected to the current system time.
|
public static final String DATE_PATTERN
public static final SimpleDateFormat DATE_FORMAT
public static final Pattern EDGE_PATTERN
public TimeWindow(String name, long start, long end, boolean persistent)
public TimeWindow(String name)
public TimeWindow(TimeWindow seed)
public String getName()
public void setName(String name)
public boolean isFixed()
public boolean isLowerEdgeFixed()
public boolean isUpperEdgeFixed()
public long getLowerEdgeDelay()
public long getUpperEdgeDelay()
public long getLowerEdge()
public long getUpperEdge()
public long getLowerEdge(long currentTime)
public long getUpperEdge(long currentTime)
public String getLowerEdgeString()
public String getUpperEdgeString()
public void setLowerEdge(String edge)
edge - Edge value in standard format.IllegalArgumentException - if the specified string is not in standard format.public void setUpperEdge(String edge)
edge - Edge value in standard format.IllegalArgumentException - if the specified string is not in standard format.public long getLength()
public boolean isPersistent()
public void setPersistent(boolean persistent)
public long getLastUseTime()
public void touch()
public String toString()
public String toCompressedString()
public static long parseEdge(String edgeString)
public static TimeWindow parseCompressedString(String s)
public static Comparator<TimeWindow> compareByName()
public static Comparator compareByTime()
Copyright © 2018 LSST. All rights reserved.