com.cc.framework.ui.painter.def.scheduler
Class CalendarIterator

java.lang.Object
  extended bycom.cc.framework.ui.painter.def.scheduler.CalendarIterator

public class CalendarIterator
extends java.lang.Object

Iterator with a resolution of one day

Version:
$Revision: 1.8 $
Author:
Harald Schulz

Field Summary
private  java.util.Calendar i
          The current Iteration element
private  java.util.Calendar initialDate
          The initial date for this iterator
 
Constructor Summary
CalendarIterator(java.util.Calendar calendar)
          Constructor
 
Method Summary
 java.util.Calendar current()
           
 int getDayOfMonth()
          Gets the value for the DAY_OF_MONTH time field.
 int getDayOfWeek()
          Gets the value for the DAY_OF_WEEK time field.
 java.util.Calendar getInitial()
          Returns the initial Date for this iterator
 int getMonthDelta()
          This member calculates the month offset of the current iteration element from the initial Date.
 int getWeekOfYear()
          Gets the value for the WEEK_OF_YEAR time field.
 void next()
          Positions the iterator on the next day
 void restart()
          Restarts the iterator
 void restart(int firstDayOfWeek, int dayOfWeekMask)
          Restarts the iterator to the first day of week
private  boolean showDay(int dayOfWeekMask, int dayOfWeek)
          this method checks if a given day should be displayed.
 void skip(int days)
          Skips the iterator the given number of days
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

initialDate

private java.util.Calendar initialDate
The initial date for this iterator


i

private java.util.Calendar i
The current Iteration element

Constructor Detail

CalendarIterator

public CalendarIterator(java.util.Calendar calendar)
Constructor

Parameters:
calendar - The initial date
Method Detail

getInitial

public java.util.Calendar getInitial()
Returns the initial Date for this iterator

Returns:
Initial Date

restart

public void restart()
Restarts the iterator


showDay

private boolean showDay(int dayOfWeekMask,
                        int dayOfWeek)
this method checks if a given day should be displayed. This depends on the WeekEndDay settings of the design model.

Parameters:
dayOfWeekMask - A mask containing all the visible days. The iterator will skip any hidden day
dayOfWeek - the day
Returns:
true if the day should be shown

restart

public void restart(int firstDayOfWeek,
                    int dayOfWeekMask)
Restarts the iterator to the first day of week

Parameters:
firstDayOfWeek - The first day of the week
dayOfWeekMask - A mask containing all the visible days. The iterator will skip any hidden day

skip

public void skip(int days)
Skips the iterator the given number of days

Parameters:
days - The number of days to skip

next

public void next()
Positions the iterator on the next day


current

public java.util.Calendar current()
Returns:
Current day

getWeekOfYear

public int getWeekOfYear()
Gets the value for the WEEK_OF_YEAR time field.

Returns:
the value for the WEEK_OF_YEAR time field.

getDayOfWeek

public int getDayOfWeek()
Gets the value for the DAY_OF_WEEK time field.

Returns:
the value for the DAY_OF_WEEK time field.

getDayOfMonth

public int getDayOfMonth()
Gets the value for the DAY_OF_MONTH time field.

Returns:
the value for the DAY_OF_MONTH time field.

getMonthDelta

public int getMonthDelta()
This member calculates the month offset of the current iteration element from the initial Date.

Returns:
Month offset

toString

public java.lang.String toString()
See Also:
Object.toString()


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.