com.miginfocom.calendar.header
Class DateCellRange

java.lang.Object
  extended by com.miginfocom.calendar.header.DateCellRange

public class DateCellRange
extends java.lang.Object

A single row (one dimension) cell range with a cennected date range. Can be either vertical or horizontal.


Constructor Summary
DateCellRange(int start, int end, int rowCol, ImmutableDateRange dateRange)
          Constructor
 
Method Summary
 DateCellRange cloneRange()
          Clones the range.
 boolean equals(java.lang.Object o)
           
 int getEnd(boolean includeTemp)
          Returns the end.
 DateCellRange getFullDateRange()
          Returns the range including the current tempRange unioned to one cell range.
 int getLength(boolean includeTemp)
          Returns how many cells the range spans.
 int getRowCol()
          Returns the row/column that will remain the same all the time.
 int getStart(boolean includeTemp)
          Returns the start.
 ImmutableDateRange getUnionDateRange()
          Returns the union of the date sent in visa the constructor and the date range of the unioned cell range's date range.
 boolean overlaps(DateCellRange cellRange, boolean includeTemp)
          Returns of the cell ranges overlap.
 boolean setTempUnion(DateCellRange newTemp)
          Sets a temporary union without discarding the start range.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateCellRange

public DateCellRange(int start,
                     int end,
                     int rowCol,
                     ImmutableDateRange dateRange)
Constructor

Parameters:
start - AtStart column/row
end - AtEnd column/row
rowCol - The row/column that will remain the same all the time.
dateRange - The date range that is assiciated with the cell range. Values will be copied. Not null.
Method Detail

getUnionDateRange

public ImmutableDateRange getUnionDateRange()
Returns the union of the date sent in visa the constructor and the date range of the unioned cell range's date range.

Returns:
The union of the date sent in visa the constructor and the date range of the unioned cell range's date range. Never null.

setTempUnion

public boolean setTempUnion(DateCellRange newTemp)
Sets a temporary union without discarding the start range.

Parameters:
newTemp - The range to make a temporary union with. This range must not itself have a temp union set.
Returns:
true if the cell range got changed.

getFullDateRange

public DateCellRange getFullDateRange()
Returns the range including the current tempRange unioned to one cell range.

Returns:
The range including the current tempRange unioned to one cell range.

overlaps

public boolean overlaps(DateCellRange cellRange,
                        boolean includeTemp)
Returns of the cell ranges overlap. Only comapres cells, now the dates range contained.

Parameters:
cellRange - The cell range to check against. Not null.
includeTemp - If this' temporary range shoule be included. Never included in cellRange though.
Returns:
If they overlap.

getLength

public int getLength(boolean includeTemp)
Returns how many cells the range spans.

Parameters:
includeTemp - If the temporary range should be included
Returns:
How many cells the range spans

getStart

public int getStart(boolean includeTemp)
Returns the start.

Parameters:
includeTemp - If the temporary range should be included
Returns:
The start.

getEnd

public int getEnd(boolean includeTemp)
Returns the end.

Parameters:
includeTemp - If the temporary range should be included
Returns:
The end.

getRowCol

public int getRowCol()
Returns the row/column that will remain the same all the time.

Returns:
The row/column that will remain the same all the time.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

cloneRange

public DateCellRange cloneRange()
Clones the range. Note! userObject's reference is copied, the object itself is NOT cloned!.

Returns:
A clone

toString

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


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.