|
Purple Code | |||||||||
| 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
|
+--com.purpletech.util.EntryList
A List that acts like a cross between a List and a Map. It's full of Map.Entry records, so each value has a key.
get(int) returns the entry. get(object) returns the first value matching the given key (like a Map does). getAll(object) returns a List of values for the given key. Note that it can't actually implement Map because some idiot at Sun defined remove(Object)'s return value inconsistently between Map and List.
Implements PropertyChange pattern for JavaBeans support.
| Nested Class Summary | |
protected static class |
EntryList.Entry
Lifted from java/util/HashMap.java |
| Field Summary |
| Fields inherited from class java.util.AbstractList |
modCount |
| Constructor Summary | |
EntryList()
|
|
EntryList(EntryList list)
|
|
| Method Summary | |
void |
add(java.lang.Object key,
java.lang.Object value)
Add the name-value pair to the list. |
void |
addAll(java.lang.Object key,
java.util.List values)
Add all the given values to this list under the given key |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener p)
|
static java.lang.String |
fix(java.lang.String s)
|
java.lang.Object |
get(java.lang.Object key)
Get the first value corresponding to the given key |
java.util.List |
getAll(java.lang.Object key)
Get all the values matching the given key |
java.util.List |
getAllEntries(java.lang.Object key)
Get all the entries (name-value pairs) matching the given key |
java.util.Date |
getDate(java.lang.Object key)
Get as a date. |
java.util.Map.Entry |
getEntry(int i)
get an item as a Map.Entry |
java.util.Map.Entry |
getEntry(java.lang.Object key)
Get the first entry corresponding to the given key |
static void |
main(java.lang.String[] args)
|
void |
printXml(java.io.PrintWriter out)
|
void |
printXml(java.io.PrintWriter out,
int indent)
|
void |
put(java.lang.Object key,
java.lang.Object value)
Replace the current value, or add it if it doesn't exist. |
void |
remove(java.lang.Object key,
java.lang.Object value)
remove the given key-value pair |
void |
removeEntries(java.lang.Object key,
java.lang.Object value)
remove all the entries with the given value |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener p)
|
void |
set(EntryList list)
Copy all the values from the given entrylist. |
void |
set(java.util.Map map)
Copy all the name-value pairs from the given map. |
java.lang.String |
toString()
|
| 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 EntryList()
public EntryList(EntryList list)
| Method Detail |
public void add(java.lang.Object key,
java.lang.Object value)
Fires a PropertyChange event with the new value. Note that the semantics are a little flaky since the "old" value may still be present in the list as well as the new value.
public void addAll(java.lang.Object key,
java.util.List values)
public void put(java.lang.Object key,
java.lang.Object value)
public java.lang.Object get(java.lang.Object key)
public java.util.Map.Entry getEntry(java.lang.Object key)
public java.util.Map.Entry getEntry(int i)
public java.util.List getAll(java.lang.Object key)
public java.util.List getAllEntries(java.lang.Object key)
public void removeEntries(java.lang.Object key,
java.lang.Object value)
public void remove(java.lang.Object key,
java.lang.Object value)
public void set(EntryList list)
public void set(java.util.Map map)
public java.util.Date getDate(java.lang.Object key)
public void addPropertyChangeListener(java.beans.PropertyChangeListener p)
public void removePropertyChangeListener(java.beans.PropertyChangeListener p)
public void printXml(java.io.PrintWriter out)
public void printXml(java.io.PrintWriter out,
int indent)
public static java.lang.String fix(java.lang.String s)
public java.lang.String toString()
toString in class java.util.AbstractCollectionpublic static void main(java.lang.String[] args)
|
Documentation generated March 5 2003 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||