Drools :: Core 6.1.0.Beta1

org.drools.core.common
Class EqualityKey

java.lang.Object
  extended by org.drools.core.util.LinkedList<DefaultFactHandle>
      extended by org.drools.core.common.EqualityKey
All Implemented Interfaces:
Externalizable, Serializable

public class EqualityKey
extends LinkedList<DefaultFactHandle>
implements Externalizable

Upon instantiation the EqualityKey caches the first Object's hashCode this can never change. The EqualityKey has an internal datastructure which references all the handles which are equal. It also records Whether the referenced facts are JUSTIFIED or STATED

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.drools.core.util.LinkedList
LinkedList.JavaUtilIterator<T extends LinkedListNode<T>>, LinkedList.LinkedListFastIterator, LinkedList.LinkedListIterator<T extends LinkedListNode<T>>
 
Field Summary
static int JUSTIFIED
           
static int STATED
           
 
Fields inherited from class org.drools.core.util.LinkedList
fastIterator
 
Constructor Summary
EqualityKey()
           
EqualityKey(InternalFactHandle handle)
           
EqualityKey(InternalFactHandle handle, int status)
           
 
Method Summary
 void addFactHandle(InternalFactHandle handle)
           
 boolean equals(Object object)
          Equality for the EqualityKey means two things.
 BeliefSet getBeliefSet()
           
 InternalFactHandle getFactHandle()
           
 int getStatus()
           
 int hashCode()
          Returns the cached hashCode
 void readExternal(ObjectInput in)
           
 void removeFactHandle(InternalFactHandle handle)
           
 void setBeliefSet(BeliefSet beliefSet)
           
 void setStatus(int status)
           
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class org.drools.core.util.LinkedList
add, addFirst, addLast, clear, fastIterator, get, getFirst, getLast, insertAfter, isEmpty, iterator, javaUtilIterator, remove, removeFirst, removeLast, size
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

STATED

public static final int STATED
See Also:
Constant Field Values

JUSTIFIED

public static final int JUSTIFIED
See Also:
Constant Field Values
Constructor Detail

EqualityKey

public EqualityKey()

EqualityKey

public EqualityKey(InternalFactHandle handle)

EqualityKey

public EqualityKey(InternalFactHandle handle,
                   int status)
Method Detail

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class LinkedList<DefaultFactHandle>
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class LinkedList<DefaultFactHandle>
Throws:
IOException

getFactHandle

public InternalFactHandle getFactHandle()

addFactHandle

public void addFactHandle(InternalFactHandle handle)

removeFactHandle

public void removeFactHandle(InternalFactHandle handle)

getStatus

public int getStatus()
Returns:
the status

getBeliefSet

public BeliefSet getBeliefSet()

setBeliefSet

public void setBeliefSet(BeliefSet beliefSet)

setStatus

public void setStatus(int status)
Parameters:
status - the status to set

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Returns the cached hashCode

Overrides:
hashCode in class LinkedList<DefaultFactHandle>
See Also:
Object.hashCode()

equals

public boolean equals(Object object)
Equality for the EqualityKey means two things. It returns true if the object is also an EqualityKey the of the same the same identity as this. It also returns true if the object is equal to the head FactHandle's referenced Object.

Overrides:
equals in class LinkedList<DefaultFactHandle>

Drools :: Core 6.1.0.Beta1

Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.