ahc.collection
Class GenericCollection

java.lang.Object
  |
  +--ahc.collection.GenericCollection
All Implemented Interfaces:
Collection, java.util.Collection, java.util.List, List, Set, java.util.Set

public class GenericCollection
extends java.lang.Object
implements List, Set

This is the generic, configurable implementation of both List and Set.

Author:
Arno Haase

Constructor Summary
GenericCollection(Store store, AccessStrategy accessStrategy)
           
 
Method Summary
 void add(int index, java.lang.Object element)
           
 boolean add(java.lang.Object o)
           
 boolean addAll(java.util.Collection c)
           
 boolean addAll(int index, java.util.Collection c)
           
 Iterator after()
           
 boolean append(java.lang.Object o)
           
 Iterator before()
           
 Iterator begin()
           
 void clear()
           
 boolean contains(java.lang.Object o)
           
 boolean containsAll(java.util.Collection c)
           
 Iterator end()
           
 Iterator first(java.lang.Object o)
           
 int firstIndexOf(java.lang.Object o)
           
 java.lang.Object get(int index)
           
 int indexOf(java.lang.Object o)
           
 boolean isEmpty()
           
 Iterator iter(int index)
           
 java.util.Iterator iterator()
           
 Iterator last(java.lang.Object o)
           
 int lastIndexOf(java.lang.Object o)
           
 java.util.ListIterator listIterator()
           
 java.util.ListIterator listIterator(int index)
           
 boolean prepend(java.lang.Object o)
           
 java.lang.Object remove(int index)
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection c)
           
 boolean retainAll(java.util.Collection c)
           
 java.lang.Object set(int index, java.lang.Object element)
           
 int size()
           
 java.util.List subList(int fromIndex, int toIndex)
           
 java.lang.Object[] toArray()
           
 java.lang.Object[] toArray(java.lang.Object[] a)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 
Methods inherited from interface java.util.List
equals, hashCode
 
Methods inherited from interface java.util.Set
equals, hashCode
 

Constructor Detail

GenericCollection

public GenericCollection(Store store,
                         AccessStrategy accessStrategy)
Method Detail

size

public int size()
Specified by:
size in interface java.util.Collection

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.Collection

containsAll

public boolean containsAll(java.util.Collection c)
Specified by:
containsAll in interface java.util.Collection

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection

toArray

public java.lang.Object[] toArray(java.lang.Object[] a)
Specified by:
toArray in interface java.util.Collection

get

public java.lang.Object get(int index)
Specified by:
get in interface java.util.List

indexOf

public int indexOf(java.lang.Object o)
Specified by:
indexOf in interface java.util.List

firstIndexOf

public int firstIndexOf(java.lang.Object o)
Specified by:
firstIndexOf in interface List

lastIndexOf

public int lastIndexOf(java.lang.Object o)
Specified by:
lastIndexOf in interface java.util.List

add

public boolean add(java.lang.Object o)
Specified by:
add in interface java.util.Collection

addAll

public boolean addAll(java.util.Collection c)
Specified by:
addAll in interface java.util.Collection

add

public void add(int index,
                java.lang.Object element)
Specified by:
add in interface java.util.List

addAll

public boolean addAll(int index,
                      java.util.Collection c)
Specified by:
addAll in interface java.util.List

prepend

public boolean prepend(java.lang.Object o)
Specified by:
prepend in interface List

append

public boolean append(java.lang.Object o)
Specified by:
append in interface List

set

public java.lang.Object set(int index,
                            java.lang.Object element)
Specified by:
set in interface java.util.List

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection

remove

public java.lang.Object remove(int index)
Specified by:
remove in interface java.util.List

removeAll

public boolean removeAll(java.util.Collection c)
Specified by:
removeAll in interface java.util.Collection

retainAll

public boolean retainAll(java.util.Collection c)
Specified by:
retainAll in interface java.util.Collection

clear

public void clear()
Specified by:
clear in interface java.util.Collection

before

public Iterator before()
Specified by:
before in interface Collection

begin

public Iterator begin()
Specified by:
begin in interface Collection

end

public Iterator end()
Specified by:
end in interface List

after

public Iterator after()
Specified by:
after in interface List

iter

public Iterator iter(int index)
Specified by:
iter in interface List

first

public Iterator first(java.lang.Object o)
Specified by:
first in interface List

last

public Iterator last(java.lang.Object o)
Specified by:
last in interface List

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.util.Collection

listIterator

public java.util.ListIterator listIterator()
Specified by:
listIterator in interface java.util.List

listIterator

public java.util.ListIterator listIterator(int index)
Specified by:
listIterator in interface java.util.List

subList

public java.util.List subList(int fromIndex,
                              int toIndex)
Specified by:
subList in interface java.util.List

toString

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