org.sourceforge.jemm.database.collections
Class SampleValue

java.lang.Object
  extended by org.sourceforge.jemm.database.collections.SampleValue
All Implemented Interfaces:
java.io.Serializable

public class SampleValue
extends java.lang.Object
implements java.io.Serializable

A test value that allows the hashcode and equals comparison value to be set. This is used to test the behaviour of collections who use hashcodes to perform internal comparisons.

Author:
Rory Graves
See Also:
Serialized Form

Constructor Summary
SampleValue(int hashValue, int compareValue)
          Creates a SampleValue with the given hashcode and comparison values.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SampleValue

public SampleValue(int hashValue,
                   int compareValue)
Creates a SampleValue with the given hashcode and comparison values.

Parameters:
hashValue - The value to return to .hashCode() calls.
compareValue - The comparison value to use for .equals() calls.
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009. All Rights Reserved.