org.jscience.util
Class Bag

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList
          extended by org.jscience.util.Bag
All Implemented Interfaces:
java.lang.Iterable, java.util.Collection, java.util.List

public class Bag
extends java.util.AbstractList

A class representing a bag data structure (a list that does not permit null).


Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Bag()
          Creates a new Bag object.
 
Method Summary
 void add(int index, java.lang.Object element)
          DOCUMENT ME!
 boolean add(java.lang.Object o)
          DOCUMENT ME!
 boolean addAll(int index, java.util.Collection c)
          DOCUMENT ME!
 java.lang.Object get(int index)
          DOCUMENT ME!
 java.lang.Object remove(int index)
          DOCUMENT ME!
 java.lang.Object set(int index, java.lang.Object element)
          DOCUMENT ME!
 int size()
          DOCUMENT ME!
 
Methods inherited from class java.util.AbstractList
clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

Bag

public Bag()
Creates a new Bag object.

Method Detail

add

public void add(int index,
                java.lang.Object element)
DOCUMENT ME!

Specified by:
add in interface java.util.List
Overrides:
add in class java.util.AbstractList
Parameters:
index - DOCUMENT ME!
element - DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

add

public boolean add(java.lang.Object o)
DOCUMENT ME!

Specified by:
add in interface java.util.Collection
Specified by:
add in interface java.util.List
Overrides:
add in class java.util.AbstractList
Parameters:
o - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

addAll

public boolean addAll(int index,
                      java.util.Collection c)
DOCUMENT ME!

Specified by:
addAll in interface java.util.List
Overrides:
addAll in class java.util.AbstractList
Parameters:
index - DOCUMENT ME!
c - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

remove

public java.lang.Object remove(int index)
DOCUMENT ME!

Specified by:
remove in interface java.util.List
Overrides:
remove in class java.util.AbstractList
Parameters:
index - DOCUMENT ME!
Returns:
DOCUMENT ME!

set

public java.lang.Object set(int index,
                            java.lang.Object element)
DOCUMENT ME!

Specified by:
set in interface java.util.List
Overrides:
set in class java.util.AbstractList
Parameters:
index - DOCUMENT ME!
element - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

get

public java.lang.Object get(int index)
DOCUMENT ME!

Specified by:
get in interface java.util.List
Specified by:
get in class java.util.AbstractList
Parameters:
index - DOCUMENT ME!
Returns:
DOCUMENT ME!

size

public int size()
DOCUMENT ME!

Specified by:
size in interface java.util.Collection
Specified by:
size in interface java.util.List
Specified by:
size in class java.util.AbstractCollection
Returns:
DOCUMENT ME!