JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.formulae
Class ExpressionList

java.lang.Object
  |
  +--com.klg.jclass.util.formulae.ExpressionList
All Implemented Interfaces:
Cloneable, Collection, Expression, List, Result
Direct Known Subclasses:
MathExpressionList, QueryExpressionList, TableExpressionList

public abstract class ExpressionList
extends Object
implements Result, List, Cloneable

An expression list is a list (or set) of expressions


Constructor Summary
ExpressionList()
           
 
Method Summary
 void add(int index, Object obj)
          Add the given element at the specified index in this List
 boolean add(Object obj)
          Append the given element to the end of this List
 boolean addAll(Collection coll)
          Append all the elements of the given collection to the end of this List
 boolean addAll(int index, Collection coll)
          Insert the elements of the given collection at the given position in this List
 void clear()
          Clear all elements from this List
 Object clone()
          Implement the clone method defined by the Expression interface
abstract  boolean contains(Object obj)
          Determine if the List contain the specified element
 boolean containsAll(Collection coll)
          Determine if all the elements of the given Collection are in the List
abstract  boolean equals(Object obj)
          Compare the given object and this List, given that equality implies the Lists contain the same entries in the same order.
 com.klg.jclass.util.formulae.Result evaluate()
          As a Result Expression, the value of this list is itself
abstract  Object get(int index)
          Retrieve the element at a given position in this List
abstract  int indexOf(Object obj)
          Find the position (first occurence) of a given object in the List.
 boolean isEmpty()
          Determine if the List contains no elements
abstract  Iterator iterator()
          Get an iterator over the elements in this List
abstract  int lastIndexOf(Object o)
          Find the position of the last occurence of a given object in the List.
 ListIterator listIterator()
          Get a ListIterator over the elements of the List
abstract  ListIterator listIterator(int index)
          Get a ListIterator over the elements of the List beginning at the the given position in the list
 Object remove(int index)
          Remove the element at the given position from the List
 boolean remove(Object o)
          Remove the given element from the List (if it exists)
 boolean removeAll(Collection coll)
          Remove all elements of the given collection from the List (if they exist)
 boolean retainAll(Collection c)
          Remove all elements in this List which are not in the given Collection.
 Object set(int index, Object obj)
          Set the element at a given position in this List
abstract  int size()
          Return the number of elements in this List
abstract  List subList(int startIndex, int endIndex)
          Get a List which is a subsequence of this List (the ordering is the same)
 Object[] toArray()
          Get an array view of all the elements in this List NOTE: The Iterator's ordering is used
abstract  Object[] toArray(Object[] inArray)
          Fill a given array with a view of all the elements in this List NOTE: The Iterator's ordering is used
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.List
hashCode
 

Constructor Detail

ExpressionList

public ExpressionList()
Method Detail

evaluate

public com.klg.jclass.util.formulae.Result evaluate()
As a Result Expression, the value of this list is itself

Specified by:
evaluate in interface Expression
Returns:
This ExpressionList

clone

public Object clone()
             throws CloneNotSupportedException
Implement the clone method defined by the Expression interface

Specified by:
clone in interface Expression
Overrides:
clone in class Object
CloneNotSupportedException

add

public void add(int index,
                Object obj)
Add the given element at the specified index in this List

Specified by:
add in interface List
Parameters:
index - The position to insert the given element
obj - The element to be added to this List
Throws:
UnsupportedOperationException - add is not supported by this List

add

public boolean add(Object obj)
Append the given element to the end of this List

Specified by:
add in interface List
Parameters:
obj - The element to be added to this List
Returns:
True if the addition of the element was possible
Throws:
UnsupportedOperationException - add is not supported by this List

addAll

public boolean addAll(Collection coll)
Append all the elements of the given collection to the end of this List

Specified by:
addAll in interface List
Parameters:
coll - The collection to be added to this List
Returns:
True if this operation changed the List
Throws:
UnsupportedOperationException - addAll is not supported by this List

addAll

public boolean addAll(int index,
                      Collection coll)
Insert the elements of the given collection at the given position in this List

Specified by:
addAll in interface List
Parameters:
coll - The collection to be added to this List
index - The index in this List at which to insert the elements
Returns:
True if this operation changed the List
Throws:
UnsupportedOperationException - addAll is not supported by this List

clear

public void clear()
Clear all elements from this List

Specified by:
clear in interface List
Throws:
UnsupportedOperationException - clear is not supported by this List

