it.unimi.dsi.fastutil.bytes
Class ByteCollections.SynchronizedCollection

java.lang.Object
  extended byit.unimi.dsi.fastutil.bytes.ByteCollections.SynchronizedCollection
All Implemented Interfaces:
ByteCollection, Collection, Serializable
Direct Known Subclasses:
ByteLists.SynchronizedList, ByteSets.SynchronizedSet
Enclosing class:
ByteCollections

public static class ByteCollections.SynchronizedCollection
extends Object
implements ByteCollection, Serializable

A synchronized wrapper class for collections.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
 
Method Summary
 boolean add(byte k)
           
 boolean add(Object k)
           
 boolean addAll(ByteCollection c)
           
 boolean addAll(Collection c)
           
 ByteIterator byteIterator()
          Returns a type-specific iterator on the collection.
 void clear()
           
 boolean contains(byte o)
           
 boolean contains(Object k)
           
 boolean containsAll(ByteCollection c)
           
 boolean containsAll(Collection c)
           
 boolean isEmpty()
           
 Iterator iterator()
           
 boolean rem(byte 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(ByteCollection c)
           
 boolean removeAll(Collection c)
           
 boolean retainAll(ByteCollection c)
           
 boolean retainAll(Collection c)
           
 int size()
           
 Object[] toArray()
           
 byte[] toArray(byte[] a)
          Builds a primitive type array containing the items of this collection.
 Object[] toArray(Object[] a)
           
 byte[] toByteArray()
          Returns a primitive type array containing the items of this collection.
 byte[] toByteArray(byte[] a)
          Builds 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

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection

contains

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

toByteArray

public byte[] toByteArray()
Description copied from interface: ByteCollection
Returns a primitive type array containing the items of this collection.

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

toByteArray

public byte[] toByteArray(byte[] a)
Description copied from interface: ByteCollection
Builds a primitive type array containing the items of this collection.

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

iterator

public Iterator iterator()
Specified by:
iterator in interface Collection

byteIterator

public ByteIterator byteIterator()
Description copied from interface: ByteCollection
Returns a type-specific iterator on the collection.

The iterator returned by the Collection.iterator() method and by this method are identical; however, using this method you can save a type casting.

Specified by:
byteIterator in interface ByteCollection
See Also:
Collection.iterator()

add

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

rem

public boolean rem(byte k)
Description copied from interface: ByteCollection
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 ByteCollection
See Also:
Collection.remove(Object)

remove

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

addAll

public boolean addAll(Collection c)
Specified by:
addAll in interface Collection

containsAll

public boolean containsAll(Collection c)
Specified by:
containsAll in interface Collection

removeAll

public boolean removeAll(Collection c)
Specified by:
removeAll in interface Collection

retainAll

public boolean retainAll(Collection c)
Specified by:
retainAll in interface Collection

addAll

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

containsAll

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

removeAll

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

retainAll

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

clear

public void clear()
Specified by:
clear in interface Collection

toString

public String toString()

add

public boolean add(Object k)
Specified by:
add in interface Collection

contains

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

toArray

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

toArray

public Object[] toArray(Object[] a)
Specified by:
toArray in interface Collection

toArray

public byte[] toArray(byte[] a)
Description copied from interface: ByteCollection
Builds a primitive type array containing the items of this collection.

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