source.ucregents.playground.physics
Class Pair<E>
java.lang.Object
source.ucregents.playground.physics.Pair<E>
- Type Parameters:
E
- The Class of the objects to store
public class Pair<E>
- extends java.lang.Object
Pair can contain any two objects. The main purpose is the equals method, which ignores the order of the objects in the pair. ie [1,2] == [2,1]
Constructor Summary |
Pair(E obj1,
E obj2)
The basic pair consructor |
Method Summary |
boolean |
equals(java.lang.Object pair2)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
element1
public E element1
element2
public E element2
Pair
public Pair(E obj1,
E obj2)
- The basic pair consructor
- Parameters:
obj1
- The first objectobj2
- The second object
equals
public boolean equals(java.lang.Object pair2)
- Overrides:
equals
in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object