it.unimi.dsi.fastutil.longs
Class LongCollections.UnmodifiableCollection

java.lang.Object
  extended by it.unimi.dsi.fastutil.longs.LongCollections.UnmodifiableCollection
All Implemented Interfaces:
LongCollection, LongIterable, Serializable, Iterable<Long>, Collection<Long>
Direct Known Subclasses:
LongLists.UnmodifiableList, LongSets.UnmodifiableSet
Enclosing class:
LongCollections

public static class LongCollections.UnmodifiableCollection
extends Object
implements LongCollection, Serializable

An unmodifiable wrapper class for collections.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
 
Method Summary
 boolean add(long k)
           
 boolean add(Long k)
           
 boolean addAll(Collection<? extends Long> c)
           
 boolean addAll(LongCollection c)
           
 void clear()
           
 boolean contains(long o)
           
 boolean contains(Object k)
           
 boolean containsAll(Collection<?> c)
           
 boolean containsAll(LongCollection c)
           
 boolean isEmpty()
           
 LongIterator iterator()
          Returns a type-specific iterator on the elements of this collection.
 LongIterator longIterator()
          Deprecated. 
 boolean rem(long k)
          Note that this method should be called remove(), but the clash with the similarly named index-based method in the List interface forces us to use a distinguished name.
 boolean remove(Object ok)
           
 boolean removeAll(Collection<?> c)
           
 boolean removeAll(LongCollection c)
           
 boolean retainAll(Collection<?> c)
           
 boolean retainAll(LongCollection c)
           
 int size()
           
 Object[] toArray()
           
 long[] toArray(long[] a)
          Returns a primitive type array containing the items of this collection.
<T> T[]
toArray(T[] a)
          Returns an containing the items of this collection; the runtime type of the returned array is that of the specified array.
 long[] toLongArray()
          Returns a primitive type array containing the items of this collection.
 long[] toLongArray(long[] a)
          Returns a primitive type array containing the items of this collection.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Method Detail

size

public int size()
Specified by:
size in interface Collection<Long>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<Long>

contains

public boolean contains(long o)
Specified by:
contains in interface LongCollection
See Also:
Collection.contains(Object)

iterator

public LongIterator iterator()
Description copied from interface: LongCollection
Returns a type-specific iterator on the elements of this collection.

Note that this specification strengthens the one given in Iterable.iterator(), which was already strengthened in the corresponding type-specific class, but was weakened by the fact that this interface extends Collection.

Specified by:
iterator in interface LongCollection
Specified by:
iterator in interface LongIterable
Specified by:
iterator in interface Iterable<Long>
Specified by:
iterator in interface Collection<Long>
Returns:
a type-specific iterator on the elements of this collection.

longIterator

@Deprecated
public LongIterator longIterator()
Deprecated. 

Description copied from interface: LongCollection
Returns a type-specific iterator on this elements of this collection.

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

add

public boolean add(long k)
Specified by:
add in interface LongCollection
See Also:
Collection.add(Object)

remove

public boolean remove(Object ok)
Specified by:
remove in interface Collection<Long>

addAll

public boolean addAll(Collection<? extends Long> c)
Specified by:
addAll in interface Collection<Long>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<Long>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<Long>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<Long>

clear

public void clear()
Specified by:
clear in interface Collection<Long>

toString

public String toString()
Overrides:
toString in class Object

toArray

public <T> T[] toArray(T[] a)
Description copied from interface: LongCollection
Returns an containing the items of this collection; the runtime type of the returned array is that of the specified array.

Warning: Note that, contrarily to Collection.toArray(Object[]), this methods just writes all elements of this collection: no special value will be added after the last one.

Specified by:
toArray in interface LongCollection
Specified by:
toArray in interface Collection<Long>
Parameters:
a - if this array is big enough, it will be used to store this collection.
Returns:
a primitive type array containing the items of this collection.
See Also:
Collection.toArray(Object[])

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<Long>

toLongArray

public long[] toLongArray()
Description copied from interface: LongCollection
Returns a primitive type array containing the items of this collection.

Specified by:
toLongArray in interface LongCollection
Returns:
a primitive type array containing the items of this collection.
See Also:
Collection.toArray()

toLongArray

public long[] toLongArray(long[] a)
Description copied from interface: LongCollection
Returns a primitive type array containing the items of this collection.

Note that, contrarily to Collection.toArray(Object[]), this methods just writes all elements of this collection: no special value will be added after the last one.

Specified by:
toLongArray in interface LongCollection
Parameters:
a - if this array is big enough, it will be used to store this collection.
Returns:
a primitive type array containing the items of this collection.
See Also:
Collection.toArray(Object[])

toArray

public long[] toArray(long[] a)
Description copied from interface: LongCollection
Returns a primitive type array containing the items of this collection.

Note that, contrarily to Collection.toArray(Object[]), this methods just writes all elements of this collection: no special value will be added after the last one.

Specified by:
toArray in interface LongCollection
Parameters:
a - if this array is big enough, it will be used to store this collection.
Returns:
a primitive type array containing the items of this collection.
See Also:
Collection.toArray(Object[])

rem

public boolean rem(long k)
Description copied from interface: LongCollection
Note that this method should be called remove(), but the clash with the similarly named index-based method in the List interface forces us to use a distinguished name. For simplicity, the set interfaces reinstates remove().

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

addAll

public boolean addAll(LongCollection c)
Specified by:
addAll in interface LongCollection
See Also:
Collection.addAll(Collection)

containsAll

public boolean containsAll(LongCollection c)
Specified by:
containsAll in interface LongCollection
See Also:
Collection.containsAll(Collection)

removeAll

public boolean removeAll(LongCollection c)
Specified by:
removeAll in interface LongCollection
See Also:
Collection.removeAll(Collection)

retainAll

public boolean retainAll(LongCollection c)
Specified by:
retainAll in interface LongCollection
See Also:
Collection.retainAll(Collection)

add

public boolean add(Long k)
Specified by:
add in interface Collection<Long>

contains

public boolean contains(Object k)
Specified by:
contains in interface Collection<Long>