|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection java.util.AbstractList java.util.ArrayList wyvern.lib.properties.StringList
This property knows how to read & write itself as a list of strings. Each string is on a separate line. Doesn't perform well when the list gets long; consider using a hash for more than about 20-30 strings or so.
Field Summary |
Fields inherited from class java.util.AbstractList |
modCount |
Constructor Summary | |
StringList()
Constructs a new, empty StringList. |
|
StringList(java.util.List strings)
Constructs a new StringList with the specified strings. |
Method Summary | |
void |
add(java.lang.String s)
Adds a string to the list. |
boolean |
contains(java.lang.String item)
Returns true if the passed string is in the list. |
java.lang.Object |
createClone()
Produces a clone of the property for the caller. |
java.util.List |
getList()
Gets the list of strings. |
void |
readData(org.w3c.dom.Node bean)
Initializes the object from the passed lines-list. |
boolean |
remove(java.lang.String s)
Removes the specified string from the list. |
void |
setList(java.util.List locs)
Sets the list of strings in this StringList. |
boolean |
shouldWrite()
Returns true if we should write the object at all. |
java.lang.String |
toString()
Returns a String representation of the list. |
java.util.List |
writeData()
Writes the object's externalized representation to the specified output stream. |
Methods inherited from class java.util.ArrayList |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
containsAll, remove, removeAll, retainAll |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
containsAll, equals, hashCode, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList |
Constructor Detail |
public StringList()
public StringList(java.util.List strings)
strings
- the new list of strings to useMethod Detail |
public java.util.List getList()
public void setList(java.util.List locs)
locs
- the new list of strings to usepublic void add(java.lang.String s)
public boolean remove(java.lang.String s)
public void readData(org.w3c.dom.Node bean) throws java.lang.Exception
readData
in interface SelfExternalizable
bean
- the node representing the SelfExternalizable bean
object, which should have at least one child data node.
java.lang.Exception
public java.util.List writeData() throws java.lang.Exception
writeData
in interface SelfExternalizable
java.lang.Exception
public boolean shouldWrite()
shouldWrite
in interface SelfExternalizable
public java.lang.Object createClone()
createClone
in interface MutableProperty
public java.lang.String toString()
public boolean contains(java.lang.String item)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |