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

java.lang.Object
  extended by fi.iki.hsivonen.xml.checker.table.Cell
All Implemented Interfaces:
Locator

final class Cell
extends Object
implements Locator

A table cell for table integrity checking.

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

Field Summary
private  int bottom
          The first row in the row group onto which this cell does not span.
private  int columnNumber
          Source column.
private  ErrorHandler errorHandler
          The error handler.
private  boolean header
          Whether this is a th cell.
private  String[] headers
          The value of the headers attribute split on white space.
private  int left
          The column in which this cell starts.
private  int lineNumber
          Source line.
private static int MAX_COLSPAN
          Magic number from Gecko.
private static int MAX_ROWSPAN
          Magic number from Gecko.
private  String publicId
          Source public id.
private  int right
          The first column into which this cell does not span.
private  String systemId
          Source system id.
 
Constructor Summary
Cell(int colspan, int rowspan, String[] headers, boolean header, Locator locator, ErrorHandler errorHandler)
           
 
Method Summary
 String elementName()
           
 void err(String message)
           
 void errIfNotRowspanZero(String rowGroupType)
           
 void errOnHorizontalOverlap(Cell laterCell)
          Emit errors if this cell and the argument overlap horizontally.
 int freeSlot(int potentialSlot)
           
 int getBottom()
          Returns the bottom.
 int getColumnNumber()
          Returns the columnNumber.
 String[] getHeadings()
          Returns the headers.
(package private)  int getLeft()
          Returns the left.
 int getLineNumber()
          Returns the lineNumber.
 String getPublicId()
          Returns the publicId.
(package private)  int getRight()
          Returns the right.
 String getSystemId()
          Returns the systemId.
 boolean isHeader()
          Returns the header.
 void setPosition(int top, int left)
           
 boolean shouldBeCulled(int row)
           
 void warn(String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_COLSPAN

private static final int MAX_COLSPAN
Magic number from Gecko.

See Also:
Constant Field Values

MAX_ROWSPAN

private static final int MAX_ROWSPAN
Magic number from Gecko.

See Also:
Constant Field Values

left

private int left
The column in which this cell starts. (Zero before positioning.)


bottom

private int bottom
The first row in the row group onto which this cell does not span. (rowspan before positioning)

However, Integen.MAX_VALUE is a magic value that means rowspan=0.


right

private int right
The first column into which this cell does not span. (colspan before positioning.)


headers

private final String[] headers
The value of the headers attribute split on white space.


header

private final boolean header
Whether this is a th cell.


columnNumber

private final int columnNumber
Source column.


lineNumber

private final int lineNumber
Source line.


publicId

private final String publicId
Source public id.


systemId

private final String systemId
Source system id.


errorHandler

private final ErrorHandler errorHandler
The error handler.

Constructor Detail

Cell

Cell(int colspan,
     int rowspan,
     String[] headers,
     boolean header,
     Locator locator,
     ErrorHandler errorHandler)
throws SAXException
Throws:
SAXException
Method Detail

getHeadings

public String[] getHeadings()
Returns the headers.

Returns:
the headers

isHeader

public boolean isHeader()
Returns the header.

Returns:
the header

warn

public void warn(String message)
          throws SAXException
Throws:
SAXException

err

public void err(String message)
         throws SAXException
Throws:
SAXException

errOnHorizontalOverlap

public void errOnHorizontalOverlap(Cell laterCell)
                            throws SAXException
Emit errors if this cell and the argument overlap horizontally.

Parameters:
laterCell - another cell
Throws:
SAXException - if the ErrorHandler throws

setPosition

public void setPosition(int top,
                        int left)
                 throws SAXException
Throws:
SAXException

shouldBeCulled

public boolean shouldBeCulled(int row)

freeSlot

public int freeSlot(int potentialSlot)

getBottom

public int getBottom()
Returns the bottom.

Returns:
the bottom

getLeft

int getLeft()
Returns the left.

Returns:
the left

getRight

int getRight()
Returns the right.

Returns:
the right

errIfNotRowspanZero

public void errIfNotRowspanZero(String rowGroupType)
                         throws SAXException
Throws:
SAXException

getColumnNumber

public int getColumnNumber()
Returns the columnNumber.

Specified by:
getColumnNumber in interface Locator
Returns:
the columnNumber

getLineNumber

public int getLineNumber()
Returns the lineNumber.

Specified by:
getLineNumber in interface Locator
Returns:
the lineNumber

getPublicId

public String getPublicId()
Returns the publicId.

Specified by:
getPublicId in interface Locator
Returns:
the publicId

getSystemId

public String getSystemId()
Returns the systemId.

Specified by:
getSystemId in interface Locator
Returns:
the systemId

elementName

public String elementName()