source.ucregents.playground.physics
Class Pair<E>

java.lang.Object
  extended by 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]


Field Summary
 E element1
           
 E element2
           
 
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
 

Field Detail

element1

public E element1

element2

public E element2
Constructor Detail

Pair

public Pair(E obj1,
            E obj2)
The basic pair consructor

Parameters:
obj1 - The first object
obj2 - The second object
Method Detail

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