net.grinder.common
Class AbstractTestSemantics
java.lang.Object
net.grinder.common.AbstractTestSemantics
- All Implemented Interfaces:
- Comparable<Test>, Test
- Direct Known Subclasses:
- Test
public abstract class AbstractTestSemantics
- extends Object
- implements Test
Base class which provides equality and ordering semantics for
Test implementations.
- Author:
- Philip Aston
AbstractTestSemantics
public AbstractTestSemantics()
compareTo
public final int compareTo(Test o)
- Define ordering.
- Specified by:
compareTo in interface Comparable<Test>
- Parameters:
o - Object to compare.
- Returns:
-1 if o is less, 0
if its equal, 1 if its greater.
hashCode
public final int hashCode()
- Define hash semantics. The test number is used as the hash code.
I wondered whether it was worth distributing the hash codes more
evenly across the range of an int, but using the value is good
enough for
java.lang.Integer so its good enough for
us.
- Overrides:
hashCode in class Object
- Returns:
- The hash code.
equals
public final boolean equals(Object o)
-
- Overrides:
equals in class Object
toString
public final String toString()
-
- Overrides:
toString in class Object
Copyright © 2000-2013. All Rights Reserved.