soot.util
Class ArraySet<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by soot.util.ArraySet<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>

public class ArraySet<E>
extends AbstractSet<E>

Provides an implementation of the Set object using java.util.Array


Constructor Summary
ArraySet()
           
ArraySet(E[] elements)
          Create a set which contains the given elements.
ArraySet(int size)
           
 
Method Summary
 boolean add(E e)
           
 boolean addAll(Collection<? extends E> s)
           
 boolean addElement(E e)
          Add an element without checking whether it is already in the set.
 void clear()
           
 boolean contains(Object obj)
           
 Object[] getUnderlyingArray()
           
 Iterator<E> iterator()
           
 int size()
           
 Object[] toArray()
           
<T> T[]
toArray(T[] array)
           
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, remove, retainAll, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
containsAll, isEmpty, remove, retainAll
 

Constructor Detail

ArraySet

public ArraySet(int size)

ArraySet

public ArraySet()

ArraySet

public ArraySet(E[] elements)
Create a set which contains the given elements.

Method Detail

clear

public final void clear()
Specified by:
clear in interface Collection<E>
Specified by:
clear in interface Set<E>
Overrides:
clear in class AbstractCollection<E>

contains

public final boolean contains(Object obj)
Specified by:
contains in interface Collection<E>
Specified by:
contains in interface Set<E>
Overrides:
contains in class AbstractCollection<E>

addElement

public final boolean addElement(E e)
Add an element without checking whether it is already in the set. It is up to the caller to guarantee that it isn't.


add

public final boolean add(E e)
Specified by:
add in interface Collection<E>
Specified by:
add in interface Set<E>
Overrides:
add in class AbstractCollection<E>

addAll

public final boolean addAll(Collection<? extends E> s)
Specified by:
addAll in interface Collection<E>
Specified by:
addAll in interface Set<E>
Overrides:
addAll in class AbstractCollection<E>

size

public final int size()
Specified by:
size in interface Collection<E>
Specified by:
size in interface Set<E>
Specified by:
size in class AbstractCollection<E>

iterator

public final Iterator<E> iterator()
Specified by:
iterator in interface Iterable<E>
Specified by:
iterator in interface Collection<E>
Specified by:
iterator in interface Set<E>
Specified by:
iterator in class AbstractCollection<E>

toArray

public final Object[] toArray()
Specified by:
toArray in interface Collection<E>
Specified by:
toArray in interface Set<E>
Overrides:
toArray in class AbstractCollection<E>

toArray

public final <T> T[] toArray(T[] array)
Specified by:
toArray in interface Collection<E>
Specified by:
toArray in interface Set<E>
Overrides:
toArray in class AbstractCollection<E>

getUnderlyingArray

public final Object[] getUnderlyingArray()