Package ch.poole.openinghoursparser
Class TimeSpan
- java.lang.Object
-
- ch.poole.openinghoursparser.TimeSpan
-
- All Implemented Interfaces:
Copy<ch.poole.openinghoursparser.Element>
public class TimeSpan extends java.lang.ObjectContainer for objects from the opening_hours specification
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_EXTENDED_TIMEstatic intMAX_TIMEstatic intMIN_TIMEstatic intUNDEFINED_TIME
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TimeSpancopy()Create a copy of the objeczbooleanequals(java.lang.Object other)intgetEnd()VariableTimegetEndEvent()intgetInterval()intgetStart()VariableTimegetStartEvent()inthashCode()booleanisOpenEnded()voidsetEnd(int e)Set the end of range valuevoidsetEndEvent(VariableTime endEvent)voidsetInterval(int interval)voidsetOpenEnded(boolean openEnded)voidsetStart(int s)Set the start of range valuevoidsetStartEvent(VariableTime startEvent)java.lang.StringtoDebugString()Create a string that identifies which class created it for debugging and testingjava.lang.StringtoString()
-
-
-
Field Detail
-
UNDEFINED_TIME
public static final int UNDEFINED_TIME
- See Also:
- Constant Field Values
-
MIN_TIME
public static final int MIN_TIME
- See Also:
- Constant Field Values
-
MAX_TIME
public static final int MAX_TIME
- See Also:
- Constant Field Values
-
MAX_EXTENDED_TIME
public static final int MAX_EXTENDED_TIME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TimeSpan
public TimeSpan()
Default constructor
-
TimeSpan
public TimeSpan(@NotNull @NotNull TimeSpan ts)Construct a new TimeSpan with the same contents- Parameters:
ts- the original TimeSpan
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
-
hashCode
public int hashCode()
-
getStart
public int getStart()
- Returns:
- the start time in minutes
-
getStartEvent
public VariableTime getStartEvent()
- Returns:
- the startEvent
-
getEnd
public int getEnd()
- Returns:
- the end time in minutes
-
getEndEvent
public VariableTime getEndEvent()
- Returns:
- the endEvent
-
isOpenEnded
public boolean isOpenEnded()
- Returns:
- the openEnded
-
getInterval
public int getInterval()
- Returns:
- the interval
-
setStart
public void setStart(int s)
Set the start of range value- Parameters:
s- the start value to set
-
setStartEvent
public void setStartEvent(VariableTime startEvent)
- Parameters:
startEvent- the startEvent to set
-
setEnd
public void setEnd(int e)
Set the end of range value- Parameters:
e- the end value to set
-
setEndEvent
public void setEndEvent(VariableTime endEvent)
- Parameters:
endEvent- the endEvent to set
-
setOpenEnded
public void setOpenEnded(boolean openEnded)
- Parameters:
openEnded- the openEnded to set
-
setInterval
public void setInterval(int interval)
- Parameters:
interval- the interval to set
-
copy
public TimeSpan copy()
Description copied from interface:CopyCreate a copy of the objecz- Returns:
- a copy of the object
-
toDebugString
public java.lang.String toDebugString()
Create a string that identifies which class created it for debugging and testing- Returns:
- the output of toString with the class name prepended
-
-