|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sdsu.util.List
A List object is a vector that can convert itself to a string and "recreate" itself from that string. The original List object can contain any objects, but the recreated List object will only contain string representations of the original elements in the list. In a List object string representation (Losr) the list elements are separated by a separatorChar, which defaults to ',', but can be changed. If the string representation of a list element contains a special character it is quoted. Special characters include separatorChar, a comment character, and white space characters. See sdsu.util.TokenCharacters for default values. White space and comments can be added to a Losr for readability. Comments start with a comment character and continue upto and include the next '\n' character.
Stringizer
,
SimpleTokenizer
,
TokenCharacters
, Serialized FormConstructor Summary | |
List()
Create a new list |
|
List(int initialSize)
Create a list with initial given size |
|
List(java.lang.Object[] list)
Create a list initial items from a list |
|
List(java.util.Vector initialElements)
Create a list initial items from a list |
Method Summary | |
void |
addElement(double aDouble)
Adds the specified double as the last element of the list. |
void |
addElement(int anInt)
Adds the specified int as the last element of the list. |
void |
addElement(java.lang.Object obj)
|
void |
addElements(java.lang.Object[] elementsToAdd)
Adds the array to the end of the list. |
void |
addElements(java.util.Vector elementsToAdd)
Adds the vector to the end of the list. |
int |
capacity()
|
java.lang.Object |
clone()
|
boolean |
contains(java.lang.Object obj)
|
double |
doubleAt(int index)
Returns the double at the specified index. |
java.lang.Object |
elementAt(int i)
|
java.util.Enumeration |
elements()
|
java.util.Enumeration |
elementsReversed()
Returns an enumeration of the elements inrevese order. |
void |
ensureCapacity(int minCapacity)
|
java.lang.Object |
firstElement()
|
void |
fromString(java.lang.String listString)
Converts a string to a list. |
LabeledData |
getMetaData()
Returns name-valeu pair of data used to parse a string version of a LabeledData object |
int |
indexOf(java.lang.Object obj)
|
int |
indexOf(java.lang.Object obj,
int i)
|
void |
insertElementAt(java.lang.Object obj,
int i)
|
int |
intAt(int index)
Returns the int at the specified index. |
boolean |
isEmpty()
|
java.lang.Object |
lastElement()
|
int |
lastIndexOf(java.lang.Object obj)
|
int |
lastIndexOf(java.lang.Object obj,
int i)
|
void |
load(java.io.InputStream in)
Converts a string to a list. |
void |
load(java.io.Reader in)
Converts a string to a list. |
void |
removeAllElements()
|
boolean |
removeElement(java.lang.Object obj)
|
void |
removeElementAt(int i)
|
void |
replaceElements(java.lang.Object[] objs)
Deprecated. This method will be come protected in a future release. It was designed for internal use only. It does not work with SortedList |
OrderedCollection |
reversed()
Returns a list with elements in the reverse order from present list |
void |
save(java.io.OutputStream out,
java.lang.String header)
Writes ascii representation of List to Outputstream |
void |
setElementAt(java.lang.Object obj,
int i)
|
void |
setMetaData(LabeledData metaData)
Set the current objects metadata to be that found in metaData string |
void |
setSeparatorChar(char separatorChar)
Set character used to separate elements of list in String representation of List |
void |
setSize(int size)
|
void |
setTokenCharacters(TokenCharacters newParseTable)
Sets TokenCharacters used to convert List from/to strings/streams. |
OrderedCollection |
shuffled()
Returns a list with elements from present list, but in random order. |
int |
size()
|
java.lang.Object[] |
toArray()
Converts the list to an array. |
java.lang.String |
toString()
Converts the list to a string |
java.lang.String |
toString(java.lang.String header)
Converts the list to a string with given header information. |
java.util.Vector |
toVector()
Converts the list to a vector. |
void |
trimToSize()
|
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public List()
public List(int initialSize)
public List(java.util.Vector initialElements)
public List(java.lang.Object[] list)
Method Detail |
public void fromString(java.lang.String listString) throws ConversionException
public void load(java.io.InputStream in) throws ConversionException
public void load(java.io.Reader in) throws ConversionException
public java.lang.String toString()
public java.lang.String toString(java.lang.String header)
public java.util.Vector toVector()
public java.lang.Object[] toArray()
public void save(java.io.OutputStream out, java.lang.String header)
public void setSeparatorChar(char separatorChar)
public void setTokenCharacters(TokenCharacters newParseTable)
public void setMetaData(LabeledData metaData)
public LabeledData getMetaData()
public final java.util.Enumeration elementsReversed()
public final int intAt(int index)
index
- the index of the desired elementpublic final double doubleAt(int index)
index
- the index of the desired elementpublic final void addElement(int anInt)
anInt
- the element to be addedpublic final void addElement(double aDouble)
aFloat
- the element to be addedpublic void addElements(java.lang.Object[] elementsToAdd)
public void addElements(java.util.Vector elementsToAdd)
public OrderedCollection reversed()
public OrderedCollection shuffled()
public java.util.Enumeration elements()
public void trimToSize()
public void ensureCapacity(int minCapacity)
public void setSize(int size)
public int capacity()
public int size()
public boolean isEmpty()
public boolean contains(java.lang.Object obj)
public int indexOf(java.lang.Object obj)
public int indexOf(java.lang.Object obj, int i)
public int lastIndexOf(java.lang.Object obj)
public int lastIndexOf(java.lang.Object obj, int i)
public java.lang.Object elementAt(int i)
public java.lang.Object firstElement()
public java.lang.Object lastElement()
public void setElementAt(java.lang.Object obj, int i)
public void removeElementAt(int i)
public void insertElementAt(java.lang.Object obj, int i)
public void addElement(java.lang.Object obj)
public boolean removeElement(java.lang.Object obj)
public void removeAllElements()
public void replaceElements(java.lang.Object[] objs)
public java.lang.Object clone()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |