Package sunlabs.brazil.sunlabs
Class ListTemplate.MyList
- java.lang.Object
-
- java.util.Dictionary
-
- sunlabs.brazil.sunlabs.ListTemplate.MyList
-
- All Implemented Interfaces:
PropertiesCacheManager.Saveable
- Enclosing class:
- ListTemplate
public static class ListTemplate.MyList extends java.util.Dictionary implements PropertiesCacheManager.Saveable
Implement a list of strings. This uses a Vector for its internal implementation, and is a Dictionary to allow convenient access to portions of the list. By implementing Saveable, lists can participate in persistence.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(java.lang.String s, java.lang.String delim)Append a list to the end of the named listintchunks()voidclear()Clear a list.voiddelete(int i)Remove an element by index.java.util.Enumerationelements()Return the actual list items.java.lang.Objectget(java.lang.Object k)voidinsert(java.lang.String s, java.lang.String delim, int n)Insert a list before position n.booleanisEmpty()The current object state is the "default"; "save" does not need to write out any state.java.util.Enumerationkeys()Return an enumeration of the "special" keys for this list.voidload(java.io.InputStream in)load a properties representation of the object, then create the object from it.voidmax(int n)Set the max list size.java.lang.Objectput(java.lang.Object key, java.lang.Object value)This is never used; It's required by the interfacejava.lang.Objectremove(java.lang.Object o)We should never call this; it's required by the interface.voidremove(java.lang.String s, java.lang.String delim)Remove items from a list, by name.voidsave(java.io.OutputStream out, java.lang.String header)Create an ascii representation of this object in a Java Properties format.voidsetDelim(java.lang.String delim)Set the delimiter for returning ranges.intsize()voidsort()java.lang.StringtoString()voidunique()Remove all non unique elements of the list.
-
-
-
Method Detail
-
size
public int size()
- Specified by:
sizein classjava.util.Dictionary
-
isEmpty
public boolean isEmpty()
Description copied from interface:PropertiesCacheManager.SaveableThe current object state is the "default"; "save" does not need to write out any state.- Specified by:
isEmptyin interfacePropertiesCacheManager.Saveable- Specified by:
isEmptyin classjava.util.Dictionary
-
sort
public void sort()
-
insert
public void insert(java.lang.String s, java.lang.String delim, int n)Insert a list before position n.- Parameters:
s- The list to insertdelim- The list delimiter (null for a single item(n- The position to insert before
-
append
public void append(java.lang.String s, java.lang.String delim)Append a list to the end of the named list
-
remove
public void remove(java.lang.String s, java.lang.String delim)Remove items from a list, by name.
-
remove
public java.lang.Object remove(java.lang.Object o)
We should never call this; it's required by the interface.- Specified by:
removein classjava.util.Dictionary
-
delete
public void delete(int i)
Remove an element by index.
-
clear
public void clear()
Clear a list.
-
max
public void max(int n)
Set the max list size.
-
unique
public void unique()
Remove all non unique elements of the list. XXX: (cache stupid!)
-
setDelim
public void setDelim(java.lang.String delim)
Set the delimiter for returning ranges.
-
keys
public java.util.Enumeration keys()
Return an enumeration of the "special" keys for this list.- Specified by:
keysin classjava.util.Dictionary
-
elements
public java.util.Enumeration elements()
Return the actual list items.- Specified by:
elementsin classjava.util.Dictionary
-
get
public java.lang.Object get(java.lang.Object k)
- Specified by:
getin classjava.util.Dictionary
-
put
public java.lang.Object put(java.lang.Object key, java.lang.Object value)This is never used; It's required by the interface- Specified by:
putin classjava.util.Dictionary
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
chunks
public int chunks()
-
save
public void save(java.io.OutputStream out, java.lang.String header) throws java.io.IOExceptionDescription copied from interface:PropertiesCacheManager.SaveableCreate an ascii representation of this object in a Java Properties format.- Specified by:
savein interfacePropertiesCacheManager.Saveable- Throws:
java.io.IOException
-
load
public void load(java.io.InputStream in) throws java.io.IOExceptionload a properties representation of the object, then create the object from it.- Specified by:
loadin interfacePropertiesCacheManager.Saveable- Throws:
java.io.IOException
-
-