Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jtemporal.util
Class EmptySet  view EmptySet download EmptySet.java

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractSet
          extended byjtemporal.util.EmptySet
All Implemented Interfaces:
java.util.Collection, java.lang.Iterable, java.io.Serializable, java.util.Set

public class EmptySet
extends java.util.AbstractSet
implements java.io.Serializable

Immutable empty read-only set (singleton).
For methods description, see java.util.Set

Version:
$Id$

Field Summary
private static java.lang.Object[] emptyArray
           
private static java.lang.String IMMUTABLE_ERROR
           
private static EmptySet INSTANCE
           
private static long serialVersionUID
           
 
Constructor Summary
private EmptySet()
           
 
Method Summary
 boolean add(java.lang.Object o)
          Adds the specified element to the set if it is not already present (optional operation).
 boolean addAll(java.util.Collection parm1)
          Adds all of the elements of the given collection to this set (optional operation).
 void clear()
          Removes all elements from this set (optional operation).
 boolean contains(java.lang.Object o)
          Returns true if the set contains the specified element.
 boolean containsAll(java.util.Collection parm1)
          Returns true if this set contains all elements in the specified collection.
static EmptySet getInstance()
           
 boolean isEmpty()
          Returns true if the set contains no elements.
 java.util.Iterator iterator()
          Returns an iterator over the set.
private  java.lang.Object readResolve()
          Resolves instances being deserialized to the predefined constant.
 boolean remove(java.lang.Object o)
          Removes the specified element from this set (optional operation).
 int size()
          Returns the number of elements in the set.
 java.lang.Object[] toArray()
          Returns an array containing the elements of this set.
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
retainAll, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
retainAll, toArray
 

Field Detail

INSTANCE

private static final EmptySet INSTANCE

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

IMMUTABLE_ERROR

private static final java.lang.String IMMUTABLE_ERROR
See Also:
Constant Field Values

emptyArray

private static java.lang.Object[] emptyArray
Constructor Detail

EmptySet

private EmptySet()
Method Detail

getInstance

public static EmptySet getInstance()

readResolve

private java.lang.Object readResolve()
                              throws java.io.InvalidObjectException
Resolves instances being deserialized to the predefined constant.


contains

public boolean contains(java.lang.Object o)
Description copied from interface: java.util.Set
Returns true if the set contains the specified element. In other words, this looks for o == null ? e == null : o.equals(e).

Specified by:
contains in interface java.util.Set

remove

public boolean remove(java.lang.Object o)
Description copied from interface: java.util.Set
Removes the specified element from this set (optional operation). If an element e exists, o == null ? e == null : o.equals(e), it is removed from the set.

Specified by:
remove in interface java.util.Set

isEmpty

public boolean isEmpty()
Description copied from interface: java.util.Set
Returns true if the set contains no elements.

Specified by:
isEmpty in interface java.util.Set

add

public boolean add(java.lang.Object o)
Description copied from interface: java.util.Set
Adds the specified element to the set if it is not already present (optional operation). In particular, the comparison algorithm is o == null ? e == null : o.equals(e). Sets need not permit all values, and may document what exceptions will be thrown if a value is not permitted.

Specified by:
add in interface java.util.Set

size

public int size()
Description copied from interface: java.util.Set
Returns the number of elements in the set. If there are more than Integer.MAX_VALUE mappings, return Integer.MAX_VALUE. This is the cardinality of the set.

Specified by:
size in interface java.util.Set

containsAll

public boolean containsAll(java.util.Collection parm1)
Description copied from interface: java.util.Set
Returns true if this set contains all elements in the specified collection. If the argument is also a set, this is the subset relationship.

Specified by:
containsAll in interface java.util.Set

toArray

public java.lang.Object[] toArray()
Description copied from interface: java.util.Set
Returns an array containing the elements of this set. If the set makes a guarantee about iteration order, the array has the same order. The array is distinct from the set; modifying one does not affect the other.

Specified by:
toArray in interface java.util.Set

clear

public void clear()
Description copied from interface: java.util.Set
Removes all elements from this set (optional operation). This set will be empty afterwords, unless an exception occurs.

Specified by:
clear in interface java.util.Set

iterator

public java.util.Iterator iterator()
Description copied from interface: java.util.Set
Returns an iterator over the set. The iterator has no specific order, unless further specified.

Specified by:
iterator in interface java.util.Set

addAll

public boolean addAll(java.util.Collection parm1)
Description copied from interface: java.util.Set
Adds all of the elements of the given collection to this set (optional operation). If the argument is also a Set, this returns the mathematical union of the two. The behavior is unspecified if the set is modified while this is taking place.

Specified by:
addAll in interface java.util.Set