Open SiteSearch 4.1.1
Final

ORG.oclc.jassi
Class DataPairs

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--ORG.oclc.jassi.DataPairs

public class DataPairs
extends Vector

The DataPairs class defines a vector where DataPair objects will be stored.

See Also:
DataPair, Action, RequestManager, Verb, Serialized Form

Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
DataPairs()
          Constructs a DataPairs object vector of initial size 10.
DataPairs(int initialCapacity)
          Constructs a DataPairs object vector of initial size as specified in the input parameter.
DataPairs(int initialCapacity, int capacityIncrement)
          Constructs a DataPairs object vector of initial size and incremental size as specified in the input parameters.
 
Method Summary
 void addElement(String name, String value)
          Adds the input name/value Strings to the end of this DataPairs vector as a DataPair object.
 boolean contains(String elem)
          Tests if the specified input DataPair name is contained in this vector.
 String get(String elem)
          Searches for the input DataPair name and returns the DataPair String value.
 String get(String elem, String def)
          Searches for the input DataPair name and returns the DataPair String value or the input parameter default String value.
 String getall(String elem)
          Deprecated. Incorrectly named.
 String getAll(String elem)
          Searches the vector for ALL occurrences of the input DataPair name and builds a space separated String of all the DataPair object values.
 Vector getAllStartsWithVector(String elem)
          Searches the vector for ALL occurrences that start with the input DataPair name and returns the values in a vector.
 Vector getAllVector(String elem)
          Searches the vector for ALL occurrences of the input DataPair name and returns the values in a vector.
 int getInt(String elem, int def)
          Searches for the input DataPair name and returns the DataPair integer value or a default integer value if not found.
 String getKey(String value)
          Searches for the input DataPair value and returns the DataPair String name.
 int indexOf(String elem)
          Searches for the first occurrence of the input DataPair name and tests for equality using the String equals method.
 int indexOf(String elem, int index)
          Searches for the first occurrence of the input DataPair name, beginning the search at the input index value, and testing for equality using the String equals method.
 void insertElementAt(String name, String value, int index)
          Inserts a new DataPair object at the specified index using the input DataPair name and value parameters.
 int lastIndexOf(String elem)
          Searches backwards for the input DataPair name by starting from the end of the vector.
 int lastIndexOf(String elem, int index)
          Searches backwards for the input DataPair name by starting from the input index value within the vector.
 void remove(String elem)
          Removes the first occurrence of the DataPair object matching the input DataPair name.
 void removeall(String elem)
          Deprecated. Incorrectly named.
 void removeAll(String elem)
          Removes all occurrences of the DataPair object matching the input DataPair name.
 void replaceElement(String name, String value)
          Replaces the DataPair value of the first occurrence of the DataPair object with the input DataPair name.
 void setElementAt(String name, String value, int index)
          Sets the DataPair object at the specified index of this vector to be the input DataPair name and value parameters.
 String toString(String separator)
          Returns the String representation of this object.
 String toString(String separator, String lineSeparator)
          Returns the String representation of this object.
 String toString(String separator, String lineSeparator, boolean encode)
          Returns the String representation of this object.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataPairs

public DataPairs()
Constructs a DataPairs object vector of initial size 10.

DataPairs

public DataPairs(int initialCapacity)
Constructs a DataPairs object vector of initial size as specified in the input parameter.
Parameters:
initialCapacity - the initial size of the DataPairs vector.

DataPairs

public DataPairs(int initialCapacity,
                 int capacityIncrement)
Constructs a DataPairs object vector of initial size and incremental size as specified in the input parameters.
Parameters:
initialCapacity - the initial size of the DataPairs vector.
capacityIncrement - the increment size when increasing the current capacity of the DataPairs vector.
Method Detail

contains

public final boolean contains(String elem)
Tests if the specified input DataPair name is contained in this vector.
Parameters:
elem - the name of the DataPair object.
Returns:
true if the DataPair object is a component in this vector; false otherwise.

addElement

public final void addElement(String name,
                             String value)
Adds the input name/value Strings to the end of this DataPairs vector as a DataPair object.
Parameters:
name - the name of the DataPair object.
value - the value of the DataPair object.

indexOf

public final int indexOf(String elem)
Searches for the first occurrence of the input DataPair name and tests for equality using the String equals method.
Parameters:
elem - the name of the DataPair object.
Returns:
the index of the first occurrence of the DataPair object in this vector at position index or later in the vector; returns -1 if the DataPair object is not found.

indexOf

public final int indexOf(String elem,
                         int index)
Searches for the first occurrence of the input DataPair name, beginning the search at the input index value, and testing for equality using the String equals method.
Parameters:
elem - the name of the DataPair object.
index - the index in the vector to start the search.
Returns:
the index of the first occurrence of the DataPair object in this vector at position index or later in the vector; returns -1 if the DataPair object is not found.

lastIndexOf

