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 Details

    • chunk

      public int chunk
    • chunksize

      public int chunksize
    • overlap

      public int overlap
  • Constructor Details

    • MyList

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

      public MyList()
  • Method Details

    • size

      public int size()
      Specified by:
      size in class Dictionary
    • 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 interface PropertiesCacheManager.Saveable
      Specified by:
      isEmpty in class Dictionary
    • sort

      public void sort()
    • 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
    • append

      public void append(String s, String delim)
      Append a list to the end of the named list
    • 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.
      Specified by:
      remove in class 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(String delim)
      Set the delimiter for returning ranges.
    • keys

      public Enumeration keys()
      Return an enumeration of the "special" keys for this list.
      Specified by:
      keys in class Dictionary
    • elements

      public Enumeration elements()
      Return the actual list items.
      Specified by:
      elements in class Dictionary
    • get

      public Object get(Object k)
      Specified by:
      get in class Dictionary
    • put

      public Object put(Object key, Object value)
      This is never used; It's required by the interface
      Specified by:
      put in class Dictionary
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • chunks

      public int chunks()
    • save

      public void save(OutputStream out, String header) throws IOException
      Description copied from interface: PropertiesCacheManager.Saveable
      Create an ascii representation of this object in a Java Properties format.
      Specified by:
      save in interface PropertiesCacheManager.Saveable
      Throws:
      IOException
    • load

      public void load(InputStream in) throws IOException
      load a properties representation of the object, then create the object from it.
      Specified by:
      load in interface PropertiesCacheManager.Saveable
      Throws:
      IOException