Class pmr.euclid.StringSet
All Packages Class Hierarchy This Package Previous Next Index
Class pmr.euclid.StringSet
java.lang.Object
|
+----pmr.euclid.StringSet
- public class StringSet
- extends Object
Stores a unique set of Strings. By default this is case-sensitive, but
the user can set this to insensitive. The actual value stored is
case-sensitive. Also keeps a score of the indexNumber of each element,
and can thus be used for keying Vectors.
- Author:
- (C) P. Murray-Rust, 1996
-
IGNORE_CASE
-
-
StringSet()
- default contsructor is case-sensitive
-
StringSet(int)
- set case insensitivity if 'ignore' arg is 'StringSet.IGNORE_CASE'
-
StringSet(String[])
- create a StringSet from the Strings (duplicates are ignored); case-sensitive
-
addElement(String)
- adds an element.
-
addSet(StringSet)
- catenates one set onto another.
-
contains(String)
- does Set contain String? (according to case-sensitivity
-
debug()
-
-
elementAt(int)
- return (case-sensitive) element
-
getElements()
- return all members (case sensitive by default)
-
getIgnoreCase()
- state of case-sensitivity
-
indexOf(String)
- index of a given String (default is case-sensitive); -1 if not found
-
indexSortAscending()
-
-
indexSortDescending()
- sort elem into descending order via indexes; elem NOT MODIFIED
-
main(String[])
-
-
reverse()
- MODIFIES StringSet to be in reverse order
-
size()
-
-
sortAscending()
- MODIFIES StringSet to be in ascending order
-
sortDescending()
- MODIFIES StringSet to be in descending order
-
toString()
- outputs the components as a list separated by "\n" - bad luck if they
already contain this!
IGNORE_CASE
public final static int IGNORE_CASE
StringSet
public StringSet()
- default contsructor is case-sensitive
StringSet
public StringSet(int ignore)
- set case insensitivity if 'ignore' arg is 'StringSet.IGNORE_CASE'
StringSet
public StringSet(String strings[])
- create a StringSet from the Strings (duplicates are ignored); case-sensitive
getElements
public String[] getElements()
- return all members (case sensitive by default)
size
public int size()
getIgnoreCase
public boolean getIgnoreCase()
- state of case-sensitivity
addElement
public void addElement(String value)
- adds an element. If String is already present, does nothing
contains
public boolean contains(String value)
- does Set contain String? (according to case-sensitivity
indexOf
public int indexOf(String value)
- index of a given String (default is case-sensitive); -1 if not found
elementAt
public String elementAt(int i)
- return (case-sensitive) element
addSet
public void addSet(StringSet is) throws StringSetException
- catenates one set onto another. Fails if Sets differ in
case-sensitivity.
- Throws: StringSetException
- mixed case is not allowed
debug
public void debug()
toString
public String toString()
- outputs the components as a list separated by "\n" - bad luck if they
already contain this!
- Overrides:
- toString in class Object
sortAscending
public void sortAscending()
- MODIFIES StringSet to be in ascending order
sortDescending
public void sortDescending()
- MODIFIES StringSet to be in descending order
reverse
public void reverse()
- MODIFIES StringSet to be in reverse order
indexSortAscending
public IntSet indexSortAscending()
indexSortDescending
public IntSet indexSortDescending()
- sort elem into descending order via indexes; elem NOT MODIFIED
main
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index