org.dvb.tvanytime.metadata
Class Table

java.lang.Object
  extended by org.dvb.tvanytime.metadata.Table

public class Table
extends java.lang.Object

Class which allows a specific table type to be requested in the QueryConstraints class. An optional set of sort criteria can also be specified which allow particular fields in the table to be sorted in either ascending or descending order.

Version:
1.0
Author:
Chris Newell
See Also:
QueryConstraints

Constructor Summary
Table(java.lang.String table)
          Construct a Table object.
 
Method Summary
 void addSortCriteria(java.lang.String fieldID, boolean isAscendingOrder)
          Add a sort criteria for a particular fieldID.
 java.lang.String getName()
          Get the name of this table.
 java.lang.String[] getSortCriteriaFieldIDs()
          Get an array listing the fieldIDs of the sort criteria.
 boolean[] getSortCriteriaOrderings()
          Get an array listing the orderings of the sort criteria.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Table

public Table(java.lang.String table)
Construct a Table object.

Parameters:
table - the name of this table (e.g. "ProgramInformationTable").
Method Detail

addSortCriteria

public void addSortCriteria(java.lang.String fieldID,
                            boolean isAscendingOrder)
Add a sort criteria for a particular fieldID. Several sort criteria can be requested by making a call for each fieldID. However, the degree of sorting that can be achieved will be restricted by the capabilities of the implementation or the remote server.

If more than one sort criteria is specified then they will be applied to the table in the order in which they were added. If the same fieldID is specified more than once then the previous value of isAscendingOrder will be overwritten but the order in which the sort criteria will be applied is unaffected.

Parameters:
fieldID - the fieldID of the field which is to be sorted.
isAscendingOrder - true if the sort is to applied in ascending order, false if descending order is to be applied.

getName

public java.lang.String getName()
Get the name of this table. (e.g. "ProgramInformationTable")

Returns:
the table name

getSortCriteriaFieldIDs

public java.lang.String[] getSortCriteriaFieldIDs()
Get an array listing the fieldIDs of the sort criteria. The order in which the fieldIDs are listed will correspond to order in which the sort criteria were requested.

Returns:
an array of FieldID strings

getSortCriteriaOrderings

public boolean[] getSortCriteriaOrderings()
Get an array listing the orderings of the sort criteria. The order in which the orderings are listed will correspond to order in which the sort criteria were requested.

Returns:
an array of boolean isAscendingOrder fields.