TUM CCSM Commons

edu.tum.cs.commons.collections
Class Pair<S,T>

java.lang.Object
  extended by edu.tum.cs.commons.collections.ImmutablePair<S,T>
      extended by edu.tum.cs.commons.collections.Pair<S,T>
All Implemented Interfaces:
IDeepCloneable, java.lang.Cloneable, java.lang.Comparable<ImmutablePair<S,T>>

public class Pair<S,T>
extends ImmutablePair<S,T>

Simple pair class.

Version:
$Rev: 26283 $
Author:
hummelb, $Author: juergens $
Rating:
GREEN Hash: 78B8598462B008191EA7B36314D99571

Field Summary
 
Fields inherited from class edu.tum.cs.commons.collections.ImmutablePair
first, second
 
Constructor Summary
Pair(ImmutablePair<S,T> p)
          Copy constructor.
Pair(S first, T second)
          Constructor.
 
Method Summary
protected  Pair<S,T> clone()
          
 Pair<S,T> deepClone()
          Deep clone of this object.
static Pair<java.lang.Integer,java.lang.Integer> parseIntPair(java.lang.String string)
          Converts a string comma separated integers to a pair of Integers.
 void setFirst(S first)
          Set the first value.
 void setSecond(T second)
          Set the second value.
 
Methods inherited from class edu.tum.cs.commons.collections.ImmutablePair
compareTo, equals, getFirst, getSecond, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pair

public Pair(S first,
            T second)
Constructor.


Pair

public Pair(ImmutablePair<S,T> p)
Copy constructor.

Method Detail

setFirst

public void setFirst(S first)
Set the first value.


setSecond

public void setSecond(T second)
Set the second value.


clone

protected Pair<S,T> clone()

Overrides:
clone in class ImmutablePair<S,T>

deepClone

public Pair<S,T> deepClone()
                    throws DeepCloneException
Deep clone of this object.

Specified by:
deepClone in interface IDeepCloneable
Overrides:
deepClone in class ImmutablePair<S,T>
Throws:
DeepCloneException - if problems during cloning occured.

parseIntPair

public static Pair<java.lang.Integer,java.lang.Integer> parseIntPair(java.lang.String string)
Converts a string comma separated integers to a pair of Integers.

Throws:
java.lang.NumberFormatException - if the format does not match

TUM CCSM Commons

TUM CCSM Commons - 2.7