com.samskivert.util
Class HashIntMap.IntKeySet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<Integer>
          extended by com.samskivert.util.HashIntMap.IntKeySet
All Implemented Interfaces:
Interable, IntSet, Iterable<Integer>, Collection<Integer>, Set<Integer>
Enclosing class:
HashIntMap<V>

protected class HashIntMap.IntKeySet
extends AbstractSet<Integer>
implements IntSet


Constructor Summary
protected HashIntMap.IntKeySet()
           
 
Method Summary
 boolean add(int t)
          Adds the specified element to this set if it is not already present (optional operation).
 boolean contains(int t)
          Returns true if this set contains the specified element.
 boolean contains(Object t)
           
 Interator interator()
          Return an Interator over the ints in this object.
 Iterator<Integer> iterator()
           
 boolean remove(int value)
          Removes the specified element from this set if it is present (optional operation).
 boolean remove(Object o)
           
 int size()
           
 int[] toIntArray()
          Returns an array containing all of the elements in this set.
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, containsAll, isEmpty, 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.Set
add, addAll, clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray
 

Constructor Detail

HashIntMap.IntKeySet

protected HashIntMap.IntKeySet()
Method Detail

iterator

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

interator

public Interator interator()
Description copied from interface: Interable
Return an Interator over the ints in this object.

Specified by:
interator in interface Interable
Specified by:
interator in interface IntSet

size

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

contains

public boolean contains(Object t)
Specified by:
contains in interface Collection<Integer>
Specified by:
contains in interface Set<Integer>
Overrides:
contains in class AbstractCollection<Integer>

contains

public boolean contains(int t)
Description copied from interface: IntSet
Returns true if this set contains the specified element.

Specified by:
contains in interface IntSet
Parameters:
t - element whose presence in this set is to be tested.
Returns:
true if this set contains the specified element.

add

public boolean add(int t)
Description copied from interface: IntSet
Adds the specified element to this set if it is not already present (optional operation). If this set already contains the specified element, the call leaves this set unchanged and returns false. In combination with the restriction on constructors, this ensures that sets never contain duplicate elements.

Specified by:
add in interface IntSet
Parameters:
t - element to be added to this set.
Returns:
true if this set did not already contain the specified element.

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<Integer>
Specified by:
remove in interface Set<Integer>
Overrides:
remove in class AbstractCollection<Integer>

remove

public boolean remove(int value)
Description copied from interface: IntSet
Removes the specified element from this set if it is present (optional operation). Returns true if the set contained the specified element (or equivalently, if the set changed as a result of the call). (The set will not contain the specified element once the call returns.)

Specified by:
remove in interface IntSet
Parameters:
value - element to be removed from this set, if present.
Returns:
true if the set contained the specified element.

toIntArray

public int[] toIntArray()
Description copied from interface: IntSet
Returns an array containing all of the elements in this set. Obeys the general contract of the Collection.toArray method.

Specified by:
toIntArray in interface IntSet
Returns:
an array containing all of the elements in this set.


Copyright © 2000-2008 Michael Bayne. All Rights Reserved.