Package gov.nasa.jpl.scheduler
Class Window
java.lang.Object
gov.nasa.jpl.scheduler.Window
- All Implemented Interfaces:
Comparable<Window>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Window[]intbooleanReturns true if the parameter Window is within the calling Window, inclusivebooleanReturns true if the parameter time is within the calling Window, inclusivebooleangetEnd()getIntersectingWindowInList(NavigableSet<Window> windowsToCheck) Returns original Window object from windowsToCheck that intersects this/self, or null if there are no intersections.getStart()getType()static Window[]getWindows(Condition condition, Time queryStart, Time queryEnd) Returns an array of window objects where the input condition is met within the start and end time provided.booleanhasEnd()inthashCode()booleanstatic Window[]interpWindows(Condition condition, Time queryStart, Time queryEnd) Returns an array of window objects where the input condition is met within the start and end time provided.booleanintersects(Window w) Returns true if the parameter Window intersects the calling Windowstatic Window[]Loops through list of windows and returns list where entries separated by less than Duration parameter are mergedstatic Window[]static Window[]static DurationReturns a duration equal to the sum of all the durations in the provided listtoString()static Window[]
-
Constructor Details
-
Window
-
Window
-
-
Method Details
-
getStart
-
getEnd
-
getType
-
hasEnd
public boolean hasEnd() -
getDuration
-
getMidpoint
-
contains
Returns true if the parameter time is within the calling Window, inclusive- Parameters:
t-- Returns:
-
contains
Returns true if the parameter Window is within the calling Window, inclusive- Parameters:
w-- Returns:
-
intersects
Returns true if the parameter Window intersects the calling Window- Parameters:
w-- Returns:
-
hasLengthZero
public boolean hasLengthZero() -
toString
-
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<Window>
-
hashCode
public int hashCode() -
sum
Returns a duration equal to the sum of all the durations in the provided list- Parameters:
windows-- Returns:
-
getWindows
Returns an array of window objects where the input condition is met within the start and end time provided.- Parameters:
condition-queryStart-queryEnd-- Returns:
-
interpWindows
Returns an array of window objects where the input condition is met within the start and end time provided. Unlike getWindows, this method interprets double resources to determine the time when the value crosses a threshold. Currently only works for single-node conditions whose resource is a DoubleResource.- Parameters:
condition-queryStart-queryEnd-- Returns:
-
and
-
or
-
xor
-
not
-
merge
Loops through list of windows and returns list where entries separated by less than Duration parameter are merged- Parameters:
toBeMerged- List of Windows, must be sorted alreadythreshold- Duration between adjacent windows below which they will be merged together- Returns:
- A new Window array containing the merged list
-