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 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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Append a list to the end of the named listint
chunks()
void
clear()
Clear a list.void
delete
(int i) Remove an element by index.elements()
Return the actual list items.void
Insert a list before position n.boolean
isEmpty()
The current object state is the "default"; "save" does not need to write out any state.keys()
Return an enumeration of the "special" keys for this list.void
load
(InputStream in) load a properties representation of the object, then create the object from it.void
max
(int n) Set the max list size.This is never used; It's required by the interfaceWe should never call this; it's required by the interface.void
Remove items from a list, by name.void
save
(OutputStream out, String header) Create an ascii representation of this object in a Java Properties format.void
Set the delimiter for returning ranges.int
size()
void
sort()
toString()
void
unique()
Remove all non unique elements of the list.
-
Field Details
-
chunk
public int chunk -
chunksize
public int chunksize -
overlap
public int overlap
-
-
Constructor Details
-
MyList
Create a named list object. -
MyList
public MyList()
-
-
Method Details
-
size
public int size()- Specified by:
size
in classDictionary
-
isEmpty
public boolean isEmpty()Description copied from interface:PropertiesCacheManager.Saveable
The current object state is the "default"; "save" does not need to write out any state.- Specified by:
isEmpty
in interfacePropertiesCacheManager.Saveable
- Specified by:
isEmpty
in classDictionary
-
sort
public void sort() -
insert
-
append
-
remove
-
remove
We should never call this; it's required by the interface.- Specified by:
remove
in classDictionary
-
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
Set the delimiter for returning ranges. -
keys
Return an enumeration of the "special" keys for this list.- Specified by:
keys
in classDictionary
-
elements
Return the actual list items.- Specified by:
elements
in classDictionary
-
get
- Specified by:
get
in classDictionary
-
put
This is never used; It's required by the interface- Specified by:
put
in classDictionary
-
toString
-
chunks
public int chunks() -
save
Description copied from interface:PropertiesCacheManager.Saveable
Create an ascii representation of this object in a Java Properties format.- Specified by:
save
in interfacePropertiesCacheManager.Saveable
- Throws:
IOException
-
load
load a properties representation of the object, then create the object from it.- Specified by:
load
in interfacePropertiesCacheManager.Saveable
- Throws:
IOException
-