com.gmscheduler.model
Class Timeframe

java.lang.Object
  extended by com.gmscheduler.model.Timeframe

public class Timeframe
extends java.lang.Object

A Timeframe object represents a day and time range (start time and stop time). The time frame is used to represent a chunk of time.

Version:
1.1
Author:
Peter Deschere, Rebecca Beale, Jason Fillo

Constructor Summary
Timeframe()
           
Timeframe(java.lang.String day, java.lang.Double start, java.lang.Double end)
           
Timeframe(java.lang.String day, java.lang.String start, java.lang.String end)
           
Timeframe(Timeframe u)
           
 
Method Summary
 java.lang.String getDay()
          Returns the day.
 java.lang.String getEnd()
          Returns the end.
 java.lang.Double getEndDouble()
          Returns the end.
 java.lang.Long getId()
          Returns the id.
 java.lang.Long getScheduleid()
          Returns the schedule id.
 java.lang.String getStart()
          Returns the start time.
 java.lang.Double getStartDouble()
          Returns the start.
 boolean isEmpty()
           
 void setDay(java.lang.String day)
          Sets the Day.
 void setEnd(java.lang.String end)
          Sets the end time.
 void setScheduleid(java.lang.Long id)
          Sets the parent Schedule's id to the Timeframe.
 void setStart(java.lang.String start)
          Sets the start time.
 java.lang.String toString()
           
 java.lang.String toString(java.lang.Double time)
          Converts a military time string into decimal hours.
 java.lang.String toStringMilitary()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Timeframe

public Timeframe(java.lang.String day,
                 java.lang.String start,
                 java.lang.String end)

Timeframe

public Timeframe(java.lang.String day,
                 java.lang.Double start,
                 java.lang.Double end)

Timeframe

public Timeframe(Timeframe u)

Timeframe

public Timeframe()
Method Detail

getScheduleid

public java.lang.Long getScheduleid()
Returns the schedule id.

Returns:
the id of the parent Schedule

setScheduleid

public void setScheduleid(java.lang.Long id)
Sets the parent Schedule's id to the Timeframe. Required for Hibernate.

Parameters:
id - the parent Schedule's id

getId

public java.lang.Long getId()
Returns the id.

Returns:
the id of the Timeframe

getDay

public java.lang.String getDay()
Returns the day.

Returns:
the day of the Timeframe

getStart

public java.lang.String getStart()
Returns the start time.

Returns:
the start time of the Timeframe

getEnd

public java.lang.String getEnd()
Returns the end.

Returns:
the end of the Timeframe

setDay

public void setDay(java.lang.String day)
Sets the Day.

Parameters:
day - the new day

setStart

public void setStart(java.lang.String start)
Sets the start time.

Parameters:
start - the new start

setEnd

public void setEnd(java.lang.String end)
Sets the end time.

Parameters:
end - the new end

toStringMilitary

public java.lang.String toStringMilitary()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getStartDouble

public java.lang.Double getStartDouble()
Returns the start.

Returns:
the start of the Timeframe as a Double

getEndDouble

public java.lang.Double getEndDouble()
Returns the end.

Returns:
the end of the Timeframe as a Double

toString

public java.lang.String toString(java.lang.Double time)
Converts a military time string into decimal hours.

Parameters:
time - a Double representation of military time
Returns:
the time in string format (ex: 12.25 returns 12:15)

isEmpty

public boolean isEmpty()