public class DiscreteStateHashFactory extends java.lang.Object implements StateHashFactory
Modifier and Type | Class and Description |
---|---|
class |
DiscreteStateHashFactory.DiscreteStateHashTuple |
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,java.util.List<Attribute>> |
attributesForHashCode |
Constructor and Description |
---|
DiscreteStateHashFactory()
Initializes this hashing factory to compute hash codes with all attributes of all object classes.
|
DiscreteStateHashFactory(java.util.Map<java.lang.String,java.util.List<Attribute>> attributesForHashCode)
Initializes this hashing factory to hash on only the attributes for the specified classes in the provided map
|
Modifier and Type | Method and Description |
---|---|
void |
addAttributeForClass(java.lang.String classname,
Attribute att)
Specifies that an additional attribute of the specified class should be used for computing hash codes.
|
StateHashTuple |
hashState(State s) |
void |
setAttributesForClass(java.lang.String classname,
java.util.List<Attribute> atts)
Sets which attributes to use in the hash calculation for the given class.
|
void |
setAttributesForHashCode(java.util.Map<java.lang.String,java.util.List<Attribute>> attributesForHashCode)
Sets this hashing factory to hash on only the attributes for the specified classes in the provided map
|
protected java.util.Map<java.lang.String,java.util.List<Attribute>> attributesForHashCode
public DiscreteStateHashFactory()
public DiscreteStateHashFactory(java.util.Map<java.lang.String,java.util.List<Attribute>> attributesForHashCode)
attributesForHashCode
- a map from object class names to the attributes that should be used in the hash calculation for those object classes.public void setAttributesForHashCode(java.util.Map<java.lang.String,java.util.List<Attribute>> attributesForHashCode)
attributesForHashCode
- a map from object class names to the attributes that should be used in the hash calculation for those object classes.public void setAttributesForClass(java.lang.String classname, java.util.List<Attribute> atts)
classname
- the name of the classatts
- the attributes whose values in object instances should be used to compute hash codespublic void addAttributeForClass(java.lang.String classname, Attribute att)
classname
- the name of the classatt
- the attribute whose values will be included in the computation of hash codespublic StateHashTuple hashState(State s)
hashState
in interface StateHashFactory