maspack.util
Class CountedList<A>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<A>
              extended by maspack.util.CountedList<A>
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<A>, java.util.Collection<A>, java.util.List<A>, java.util.RandomAccess

public class CountedList<A>
extends java.util.ArrayList<A>

See Also:
Serialized Form

Constructor Summary
CountedList()
           
CountedList(int size)
           
 
Method Summary
 boolean add(A val)
           
 void add(int idx, A val)
           
 boolean addAll(java.util.Collection<? extends A> vals)
           
 boolean addAll(int idx, java.util.Collection<? extends A> vals)
           
 int getCount(java.lang.Object obj)
           
 A remove(int idx)
           
 boolean remove(java.lang.Object b)
           
 boolean removeAll(java.util.Collection<?> objs)
           
 boolean retainAll(java.util.Collection<?> objs)
           
 
Methods inherited from class java.util.ArrayList
clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, subList
 

Constructor Detail

CountedList

public CountedList()

CountedList

public CountedList(int size)
Method Detail

add

public boolean add(A val)
Specified by:
add in interface java.util.Collection<A>
Specified by:
add in interface java.util.List<A>
Overrides:
add in class java.util.ArrayList<A>

add

public void add(int idx,
                A val)
Specified by:
add in interface java.util.List<A>
Overrides:
add in class java.util.ArrayList<A>

addAll

public boolean addAll(java.util.Collection<? extends A> vals)
Specified by:
addAll in interface java.util.Collection<A>
Specified by:
addAll in interface java.util.List<A>
Overrides:
addAll in class java.util.ArrayList<A>

addAll

public boolean addAll(int idx,
                      java.util.Collection<? extends A> vals)
Specified by:
addAll in interface java.util.List<A>
Overrides:
addAll in class java.util.ArrayList<A>

remove

public A remove(int idx)
Specified by:
remove in interface java.util.List<A>
Overrides:
remove in class java.util.ArrayList<A>

remove

public boolean remove(java.lang.Object b)
Specified by:
remove in interface java.util.Collection<A>
Specified by:
remove in interface java.util.List<A>
Overrides:
remove in class java.util.ArrayList<A>

removeAll

public boolean removeAll(java.util.Collection<?> objs)
Specified by:
removeAll in interface java.util.Collection<A>
Specified by:
removeAll in interface java.util.List<A>
Overrides:
removeAll in class java.util.AbstractCollection<A>

retainAll

public boolean retainAll(java.util.Collection<?> objs)
Specified by:
retainAll in interface java.util.Collection<A>
Specified by:
retainAll in interface java.util.List<A>
Overrides:
retainAll in class java.util.AbstractCollection<A>

getCount

public int getCount(java.lang.Object obj)