uk.ac.starlink.votable
Class TableElement

java.lang.Object
  |
  +--uk.ac.starlink.votable.VOElement
        |
        +--uk.ac.starlink.votable.TableElement

public class TableElement
extends VOElement

An object representing the TABLE element of a VOTable. This contains fields, links and rows; the actual data from the table body may be obtained using the getData() method. Note that depending on exactly how this element was obtained, the nodes bearing the bulk data (e.g. text content of a <STREAM> element or the <TR> children of a <TABLEDATA> element) may not actually be available from this node - for efficiency the VOTable parser may convert them into a TabularData object and discard the content of the original (STREAM or TABLEDATA) nodes which contained the data from the DOM.


Constructor Summary
TableElement(Element el, String systemId)
          Constructs a TableElement object from a TABLE element.
 
Method Summary
 int getColumnCount()
          Returns the number of columns in this table.
 TabularData getData()
          Returns an object which can be used to access the actual cell data in the body of this table.
 FieldElement getField(int index)
          Returns one of the FieldElement objects associated with this table.
 long getRowCount()
          Returns the number of rows in this table.
 
Methods inherited from class uk.ac.starlink.votable.VOElement
equals, getAttribute, getAttribute, getChildByName, getChildren, getChildrenByName, getContext, getDescendantsByName, getDescription, getElement, getHandle, getID, getName, getParent, getSource, getSystemId, getTagName, getTextContent, hasAttribute, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TableElement

public TableElement(Element el,
                    String systemId)
Constructs a TableElement object from a TABLE element.

Parameters:
el - TABLE element
systemId - document system ID
Method Detail

getColumnCount

public int getColumnCount()
Returns the number of columns in this table.

Returns:
the number of columns

getRowCount

public long getRowCount()
Returns the number of rows in this table. If this cannot be determined, or cannot be determined efficiently, the value -1 may be returned.

Returns:
the number of rows, or -1 if unknown

getData

public TabularData getData()
Returns an object which can be used to access the actual cell data in the body of this table.

Returns:
bulk data access object

getField

public FieldElement getField(int index)
Returns one of the FieldElement objects associated with this table.

Parameters:
index - the index of the field to return
Returns:
the filed at index index
Throws:
IndexOutOfBoundsException - unless 0<=index<numColumns

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.