contains

public abstract boolean contains(Object obj)
Determine if the List contain the specified element

Specified by:
contains in interface List
Parameters:
obj - The element to be searched for in this List
Returns:
True if the List contains the given object

containsAll

public boolean containsAll(Collection coll)
Determine if all the elements of the given Collection are in the List

Specified by:
containsAll in interface List
Parameters:
coll - The collection whose elements are sought in this List
Returns:
True if every element of the Collection is in this List

equals

public abstract boolean equals(Object obj)
Compare the given object and this List, given that equality implies the Lists contain the same entries in the same order.

Specified by:
equals in interface List
Overrides:
equals in class Object
Parameters:
obj - the object whose equality with this List is tested
Returns:
True if the given object satisfies "equality" with this List

get

public abstract Object get(int index)
Retrieve the element at a given position in this List

Specified by:
get in interface List
Parameters:
index - The desired element's position
Returns:
The element found at the given position

indexOf

public abstract int indexOf(Object obj)
Find the position (first occurence) of a given object in the List. -1 is returned if the element is not found in the List.

Specified by:
indexOf in interface List
Parameters:
obj - The object to be found in the List
Returns:
The location of the object in the List (or -1)

isEmpty

public boolean isEmpty()
Determine if the List contains no elements

Specified by:
isEmpty in interface List
Returns:
True if this List contains no elements

iterator

public abstract Iterator iterator()
Get an iterator over the elements in this List

Specified by:
iterator in interface List
Returns:
an iterator object which enumerates the elements in this List

lastIndexOf

public abstract int lastIndexOf(Object o)
Find the position of the last occurence of a given object in the List. -1 is returned if the element is not found in the List.

Specified by:
lastIndexOf in interface List
Returns:
The last location the object is found in the List (or -1)

listIterator

public ListIterator listIterator()
Get a ListIterator over the elements of the List

Specified by:
listIterator in interface List
Returns:
A ListIterator over this List

listIterator

public abstract ListIterator listIterator(int index)
Get a ListIterator over the elements of the List beginning at the the given position in the list

Specified by:
listIterator in interface List
Parameters:
index - The position at which to initialise the ListIterator
Returns:
A ListIterator over this List

remove

public Object remove(int index)
Remove the element at the given position from the List

Specified by:
remove in interface List
Parameters:
index - The position of the element to be removed from this List
Returns:
The Object that has been removed from the List
Throws:
UnsupportedOperationException - remove is not supported by this List

remove

public boolean remove(Object o)
Remove the given element from the List (if it exists)

Specified by:
remove in interface List
Returns:
True if the given element was in the List
Throws:
UnsupportedOperationException - remove is not supported by this List

removeAll

public boolean removeAll(Collection coll)
Remove all elements of the given collection from the List (if they exist)

Specified by:
removeAll in interface List
Parameters:
coll - The Collection whose elements are to be removed from the List
Returns:
True if any of the given elements was in the List
Throws:
UnsupportedOperationException - removeAll is not supported by this List

retainAll

public boolean retainAll(Collection c)
Remove all elements in this List which are not in the given Collection.

Specified by:
retainAll in interface List
Returns:
True if any elements were removed from the List
Throws:
UnsupportedOperationException - retainAll is not supported by this List

set

public Object set(int index,
                  Object obj)
Set the element at a given position in this List

Specified by:
set in interface List
Parameters:
index - The desired position of the new element
obj - The object to be stored at the given location
Returns:
The element previously found at that position

size

public abstract int size()
Return the number of elements in this List

Specified by:
size in interface List
Returns:
the cardinality of this List

subList

public abstract List subList(int startIndex,
                             int endIndex)
Get a List which is a subsequence of this List (the ordering is the same)

Specified by:
subList in interface List
Parameters:
startIndex - The first element of the sublist
endIndex - The element after the last element of the sublist
Returns:
A List which contains the elements of the specified subset

toArray

public Object[] toArray()
Get an array view of all the elements in this List NOTE: The Iterator's ordering is used

Specified by:
toArray in interface List
Returns:
an Array of all the elements in this List

toArray

public abstract Object[] toArray(Object[] inArray)
Fill a given array with a view of all the elements in this List NOTE: The Iterator's ordering is used

Specified by:
toArray in interface List
Parameters:
inArray - The array in which to store the elements
Returns:
an Array of all the elements in this List

Copyright © 2004 Quest Software Inc..
All rights reserved.