sunlabs.brazil.sunlabs

Class ListTemplate.MyList

public static class ListTemplate.MyList extends 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.
Field Summary
intchunk
intchunksize
intoverlap
Constructor Summary
MyList(String name)
Create a named list object.
MyList()
Method Summary
voidappend(String s, String delim)
Append a list to the end of the named list
intchunks()
voidclear()
Clear a list.
voiddelete(int i)
Remove an element by index.
Enumerationelements()
Return the actual list items.
Objectget(Object k)
voidinsert(String s, String delim, int n)
Insert a list before position n.
booleanisEmpty()
Enumerationkeys()
Return an enumeration of the "special" keys for this list.
voidload(InputStream in)
load a properties representation of the object, then create the object from it.
voidmax(int n)
Set the max list size.
Objectput(Object key, Object value)
This is never used; It's required by the interface
voidremove(String s, String delim)
Remove items from a list, by name.
Objectremove(Object o)
We should never call this; it's required by the interface.
voidsave(OutputStream out, String header)
voidsetDelim(String delim)
Set the delimiter for returning ranges.
intsize()
voidsort()
StringtoString()
voidunique()
Remove all non unique elements of the list.

Field Detail

chunk

public int chunk

chunksize

public int chunksize

overlap

public int overlap

Constructor Detail

MyList

public MyList(String name)
Create a named list object.

MyList

public MyList()

Method Detail

append

public void append(String s, String delim)
Append a list to the end of the named list

chunks

public int chunks()

clear

public void clear()
Clear a list.

delete

public void delete(int i)
Remove an element by index.

elements

public Enumeration elements()
Return the actual list items.

get

public Object get(Object k)

insert

public void insert(String s, String delim, int n)
Insert a list before position n.

Parameters: s The list to insert delim The list delimiter (null for a single item( n The position to insert before

isEmpty

public boolean isEmpty()

keys

public Enumeration keys()
Return an enumeration of the "special" keys for this list.

load

public void load(InputStream in)
load a properties representation of the object, then create the object from it.

max

public void max(int n)
Set the max list size.

put

public Object put(Object key, Object value)
This is never used; It's required by the interface

remove

public void remove(String s, String delim)
Remove items from a list, by name.

remove

public Object remove(Object o)
We should never call this; it's required by the interface.

save

public void save(OutputStream out, String header)

setDelim

public void setDelim(String delim)
Set the delimiter for returning ranges.

size

public int size()

sort

public void sort()

toString

public String toString()

unique

public void unique()
Remove all non unique elements of the list. XXX: (cache stupid!)