edu.neu.ccs.demeterf.lib
Class Wrap<X>

java.lang.Object
  extended by edu.neu.ccs.demeterf.lib.Wrap<X>
All Implemented Interfaces:
java.lang.Comparable<Wrap<X>>

public class Wrap<X>
extends java.lang.Object
implements java.lang.Comparable<Wrap<X>>

Wrapping class for Sets, so that the elements are not forced to be Comparable.


Constructor Summary
Wrap(X xx)
          Create a Wrap from a comparable element
Wrap(X xx, java.util.Comparator<X> c)
          Create a Wrap from an element with a comparator
 
Method Summary
 int compareTo(Wrap<X> w)
          Implement the Comparable Interface
 boolean equals(java.lang.Object o)
          Canonical "equals"
 X getX()
          Getter for Wrap.x
 int hashCode()
          Canonical HashCode
 java.lang.String toString()
          Canonical ToString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Wrap

public Wrap(X xx)
Create a Wrap from a comparable element


Wrap

public Wrap(X xx,
            java.util.Comparator<X> c)
Create a Wrap from an element with a comparator

Method Detail

compareTo

public int compareTo(Wrap<X> w)
Implement the Comparable Interface

Specified by:
compareTo in interface java.lang.Comparable<Wrap<X>>

equals

public boolean equals(java.lang.Object o)
Canonical "equals"

Overrides:
equals in class java.lang.Object

getX

public X getX()
Getter for Wrap.x


toString

public java.lang.String toString()
Canonical ToString

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Canonical HashCode

Overrides:
hashCode in class java.lang.Object