fi.iki.hsivonen.xml.checker.table
Class ColumnRange

java.lang.Object
  extended by fi.iki.hsivonen.xml.checker.table.ColumnRange

final class ColumnRange
extends Object

Represents a contiguous range of columns that was established by a single element and that does not yet have cells in it.

Version:
$Id: ColumnRange.java,v 1.4 2006/12/01 12:34:30 hsivonen Exp $
Author:
hsivonen

Field Summary
private  String element
          The local name of the element that established this column range.
private  int left
          The leftmost column that is part of this range.
private  Locator locator
          The locator associated with the element that established this column range.
private  ColumnRange next
          The next range in the linked list of ranges.
private  int right
          The first column to the right that is not part of this range.
 
Constructor Summary
ColumnRange(String element, Locator locator, int left, int right)
          Constructor
 
Method Summary
(package private)  String getElement()
          Returns the element.
(package private)  Locator getLocator()
          Returns the locator.
(package private)  ColumnRange getNext()
          Returns the next.
(package private)  int hits(int column)
          Hit testing.
(package private)  boolean isSingleCol()
           
(package private)  ColumnRange removeColumn(int column)
          Removes a column from the range possibly asking it to be destroyed or splitting it.
(package private)  void setNext(ColumnRange next)
          Sets the next.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

locator

private final Locator locator
The locator associated with the element that established this column range.


element

private final String element
The local name of the element that established this column range.


left

private int left
The leftmost column that is part of this range.


right

private int right
The first column to the right that is not part of this range.


next

private ColumnRange next
The next range in the linked list of ranges.

Constructor Detail

ColumnRange

public ColumnRange(String element,
                   Locator locator,
                   int left,
                   int right)
Constructor

Parameters:
element - the local name of the establishing element
locator - a locator associated with the establishing element; must be suitable for retaining out-of-SAX-event!
left - the leftmost column that is part of this range
right - the first column to the right that is not part of this range
Method Detail

getElement

String getElement()
Returns the element.

Returns:
the element

getLocator

Locator getLocator()
Returns the locator.

Returns:
the locator

hits

int hits(int column)
Hit testing.

Parameters:
column - column index
Returns:
-1 if the column is to the left of this range, 0 if the column is in this range and 1 if the column is to the right of this range

removeColumn

ColumnRange removeColumn(int column)
Removes a column from the range possibly asking it to be destroyed or splitting it.

Parameters:
column - a column index
Returns:
null if this range gets destroyed, this if the range gets resized and the new right half range if the range gets split

getNext

ColumnRange getNext()
Returns the next.

Returns:
the next

setNext

void setNext(ColumnRange next)
Sets the next.

Parameters:
next - the next to set

isSingleCol

boolean isSingleCol()

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()