gishur.core
Class List

java.lang.Object
  |
  +--gishur.core.BasicList
        |
        +--gishur.core.SimpleList
              |
              +--gishur.core.List
All Implemented Interfaces:
java.lang.Cloneable, Cloneable, ControlledCloneable, Owner, java.io.Serializable
Direct Known Subclasses:
ClipList

public class List
extends SimpleList

A list type based upon SimpleList.

Version:
1.0
Author:
Thomas Wolf
See Also:
SimpleList, ListItem, StdListItem, Serialized Form

Fields inherited from class gishur.core.BasicList
ANY_ACCESS, KEY, LISTITEM, NO_ACCESS, VALUE
 
Fields inherited from interface gishur.core.ControlledCloneable
DEEP, FLAT
 
Constructor Summary
List()
          Empty constructor.
List(BasicList L)
          Conversion constructor.
List(ListItem start, int count)
          Copy-constructor.
List(ListItem start, ListItem end)
          Copy-constructor.
List(java.lang.Object[] array, int startindex, int length)
          Constructor receiving the objects to be stored in the List in an array.
 
Method Summary
 ListItem add(java.lang.Object key, java.lang.Object value)
          Appends the specified key-value-pair to the end of the list.
 ListItem findForValue(java.lang.Object value)
          Searches for the first ListItem in this List whose BasicListItem.value() equals value.
 ListItem findForValue(java.lang.Object value, ListItem start)
          Searches the first ListItem in the list beginning from start, whose BasicListItem.value() is equal to the value specified by value.
 ListItem insert(ListItem base, java.lang.Object key, java.lang.Object value)
          Creates a new ListItem containing the key-value-pair specified by key and value and inserts it into the list before base.
 java.lang.String toString()
          Overrides java.lang.Object.toString().
 
Methods inherited from class gishur.core.SimpleList
add, add, add, add, add, add, add, at, bottom, clear, clone, clone, concat, contains, contains, convertKeysToArray, convertValuesToArray, copy, copy, cut, cut, cycle, cycle, cyclicRelative, cyclicRelativeValue, empty, find, find, find, findBigger, findBigger, findClass, findClass, findClass, findSmaller, findSmaller, first, firstKey, firstValue, getDistance, getIndex, getKeyAt, getListView, getValueAt, insert, insert, insert, insert, insert, insert, insert, insert, key, keys, last, lastKey, lastValue, length, max, min, move, move, move, next, next, paste, paste, peek, Peek, pop, Pop, popBoolean, PopBoolean, popDouble, PopDouble, popFloat, PopFloat, popInt, PopInt, popLong, PopLong, prev, prev, push, push, push, push, push, push, Push, relative, remove, remove, reverse, sort, sort, top, value, values
 
Methods inherited from class gishur.core.BasicList
add, add, allowAccess, copy, copy, copy, cut, enumerate, equals, find, findClass, findClosest, getIndex, getListItem, getListItemArray, getListString, move, reconnect, reconnect, remove, requestAccess, reverse, storeInArray, toString, unconnect
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

List

public List()
Empty constructor.

List

public List(BasicList L)
Conversion constructor. Assimilates all elements of BasicList L into this list.
Parameters:
L - BasicList to convert into List

List

public List(ListItem start,
            ListItem end)
Copy-constructor. Pastes a partial list into this list. If the sequence is part of a structure, a copy will normally be created and inserted, thus the source structure will not be changed.
Parameters:
start - the sequence's starting element
end - the last element of the partial list to insert into the new List

List

public List(ListItem start,
            int count)
Copy-constructor. Pastes a partial list into this list. If the sequence is part of a structure, a copy will normally be created and inserted, thus the source structure will not be changed.
Parameters:
start - the sequence's starting element
count - the number of elements to copy

List

public List(java.lang.Object[] array,
            int startindex,
            int length)
Constructor receiving the objects to be stored in the List in an array.
Parameters:
array - the array containing the objects to be stored in the List
startindex - the first element in the array which will be taken into the List
length - number of elements to store
Method Detail

toString

public java.lang.String toString()
Overrides java.lang.Object.toString().
Overrides:
toString in class SimpleList
See Also:
Object.toString()

findForValue

public ListItem findForValue(java.lang.Object value,
                             ListItem start)
Searches the first ListItem in the list beginning from start, whose BasicListItem.value() is equal to the value specified by value.
Parameters:
value - the value-object to search for
start - the ListItem from which the search starts
Returns:
the found ListItem or null, if no such ListItem was found

findForValue

public ListItem findForValue(java.lang.Object value)
Searches for the first ListItem in this List whose BasicListItem.value() equals value.
Parameters:
value - value-object to search for
Returns:
the found ListItem or null, if no such ListItem was found

add

public ListItem add(java.lang.Object key,
                    java.lang.Object value)
Appends the specified key-value-pair to the end of the list. The newly created ListItem containing the arguments is returned.
Parameters:
key - the key to be inserted
value - the value to be inserted
Returns:
a ListItem containing key and value
See Also:
SimpleList.add(ListItem)

insert

public ListItem insert(ListItem base,
                       java.lang.Object key,
                       java.lang.Object value)
Creates a new ListItem containing the key-value-pair specified by key and value and inserts it into the list before base. If base==null, the new ListItem is inserted at the end of the list. If base is not a member of this List, a ListException will be thrown.
Parameters:
base - the position in the list before which the new ListItem shall be inserted
key - the key of the new ListItem
value - the value of the new ListItem
Returns:
inserted ListItem
See Also:
SimpleList.insert(ListItem, ListItem)