rcf.core.util.groups
Class ImmutablePairSwapAdapter<A,B>

java.lang.Object
  extended by rcf.core.util.adapter.AbstractTypeAdapter<ImmutablePairInterface<A,B>,ImmutablePairInterface<B,A>>
      extended by rcf.core.util.groups.ImmutablePairSwapAdapter<A,B>
Type Parameters:
A - A type argument of the input and output pairs.
B - A type argument of the input and output pairs.
All Implemented Interfaces:
rcf.core.util.adapter.TypeAdapter<ImmutablePairInterface<A,B>,ImmutablePairInterface<B,A>>, rcf.core.util.adapter.TypeAdapterA<ImmutablePairInterface<A,B>,ImmutablePairInterface<B,A>>, rcf.core.util.adapter.TypeAdapterB<ImmutablePairInterface<A,B>,ImmutablePairInterface<B,A>>

@Revision(value="$Revision: 1.3 $",
          date="$Date: 2006/11/14 18:56:27 $",
          tag="$Name:  $")
public class ImmutablePairSwapAdapter<A,B>
extends rcf.core.util.adapter.AbstractTypeAdapter<ImmutablePairInterface<A,B>,ImmutablePairInterface<B,A>>

TODO: Javadoc

TODO: Unit tests, Code review, Javadoc review, Seal/Finalize

Version:
$Revision: 1.3 $
Author:
Greg Gibeling

Field Summary
private static SoftReference<ImmutablePairSwapAdapter> singleton
          TODO: Javadoc The singleton instance of this class.
 
Fields inherited from class rcf.core.util.adapter.AbstractTypeAdapter
adapterInverse
 
Constructor Summary
protected ImmutablePairSwapAdapter()
          Default constructor, protected to enforce singleton instantiation, while still allowing subclassing.
 
Method Summary
 boolean equals(Object o)
           
static
<A,B> ImmutablePairSwapAdapter<A,B>
getImmutablePairSwapAdapter()
          TODO: Javadoc Get the singleton instance of this class.
 int hashCode()
           
 ImmutablePairInterface<B,A> mapA(ImmutablePairInterface<A,B> a)
           
 ImmutablePairInterface<A,B> mapB(ImmutablePairInterface<B,A> b)
           
 String toString()
           
 
Methods inherited from class rcf.core.util.adapter.AbstractTypeAdapter
typeAdapterInverse
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

singleton

private static SoftReference<ImmutablePairSwapAdapter> singleton
TODO: Javadoc The singleton instance of this class.

Constructor Detail

ImmutablePairSwapAdapter

protected ImmutablePairSwapAdapter()
Default constructor, protected to enforce singleton instantiation, while still allowing subclassing.

See Also:
getImmutablePairSwapAdapter()
Method Detail

getImmutablePairSwapAdapter

public static final <A,B> ImmutablePairSwapAdapter<A,B> getImmutablePairSwapAdapter()
TODO: Javadoc Get the singleton instance of this class.

Returns:
The singleton instance of this class.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

mapA

public ImmutablePairInterface<B,A> mapA(ImmutablePairInterface<A,B> a)

mapB

public ImmutablePairInterface<A,B> mapB(ImmutablePairInterface<B,A> b)

toString

public String toString()
Overrides:
toString in class Object