COM.FutureTense.Interfaces
Interface IList


public interface IList

This class describes the methods available from java class when accessing an IPS query or list object. It also defines the methods that must be implemented by a 3rd parting attempting to construct and register a list object for using within an IPS xml page.


Field Summary
static int first
           
static int gotorow
           
static int last
           
static int next
          ************************************************************ Navigator method that must be implemented by developers creating their own CS compatable IList objects; these methods are used internally by CS for navigation and data interogation *************************************************************
static int prev
           
 
Method Summary
 boolean atEnd()
          Return whether this list is at the last row (at the end) of the rows of data.
 IList clone(java.lang.String newname)
          Normally used internally by CS server to shallow copy a list object; return null from a user defined list object if support isn't implemented or desired.
 int currentRow()
          Returns the number of the current row of this list.
 void flush()
          Flushes a list object, destroying any backing data store.
 java.lang.String getColumnName(int i)
          Retrieves the name of the column at an offset, counting from 0 (zero).
 byte[] getFileData(java.lang.String columname)
          Returns the data contained in a referenced data file.
 java.lang.String getFileString(java.lang.String columname)
          Returns the string data contained in a referenced data file.
 java.lang.String getIndirectColumnName(int index)
          Supply the upload column by index; this is normally only used by internal IPS generates list objects for url columns ie upload datasource columns.
 java.lang.String getName()
          Retrieves the corresponding XML name of this list.
 java.lang.Object getObject(java.lang.String colname)
          Get an object from a column; similar to above but can return list-specific data.
 java.lang.String getValue(java.lang.String columname)
          Retrieves the value of a named column for the current row.
 boolean hasData()
          Checks if the list contains any data.
 boolean moveTo(int i)
          Moves the list to a given row number.
 boolean moveToRow(int how, int v)
          Move to a new row given a specific command
 int numColumns()
          Retrieves the number of columns in the list.
 int numIndirectColumns()
          Return a count of columns which are meant to be indirect data pointers; normally only used by internal CS ilist objects so the default implementation for a user-defined ilist should return 0
 int numRows()
          Returns the number of rows in a list.
 void rename(java.lang.String newname)
          Allow the renaming of a list - used internally by CS; unless renaming is UNDESIRED use an implementation similar to :

public void rename(String newname) {mName=newname;}

 boolean stringInList(java.lang.String item)
          Internal CS function; 1 column lists may choose to implement whether a given value is in any row.
 

Field Detail

next

public static final int next
************************************************************ Navigator method that must be implemented by developers creating their own CS compatable IList objects; these methods are used internally by CS for navigation and data interogation *************************************************************

See Also:
Constant Field Values

prev

public static final int prev
See Also:
Constant Field Values

first

public static final int first
See Also:
Constant Field Values

last

public static final int last
See Also:
Constant Field Values

gotorow

public static final int gotorow
See Also:
Constant Field Values
Method Detail

getName

public java.lang.String getName()
Retrieves the corresponding XML name of this list.

Returns:
Returns the XML name.

hasData

public boolean hasData()
Checks if the list contains any data.

Returns:
Returns true if the list contains data, false if it is empty.

numColumns

public int numColumns()
Retrieves the number of columns in the list.

Returns:
Returns the number of columns.

currentRow

public int currentRow()
Returns the number of the current row of this list. Rows begin numbering from one.

Returns:
Returns the current row number or -1 if there is no current row. This can be caused by an internal error or empty list.

getValue

public java.lang.String getValue(java.lang.String columname)
                          throws java.lang.NoSuchFieldException
Retrieves the value of a named column for the current row.

Parameters:
columname - The name of the column to get the results for.
Returns:
Returns the value of the column. May be null or empty, depending on the data type.
Throws:
java.lang.NoSuchFieldException

getObject

public java.lang.Object getObject(java.lang.String colname)
                           throws java.lang.NoSuchFieldException
Get an object from a column; similar to above but can return list-specific data. For example, if the list represents a database query, the object returned will be null unless the column represents a byte array. Other lists may return particular types

Throws:
java.lang.NoSuchFieldException

getFileData

public byte[] getFileData(java.lang.String columname)
                   throws java.lang.IllegalArgumentException,
                          java.lang.NoSuchFieldException
Returns the data contained in a referenced data file. Note that this kind of data retrieval will not be cached; each request will reread the bytes.

Parameters:
columname - The name of the column.
Returns:
Returns the bytes[] value, which can be "null". An exception is thrown if the column is not an indirect data type or if other errors occur.
Throws:
java.lang.IllegalArgumentException
java.lang.NoSuchFieldException

getFileString

public java.lang.String getFileString(java.lang.String columname)
                               throws java.lang.NoSuchFieldException
Returns the string data contained in a referenced data file.

Parameters:
columname - The name of the column.
Returns:
Returns the string value, which can be "null". An exception is thrown if the column is not an indirect data type or if other errors occur.
Throws:
java.lang.NoSuchFieldException

flush

public void flush()
Flushes a list object, destroying any backing data store.


getColumnName

public java.lang.String getColumnName(int i)
                               throws java.lang.ArrayIndexOutOfBoundsException
Retrieves the name of the column at an offset, counting from 0 (zero).

Parameters:
i - The offset column number.
Returns:
Returns the column name.
Throws:
java.lang.ArrayIndexOutOfBoundsException

numRows

public int numRows()
Returns the number of rows in a list. USE WITH CARE. If the list represents uncached data in a database, a large delay and high memory useage might be encountered as the list must be scanned ON THE DATABASE SIDE to determine the count.

Returns:
Returns the number of rows in the list.

moveTo

public boolean moveTo(int i)
Moves the list to a given row number.

Parameters:
i - The row number, numbered from one.
Returns:
Returns true on success, false on failure. GetErrno() will return an error code on failure if if the IList is an IPS query object, optional otherwise.

atEnd

public boolean atEnd()
Return whether this list is at the last row (at the end) of the rows of data.

Returns:
boolean true if already navigated to first or last row

moveToRow

public boolean moveToRow(int how,
                         int v)
Move to a new row given a specific command

Parameters:
how - command
v - value of the new row if how is gotorow
Returns:
boolean if navigation succeeded GetErrno() will return an error code on failure if if the IList is an IPS query object, optional otherwise.

numIndirectColumns

public int numIndirectColumns()
Return a count of columns which are meant to be indirect data pointers; normally only used by internal CS ilist objects so the default implementation for a user-defined ilist should return 0


getIndirectColumnName

public java.lang.String getIndirectColumnName(int index)
Supply the upload column by index; this is normally only used by internal IPS generates list objects for url columns ie upload datasource columns. Normally a user defined ilist should return null;


clone

public IList clone(java.lang.String newname)
Normally used internally by CS server to shallow copy a list object; return null from a user defined list object if support isn't implemented or desired.

A user-defined implementation may decide to provide a deep copy.


rename

public void rename(java.lang.String newname)
Allow the renaming of a list - used internally by CS; unless renaming is UNDESIRED use an implementation similar to :

public void rename(String newname) {mName=newname;}


stringInList

public boolean stringInList(java.lang.String item)
Internal CS function; 1 column lists may choose to implement whether a given value is in any row. Only works on StringList and FileList IPS (not DB queries) objects or enhanced 3rd party IList objects.