com.devexperts.util
Class AbstractLongSet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<Long>
          extended by com.devexperts.util.AbstractLongSet
All Implemented Interfaces:
LongCollection, LongSet, Iterable<Long>, Collection<Long>, Set<Long>
Direct Known Subclasses:
LongHashSet

public abstract class AbstractLongSet
extends AbstractSet<Long>
implements LongSet

This class provides a skeletal implementation of the LongSet interface, to minimize the effort required to implement this interface.

See Also:
AbstractSet

Constructor Summary
AbstractLongSet()
           
 
Method Summary
 boolean add(long key)
          Ensures that this collection contains the specified element.
 boolean add(Long o)
           
 boolean addAll(Collection<? extends Long> c)
          Adds all of the elements in the specified collection to this set.
abstract  void clear()
           
abstract  boolean contains(long key)
          Returns true if this collection contains the specified element.
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
          Returns true if this set contains all of the elements in the specified collection.
 Iterator<Long> iterator()
          Returns the same value as longIterator() does.
abstract  LongIterator longIterator()
          Returns an iterator over the elements in this collection.
abstract  boolean remove(long key)
          Removes a single instance of the specified element from this collection, if it is present.
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
          Removes from this set all of its elements that are contained in the specified collection.
 boolean retainAll(Collection<?> c)
          Retains only the elements in this set that are contained in the specified collection.
abstract  int size()
           
 long[] toLongArray()
          Returns an array containing all of the elements in this collection.
 
Methods inherited from class java.util.AbstractSet
equals, hashCode
 
Methods inherited from class java.util.AbstractCollection
isEmpty, 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
equals, hashCode, isEmpty, toArray, toArray
 

Constructor Detail

AbstractLongSet

public AbstractLongSet()
Method Detail

size

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

clear

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

contains

public abstract boolean contains(long key)
Description copied from interface: LongCollection
Returns true if this collection contains the specified element.

Specified by:
contains in interface LongCollection
See Also:
Collection.contains(Object)

remove

public abstract boolean remove(long key)
Description copied from interface: LongCollection
Removes a single instance of the specified element from this collection, if it is present.

Specified by:
remove in interface LongCollection
See Also:
Collection.remove(Object)

longIterator

public abstract LongIterator longIterator()
Description copied from interface: LongCollection
Returns an iterator over the elements in this collection.

Specified by:
longIterator in interface LongCollection
See Also:
Collection.iterator()

containsAll

public final boolean containsAll(Collection<?> c)
Returns true if this set contains all of the elements in the specified collection.

Specified by:
containsAll in interface Collection<Long>
Specified by:
containsAll in interface Set<Long>
Overrides:
containsAll in class AbstractCollection<Long>
See Also:
Collection.containsAll(Collection)

addAll

public final boolean addAll(Collection<? extends Long> c)
Adds all of the elements in the specified collection to this set.

Specified by:
addAll in interface Collection<Long>
Specified by:
addAll in interface Set<Long>
Overrides:
addAll in class AbstractCollection<Long>
See Also:
Collection.addAll(Collection)

removeAll

public final boolean removeAll(Collection<?> c)
Removes from this set all of its elements that are contained in the specified collection.

Specified by:
removeAll in interface Collection<Long>
Specified by:
removeAll in interface Set<Long>
Overrides:
removeAll in class AbstractSet<Long>
See Also:
Collection.removeAll(Collection)

retainAll

public final boolean retainAll(Collection<?> c)
Retains only the elements in this set that are contained in the specified collection.

Specified by:
retainAll in interface Collection<Long>
Specified by:
retainAll in interface Set<Long>
Overrides:
retainAll in class AbstractCollection<Long>
See Also:
Collection.retainAll(Collection)

add

public boolean add(long key)
Description copied from interface: LongCollection
Ensures that this collection contains the specified element.

Specified by:
add in interface LongCollection
See Also:
Collection.add(Object)

contains

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

iterator

public final Iterator<Long> iterator()
Returns the same value as longIterator() does.

Specified by:
iterator in interface Iterable<Long>
Specified by:
iterator in interface Collection<Long>
Specified by:
iterator in interface Set<Long>
Specified by:
iterator in class AbstractCollection<Long>

add

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

remove

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

toLongArray

public long[] toLongArray()
Description copied from interface: LongCollection
Returns an array containing all of the elements in this collection.

Specified by:
toLongArray in interface LongCollection
See Also:
Collection.toArray()


Copyright © 2013 Devexperts. All Rights Reserved.