eu.beesoft.gantt.chart
Class TimeSpan

java.lang.Object
  extended by eu.beesoft.gantt.chart.TimeSpan

public final class TimeSpan
extends java.lang.Object

Envelopes date range (start time - end time).


Constructor Summary
TimeSpan()
          Creates empty instance of TimeSpan.
 
Method Summary
 boolean containsDate(java.util.Date date)
          Returns true if this TimeSpan contains specified date.
 boolean containsDate(long millis)
          Returns true if this TimeSpan contains specified time in millis.
 java.util.Date getDate()
          Returns the start time as instance of Date.
 long getEndTime()
          Returns the end time in millis.
 int getPosition()
          Returns x-coordinate of this instance in the chart component.
 long getStartTime()
          Returns the start time in millis.
 int getWidth()
          Returns screen width (in pixels) of this instance in chart component.
 boolean isHoliday()
          Returns value of the holiday property.
 boolean isWeekend()
          Returns value of the weekend property.
 void setEndTime(long endTime)
          Sets the end time.
 void setHoliday(boolean holiday)
          Sets value to holiday property.
 void setPosition(int position)
          Sets the x-coordinate of this instance in the chart component.
 void setStartTime(long startTime)
          Sets the start time.
 void setWeekend(boolean weekend)
          Sets value to the weekend property.
 void setWidth(int width)
          Sets screen width (in pixels) of this instance in chart component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeSpan

public TimeSpan()
Creates empty instance of TimeSpan.

Method Detail

getStartTime

public long getStartTime()
Returns the start time in millis.

Returns:
start time in millis

setStartTime

public void setStartTime(long startTime)
Sets the start time.

Parameters:
startTime - - start time in millis

getEndTime

public long getEndTime()
Returns the end time in millis.

Returns:
end time in millis

setEndTime

public void setEndTime(long endTime)
Sets the end time.

Parameters:
endTime - - end time in millis

getDate

public java.util.Date getDate()
Returns the start time as instance of Date.

Returns:
start time as Date

isHoliday

public boolean isHoliday()
Returns value of the holiday property.

Returns:
value of the holiday property

setHoliday

public void setHoliday(boolean holiday)
Sets value to holiday property. This method is called by ChartComponent and it uses this instance as information cache for painting.

Parameters:
holiday - - a new value for holiday property

isWeekend

public boolean isWeekend()
Returns value of the weekend property.

Returns:
value of the weekend property

setWeekend

public void setWeekend(boolean weekend)
Sets value to the weekend property. This method is called by ChartComponent and it uses this instance as information cache for painting.

Parameters:
weekend - - a new value for the weekend property

getPosition

public int getPosition()
Returns x-coordinate of this instance in the chart component.

Returns:
x-coordinate of this instance

setPosition

public void setPosition(int position)
Sets the x-coordinate of this instance in the chart component.

Parameters:
position - - a new x-coordinate of this instance

getWidth

public int getWidth()
Returns screen width (in pixels) of this instance in chart component.

Returns:
screen width of this instance

setWidth

public void setWidth(int width)
Sets screen width (in pixels) of this instance in chart component.

Parameters:
width - - a new screen width of this instance

containsDate

public boolean containsDate(java.util.Date date)
Returns true if this TimeSpan contains specified date.

Parameters:
date - - date whose presence in this TimeSpan is to be tested
Returns:
true if this TimeSpan contains specified date

containsDate

public boolean containsDate(long millis)
Returns true if this TimeSpan contains specified time in millis.

Parameters:
millis - - time whose presence in this TimeSpan is to be tested
Returns:
true if this TimeSpan contains specified time