Package org.goplanit.time
Class TimePeriodImpl
- java.lang.Object
 - 
- org.goplanit.utils.id.IdAbleImpl
 - 
- org.goplanit.utils.id.ExternalIdAbleImpl
 - 
- org.goplanit.time.TimePeriodImpl
 
 
 
 
- 
- All Implemented Interfaces:
 Cloneable,Comparable<IdAble>,ExternalIdAble,IdAble,TimePeriod
public class TimePeriodImpl extends ExternalIdAbleImpl implements TimePeriod
Represents a time period within the day. Used to determine the duration and start time of trips for example. We internally adopt seconds as the unit- Author:
 - markr
 
 
- 
- 
Constructor Summary
Constructors Constructor Description TimePeriodImpl(TimePeriodImpl timePeriodImpl)Copy constructorTimePeriodImpl(IdGroupingToken groupId, long startTimeSeconds, long durationSeconds)ConstructorTimePeriodImpl(IdGroupingToken groupId, String description, long startTimeSeconds, long durationSeconds)Constructor 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TimePeriodImplclone()Create a shallow copy of this entityStringgetDescription()Return the descriptionlonggetDurationSeconds()Return the duration in secondslonggetStartTimeSeconds()Return the start timeStringtoString()Output this object as a String- 
Methods inherited from class org.goplanit.utils.id.ExternalIdAbleImpl
getExternalId, getXmlId, setExternalId, setXmlId 
- 
Methods inherited from class org.goplanit.utils.id.IdAbleImpl
equals, generateAndSetId, generateId, getId, hashCode, setId 
- 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait 
- 
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
getExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId 
- 
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, getId, idEquals, idHashCode 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
TimePeriodImpl
public TimePeriodImpl(IdGroupingToken groupId, long startTimeSeconds, long durationSeconds) throws PlanItException
Constructor- Parameters:
 groupId- contiguous id generation within this group for instances of this classstartTimeSeconds- start time in seconds from midnightdurationSeconds- duration in seconds- Throws:
 PlanItException- thrown if error
 
- 
TimePeriodImpl
public TimePeriodImpl(IdGroupingToken groupId, String description, long startTimeSeconds, long durationSeconds) throws PlanItException
Constructor- Parameters:
 groupId- contiguous id generation within this group for instances of this classdescription- description of this time periodstartTimeSeconds- start time of this time perioddurationSeconds- duration of this time period- Throws:
 PlanItException- thrown if error
 
- 
TimePeriodImpl
public TimePeriodImpl(TimePeriodImpl timePeriodImpl)
Copy constructor- Parameters:
 timePeriodImpl- to copy
 
 - 
 
- 
Method Detail
- 
getStartTimeSeconds
public long getStartTimeSeconds()
Return the start time- Specified by:
 getStartTimeSecondsin interfaceTimePeriod- Returns:
 - start time
 
 
- 
getDurationSeconds
public long getDurationSeconds()
Return the duration in seconds- Specified by:
 getDurationSecondsin interfaceTimePeriod- Returns:
 - duration
 
 
- 
getDescription
public String getDescription()
Return the description- Specified by:
 getDescriptionin interfaceTimePeriod- Returns:
 - description of this TimePeriod
 
 
- 
clone
public TimePeriodImpl clone()
Create a shallow copy of this entity- Specified by:
 clonein interfaceIdAble- Overrides:
 clonein classExternalIdAbleImpl- Returns:
 - shallow copy of entity
 
 
 - 
 
 -