JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.formulae
Class MathExpressionList

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

public class MathExpressionList
extends ExpressionList

A MathExpressionList is a List of Expressions


Field Summary
protected  List dataVector
          We store the data in this List in a Vector
 
Constructor Summary
MathExpressionList()
          Create an empty MathExpressionList
MathExpressionList(com.klg.jclass.util.formulae.Expression[] exprs)
          Create a MathExpressionList from an array of Expressions
 
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()
          Return a clone of this ExpressionList (all members are cloned as well)
 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
 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.
 Object get(int index)
          Retrieve the element at a given position in this List
 int hashCode()
          Return a hash code derived from this List
 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
 Iterator iterator()
          Get an iterator over the elements in this List
 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
 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
 int size()
          Return the number of elements in this List
 List subList(int startIndex, int endIndex)
          Get a List which is a subsequence of this List (the ordering is the same)
 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 com.klg.jclass.util.formulae.ExpressionList
evaluate, toArray
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataVector

protected List dataVector
We store the data in this List in a Vector

Constructor Detail

MathExpressionList

public MathExpressionList()
Create an empty MathExpressionList


MathExpressionList

public MathExpressionList(com.klg.jclass.util.formulae.Expression[] exprs)
Create a MathExpressionList from an array of Expressions

Parameters:
exprs - An array of Expressions
Method Detail

clone

public Object clone()
Return a clone of this ExpressionList (all members are cloned as well)

Specified by:
clone in interface Expression
Overrides:
clone in class ExpressionList

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
Overrides:
add in class ExpressionList
Parameters:
index - The position to insert the given element
obj - The element to be added to this List

add

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

Specified by:
add in interface List
Overrides:
add in class ExpressionList
Parameters:
obj - The element to be added to this List
Returns:
True if the addition of the element was possible

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
Overrides:
addAll in class ExpressionList
Parameters:
coll - The collection to be added to this List
Returns:
True if this operation changed the 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
Overrides:
addAll in class ExpressionList
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

clear

public void clear()
Clear all elements from this List

Specified by:
clear in interface List
Overrides:
clear in class ExpressionList

contains

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

Specified by:
contains in interface List
Specified by:
contains in class ExpressionList
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
Overrides:
containsAll in class ExpressionList
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 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
Specified by:
equals in class ExpressionList
Parameters:
obj - the object whose equality with this List is tested
Returns:
True if the given object satisfies "equality" with this List

get

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

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

hashCode

public int hashCode()
Return a hash code derived from this List

Specified by:
hashCode in interface List
Overrides:
hashCode in class Object
Returns:
the hash code of this List

indexOf

public 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
Specified by:
indexOf in class ExpressionList
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
Overrides:
isEmpty in class ExpressionList
Returns:
True if this List contains no elements

iterator

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

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

lastIndexOf

public 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
Specified by:
lastIndexOf in class ExpressionList
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
Overrides:
listIterator in class ExpressionList
Returns:
A ListIterator over this List

listIterator

public 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
Specified by:
listIterator in class ExpressionList
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
Overrides:
remove in class ExpressionList
Parameters:
index - The position of the element to be removed from this List
Returns:
The Object that has been removed from the List

remove

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

Specified by:
remove in interface List
Overrides:
remove in class ExpressionList
Returns:
True if the given element was in the 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
Overrides:
removeAll in class ExpressionList
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

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
Overrides:
retainAll in class ExpressionList
Returns:
True if any elements were removed from the 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
Overrides:
set in class ExpressionList
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 int size()
Return the number of elements in this List

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

subList

public 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
Specified by:
subList in class ExpressionList
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(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
Specified by:
toArray in class ExpressionList
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.