Plexus v0.13.1

com.phoenixst.collections
Class AbstractSingletonCollection

java.lang.Object
  extended by com.phoenixst.collections.AbstractSingletonCollection
All Implemented Interfaces:
Iterable, Collection
Direct Known Subclasses:
SingletonEdgeCollection, SingletonNodeCollection

public abstract class AbstractSingletonCollection
extends Object
implements Collection

A modifiable, lazy singleton Collection view. This view may be empty at any given point in time.

Since:
1.0
Version:
$Revision: 1.11 $
Author:
Ray A. Conner

Constructor Summary
protected AbstractSingletonCollection(Object element)
          Creates a new AbstractSingletonCollection.
 
Method Summary
 boolean add(Object object)
          Throws an UnsupportedOperationException.
 boolean addAll(Collection collection)
          Throws an UnsupportedOperationException.
 void clear()
           
 boolean contains(Object object)
           
 boolean containsAll(Collection collection)
           
protected  Object getElement()
           
abstract  boolean isEmpty()
           
 Iterator iterator()
           
 boolean remove(Object object)
           
 boolean removeAll(Collection collection)
           
protected abstract  boolean removeElement()
           
 boolean retainAll(Collection collection)
           
 int size()
           
 Object[] toArray()
           
 Object[] toArray(Object[] array)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

AbstractSingletonCollection

protected AbstractSingletonCollection(Object element)
Creates a new AbstractSingletonCollection.

Method Detail

getElement

protected final Object getElement()

removeElement

protected abstract boolean removeElement()

isEmpty

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

size

public int size()
Specified by:
size in interface Collection

add

public boolean add(Object object)
Throws an UnsupportedOperationException.

Specified by:
add in interface Collection

remove

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

contains

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

iterator

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

containsAll

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

addAll

public boolean addAll(Collection collection)
Throws an UnsupportedOperationException.

Specified by:
addAll in interface Collection

removeAll

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

retainAll

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

clear

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

toArray

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

toArray

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

toString

public String toString()
Overrides:
toString in class Object

Plexus v0.13.1

See the Plexus project home, hosted by SourceForge.
Copyright ? 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.