edu.wpi.cs.dsrg.xmldb.xat.common.xatnode
Interface ColumnAccessor

All Known Subinterfaces:
XATTable

public interface ColumnAccessor

This class is the column structure of the XAT. It's a table of XML fragments.

Since:
1.0

Method Summary
 int appendColumn(java.lang.String sColumnName)
          Append an empty column to the end of the table.
 int appendColumn(java.lang.String sColumnName, java.util.Vector new_column)
          Append a new column to the end of the table.
 java.util.Vector deleteColumn(int position)
          Delete a column in the specific position.
 java.util.Vector getColList()
          Get the vector containing the columns themselves.
 java.util.Vector getColNames()
          Get the vector containing the column names.
 java.util.Vector getColumn(int position)
          Get a column back by position.
 java.lang.String getColumnName(int position)
          Get the column name for a specific column position.
 int getColumnPosition(java.lang.String column_name)
          Get the Column Position from the Column Name.
 int getNumberOfColumns()
          Get total number of columns in this table.
 int insertColumn(int position, java.lang.String sColumnName, java.util.Vector new_column)
          Insert a new column to the table before specific position.
 java.util.Vector mergeColumnNames(XATTable tab2)
          This method takes two XATTables (this and tab2).
 void moveColumn(int from_position, int to_position)
          Move a column to a specific position.
 java.util.Vector updateColumn(int position, java.util.Vector new_column)
          Update the column in given position as new column.
 

Method Detail

appendColumn

public int appendColumn(java.lang.String sColumnName)
                 throws XATTableTupleNoMatchException
Append an empty column to the end of the table.
Parameters:
new_column - The new column append will be appended.
Returns:
int The position the new appended column.
Since:
1.0

appendColumn

public int appendColumn(java.lang.String sColumnName,
                        java.util.Vector new_column)
                 throws XATTableTupleNoMatchException
Append a new column to the end of the table.
Parameters:
new_column - The new columns.
Returns:
int The position the new appended column.
Since:
1.0

deleteColumn

public java.util.Vector deleteColumn(int position)
                              throws XATTableOutOfRangeException,
                                     XATTableEmptyException
Delete a column in the specific position.
Parameters:
position - The position of the column will be deleted.
Returns:
Vector The deleted column.
Since:
1.0

getColList

public java.util.Vector getColList()
Get the vector containing the columns themselves.
Returns:
Vector The vector containing the contents.
Since:
1.0

getColNames

public java.util.Vector getColNames()
Get the vector containing the column names.
Returns:
Vector The vector containing the names.
Since:
1.0

getColumn

public java.util.Vector getColumn(int position)
                           throws XATTableOutOfRangeException
Get a column back by position.
Parameters:
position - The position of the column which starts from 1.
Returns:
Vector The vector of cells in one column.
Since:
1.0

getColumnName

public java.lang.String getColumnName(int position)
                               throws XATTableOutOfRangeException
Get the column name for a specific column position.
Parameters:
position - The column position searching for.
Returns:
Vector The column names for a give position.
Since:
1.0

getColumnPosition

public int getColumnPosition(java.lang.String column_name)
                      throws XATTableColumnNoExistException
Get the Column Position from the Column Name.
Parameters:
column_name - The column name.
Returns:
int The position of the column.
Since:
1.0

getNumberOfColumns

public int getNumberOfColumns()
Get total number of columns in this table.
Returns:
int The number of columns in the table.
Since:
1.0

insertColumn

public int insertColumn(int position,
                        java.lang.String sColumnName,
                        java.util.Vector new_column)
                 throws XATTableOutOfRangeException,
                        XATTableTupleNoMatchException
Insert a new column to the table before specific position.
Parameters:
position - The column position.
sColumnName - The new column name.
new_column - The new column content.
Returns:
int The number of Columns after the insertion.
Since:
1.0

mergeColumnNames

public java.util.Vector mergeColumnNames(XATTable tab2)
This method takes two XATTables (this and tab2). Finds all matching columns, adds those to the head of a vector, and appends all other column names at the end. Appends tab1 column names, then tab2
Parameters:
tab2 - The XATTable merged to.
Returns:
The result Vector containning all the column names of both this and given tables.
Since:
1.0

moveColumn

public void moveColumn(int from_position,
                       int to_position)
                throws XATTableOutOfRangeException,
                       XATTableEmptyException
Move a column to a specific position.
Parameters:
from_position - The position of the column which is going to moved.
to_position - The position of the column will be moved to.
Returns:
void
Since:
1.0

updateColumn

public java.util.Vector updateColumn(int position,
                                     java.util.Vector new_column)
                              throws XATTableOutOfRangeException,
                                     XATTableEmptyException,
                                     XATTableTupleNoMatchException
Update the column in given position as new column.
Parameters:
position - The position of the column will be updated.
new_column - The new column.
Returns:
Vector The original column.
Since:
1.0