com.phoenixst.collections
Class UnorderedPair
java.lang.Object
java.util.AbstractCollection
com.phoenixst.collections.AbstractUnmodifiableCollection
com.phoenixst.collections.UnorderedPair
- All Implemented Interfaces:
- Serializable, Iterable, Collection
public class UnorderedPair
- extends AbstractUnmodifiableCollection
- implements Serializable
A simple mutable unordered pair implementation. The individual
elements may be changed, but the size of this implementation
cannot. For convenience, the elements are referred to as
"first" and "second", but this has no effect
on .equals()
.
- Since:
- 1.0
- Version:
- $Revision: 1.4 $
- Author:
- Ray A. Conner
- See Also:
- Serialized Form
UnorderedPair
public UnorderedPair()
UnorderedPair
public UnorderedPair(Object first,
Object second)
getFirst
public Object getFirst()
setFirst
public void setFirst(Object first)
getSecond
public Object getSecond()
setSecond
public void setSecond(Object second)
size
public int size()
- Description copied from class:
AbstractUnmodifiableCollection
- This implementation counts the number of elements accessed by
the
Iterator
.
- Specified by:
size
in interface Collection
- Overrides:
size
in class AbstractUnmodifiableCollection
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface Collection
- Overrides:
isEmpty
in class AbstractCollection
contains
public boolean contains(Object object)
- Specified by:
contains
in interface Collection
- Overrides:
contains
in class AbstractCollection
iterator
public Iterator iterator()
- Specified by:
iterator
in interface Iterable
- Specified by:
iterator
in interface Collection
- Specified by:
iterator
in class AbstractCollection
toArray
public Object[] toArray()
- Specified by:
toArray
in interface Collection
- Overrides:
toArray
in class AbstractCollection
equals
public boolean equals(Object object)
- To conform to the contracts for
Set
,
List
, and other potential types of
Collections
, instances of this class can only be
.equals()
to other instances of this class.
- Specified by:
equals
in interface Collection
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Specified by:
hashCode
in interface Collection
- Overrides:
hashCode
in class Object
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.