public final int lastIndexOf(String elem)
Searches backwards for the input DataPair name by starting from the end of the vector.
Parameters:
elem - the name of the DataPair object.
Returns:
the index of the last occurrence of the DataPair object in this vector; -1 if the DataPair object is not found.

lastIndexOf

public final int lastIndexOf(String elem,
                             int index)
Searches backwards for the input DataPair name by starting from the input index value within the vector.
Parameters:
elem - the name of the DataPair object.
index - the index in the vector to start the search.
Returns:
the index of the last occurrence of the specified object in this vector at position less than index in the vector; -1 if the DataPair object is not found.

getKey

public final String getKey(String value)
Searches for the input DataPair value and returns the DataPair String name.
Parameters:
value - the value of the DataPair object.
Returns:
the String name of the DataPair object; a null if a DataPair object is not found.

get

public final String get(String elem)
Searches for the input DataPair name and returns the DataPair String value.
Parameters:
elem - the name of the DataPair object.
Returns:
the String value of the DataPair object; a null if a DataPair object is not found.

get

public final String get(String elem,
                        String def)
Searches for the input DataPair name and returns the DataPair String value or the input parameter default String value.
Parameters:
elem - the name of the DataPair object.
def - the default String value.
Returns:
the String value of the DataPair object; or the default String value if the DataPair object is not found.

getInt

public final int getInt(String elem,
                        int def)
Searches for the input DataPair name and returns the DataPair integer value or a default integer value if not found.
Parameters:
elem - the name of the DataPair object.
def - the default integer value.
Returns:
the integer value of the DataPair object; or the default integer value if the DataPair object is not found.

getall

public final String getall(String elem)
Deprecated. Incorrectly named.
Searches the vector for ALL occurrences of the input DataPair name and builds a space separated String of all the DataPair object values.
Parameters:
elem - the name of the DataPair object.
Returns:
a String containing all the DataPair object values found in the vector; null if the DataPair object(s) is not found.
See Also:
getAll

getAll

public final String getAll(String elem)
Searches the vector for ALL occurrences of the input DataPair name and builds a space separated String of all the DataPair object values.
Parameters:
elem - the name of the DataPair object.
Returns:
a String containing all the DataPair object values found in the vector; null if the DataPair object(s) is not found.

getAllVector

public final Vector getAllVector(String elem)
Searches the vector for ALL occurrences of the input DataPair name and returns the values in a vector.
Parameters:
elem - the name of the DataPair object.
Returns:
a Vector containing all the DataPair object values found in the vector; null if the DataPair object(s) is not found.

getAllStartsWithVector

public final Vector getAllStartsWithVector(String elem)
Searches the vector for ALL occurrences that start with the input DataPair name and returns the values in a vector.
Parameters:
elem - the stem name of the DataPair object.
Returns:
a Vector containing all the DataPair object values found in the vector; null if the DataPair object(s) is not found.

replaceElement

public final void replaceElement(String name,
                                 String value)
Replaces the DataPair value of the first occurrence of the DataPair object with the input DataPair name. A new DataPair object is created if an existing match is not found.
Parameters:
name - the name of the DataPair object.
value - the new value for the DataPair object.

setElementAt

public final void setElementAt(String name,
                               String value,
                               int index)
Sets the DataPair object at the specified index of this vector to be the input DataPair name and value parameters. The previous DataPair object at that position is discarded.

The index must be a value greater than or equal to 0 and less than the current size of the vector.

Parameters:
name - the new name of the DataPair object.
value - the new value for the DataPair object.
index - the index of the DataPair object to replace.

insertElementAt

public final void insertElementAt(String name,
                                  String value,
                                  int index)
Inserts a new DataPair object at the specified index using the input DataPair name and value parameters.

Each DataPair object in this vector with an index greater or equal to the specified index is shifted upward to have an index one greater than the value it had previously.

The index must be a value greater than or equal to 0 and less than or equal to the current size of the vector.

Parameters:
name - the new name of the DataPair object.
value - the new value for the DataPair object.
index - the index of the DataPair object to insert.

remove

public final void remove(String elem)
Removes the first occurrence of the DataPair object matching the input DataPair name.
Parameters:
elem - the name of the DataPair object.

removeAll

public final void removeAll(String elem)
Removes all occurrences of the DataPair object matching the input DataPair name.
Parameters:
elem - the name of the DataPair object.

removeall

public final void removeall(String elem)
Deprecated. Incorrectly named.
Removes all occurrences of the DataPair object matching the input DataPair name.
Parameters:
elem - the name of the DataPair object.
See Also:
removeAll

toString

public final String toString(String separator,
                             String lineSeparator,
                             boolean encode)
Returns the String representation of this object.
Parameters:
separator - the string to separate DataPair Name and Value with.
lineSeparator - the string to separate each DataPair in the vector with.
Returns:
the String representation of this object.

toString

public final String toString(String separator)
Returns the String representation of this object.
Returns:
the String representation of this object.

toString

public final String toString(String separator,
                             String lineSeparator)
Returns the String representation of this object.
Returns:
the String representation of this object.

Open SiteSearch 4.1.1
Final