org.jtool.jxplatform.wrapper.collection
Class JxVariableList

java.lang.Object
  extended byorg.jtool.jxplatform.wrapper.collection.JxVariableList

public class JxVariableList
extends java.lang.Object

A list of JxVariable wrappers.

Author:
Katsuhsa Maruyama

Constructor Summary
JxVariableList()
          Creates a new, empty list object.
JxVariableList(org.w3c.dom.Element[] elems)
          Creates a new list containing DOM elements of an array.
JxVariableList(JxVariableList list)
          Creates a new list from a list of JxVariable wrappers.
 
Method Summary
 boolean add(int index, JxVariable jv)
          Inserts a wrapper at a position in this list.
 boolean add(JxVariable jv)
          Appends a wrapper to the end of this list.
 void addAll(JxVariableList list)
          Appends all wrappers in a list to the end of this list.
 boolean addFirst(JxVariable jv)
          Inserts a wrapper at the beginning of this list.
 boolean addLast(JxVariable jv)
          Appends a wrapper to the end of this list.
 void clear()
          Removes all wrappers from this list.
 boolean contains(JxVariable jv)
          Tests if this list contains a wrapper.
 boolean containsAll(JxVariableList list)
          Tests if this list contains all wrappers of a list.
 JxVariable get(int index)
          Returns a wrapper at the position in this list.
 JxVariable getFirst()
          Returns the first wrapper in this list.
 java.lang.String getInfo()
          Obtains information about this list.
 JxVariable getJxVariable(JxVariable jv)
          Returns a wrapper in this list that indicates the same DOM element of a wrapper.
 JxVariable getJxVariable(java.lang.String name)
          not Returns a wrapper with a name in this list.
 JxVariable getLast()
          Returns the last wrapper in this list.
 boolean isEmpty()
          Tests if this list contains no wrapper.
 java.util.Iterator iterator()
          Returns an iterator of this list in proper sequence.
 void print()
          Displays information about this list.
 JxVariable remove(int index)
          Removes a wrapper at a position in this list.
 boolean remove(JxVariable jv)
          Removes a wrapper from this list.
 void removeAll(JxVariableList list)
          Removes all wrappers in a list from this list.
 JxVariable removeFirst()
          Removes the first wrapper from this list.
 JxVariable removeLast()
          Removes the last wrapper from this list.
 boolean retainAll(JxVariableList list)
          Retains only wrappers in this list that are contained in a specified list.
 int size()
          Returns the number of wrappers in this list.
 boolean strictlyContains(JxVariable jv)
          Tests if this list contains a wrapper that is the same as a given wrapper.
 JxVariable[] toArray()
          Returns an array containing all wrappers in this list in proper sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JxVariableList

public JxVariableList()
Creates a new, empty list object.


JxVariableList

public JxVariableList(JxVariableList list)
Creates a new list from a list of JxVariable wrappers.

Parameters:
list - A list of wrappers.

JxVariableList

public JxVariableList(org.w3c.dom.Element[] elems)
               throws JxWrapperException
Creates a new list containing DOM elements of an array.

Parameters:
elems - An array of DOM elements.
Throws:
JxWrapperException - if the array contains elements other than the element correspondinf to a variable.
Method Detail

clear

public void clear()
Removes all wrappers from this list.


add

public boolean add(JxVariable jv)
Appends a wrapper to the end of this list.

Parameters:
jv - A wrapper to be appended.
Returns:
true if this list changed as a result of the call.

add

public boolean add(int index,
                   JxVariable jv)
Inserts a wrapper at a position in this list.

Parameters:
index - A position where a wrapper is inserted.
jv - A wrapper to be inserted.
Returns:
true if this list changed as a result of the call.

addAll

public void addAll(JxVariableList list)
Appends all wrappers in a list to the end of this list.

Parameters:
list - A list of wrappes to be appended.

remove

public boolean remove(JxVariable jv)
Removes a wrapper from this list.

Parameters:
jv - A wrapper to be removed.
Returns:
true if this list changed as a result of the call.

removeAll

public void removeAll(JxVariableList list)
Removes all wrappers in a list from this list.

Parameters:
list - A list of wrappers to be removed.

remove

public JxVariable remove(int index)
Removes a wrapper at a position in this list.

Parameters:
index - A position where a wrapper is removed.
Returns:
The removed wrapper, null if there is no removed wrapper.

retainAll

public boolean retainAll(JxVariableList list)
Retains only wrappers in this list that are contained in a specified list.

Parameters:
list - A list of wrappers to be retained.
Returns:
true if this list changed as a result of the call.

contains

public boolean contains(JxVariable jv)
Tests if this list contains a wrapper.

Parameters:
jv - A wrapper to be tested.
Returns:
true if the wra3pper is present, otherwise false.

containsAll

public boolean containsAll(JxVariableList list)
Tests if this list contains all wrappers of a list.

Parameters:
list - A list of wrappers to be tested.
Returns:
true if this list contains all of the wrappers of the list, otherwise false.

strictlyContains

public boolean strictlyContains(JxVariable jv)
Tests if this list contains a wrapper that is the same as a given wrapper. Although two wrappers generated from the same DOM element, they are not consider to be identical.

Parameters:
jv - A wrapper to be tested.
Returns:
true if the wrapper is present, otherwise false.

get

public JxVariable get(int index)
Returns a wrapper at the position in this list.

Parameters:
index - The position where a wrapper is obtained.
Returns:
The wrapper at the position, null if there is no wrapper found.

getFirst

public JxVariable getFirst()
Returns the first wrapper in this list.

Returns:
The first wrapper.

getLast

public JxVariable getLast()
Returns the last wrapper in this list.

Returns:
The last wrapper.

addFirst

public boolean addFirst(JxVariable jv)
Inserts a wrapper at the beginning of this list.

Parameters:
jv - A wrapper to be inserted.
Returns:
true if this list changed as a result of the call.

addLast

public boolean addLast(JxVariable jv)
Appends a wrapper to the end of this list.

Parameters:
jv - A wrapper to be append.
Returns:
true if this list changed as a result of the call.

removeFirst

public JxVariable removeFirst()
Removes the first wrapper from this list.

Returns:
The removed wrapper, null if no wrapper was removed.

removeLast

public JxVariable removeLast()
Removes the last wrapper from this list.

Returns:
The removed wrapper, null if no element was removed.

isEmpty

public boolean isEmpty()
Tests if this list contains no wrapper.

Returns:
true if this list contains no wrapper, otherwise false.

size

public int size()
Returns the number of wrappers in this list.

Returns:
The number of wrappers.

iterator

public java.util.Iterator iterator()
Returns an iterator of this list in proper sequence.

Returns:
The iterator of this list.

getJxVariable

public JxVariable getJxVariable(JxVariable jv)
Returns a wrapper in this list that indicates the same DOM element of a wrapper.

Parameters:
jv - A wrapper to be retrived.
Returns:
The matched wrapper in this list, null if there is no wrapper matched.

getJxVariable

public JxVariable getJxVariable(java.lang.String name)
not Returns a wrapper with a name in this list.

Parameters:
name - The name of a variable to be retrived.
Returns:
The matched wrapper in this list, null if there is no wrapper matched.

toArray

public JxVariable[] toArray()
Returns an array containing all wrappers in this list in proper sequence.

Returns:
The array of wrappers.

print

public void print()
Displays information about this list.


getInfo

public java.lang.String getInfo()
Obtains information about this list.

Returns:
The text describing the information.