Package org.drools.core.common
Class EqualityKey
- java.lang.Object
-
- org.drools.core.util.LinkedList<DefaultFactHandle>
-
- org.drools.core.common.EqualityKey
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
public abstract class EqualityKey extends LinkedList<DefaultFactHandle> implements java.io.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<K extends Entry<K>>, LinkedList.LinkedListIterator<T extends LinkedListNode<T>>
-
-
Field Summary
Fields Modifier and Type Field Description static int
JUSTIFIED
static int
STATED
-
Fields inherited from class org.drools.core.util.LinkedList
fastIterator
-
-
Constructor Summary
Constructors Constructor Description EqualityKey()
EqualityKey(InternalFactHandle handle)
EqualityKey(InternalFactHandle handle, int status)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addFactHandle(InternalFactHandle handle)
boolean
equals(java.lang.Object object)
Equality for the EqualityKey means two things.InternalFactHandle
getFactHandle()
abstract InternalFactHandle
getLogicalFactHandle()
int
getStatus()
int
hashCode()
Returns the cached hashCodevoid
readExternal(java.io.ObjectInput in)
void
removeFactHandle(InternalFactHandle handle)
abstract void
setLogicalFactHandle(InternalFactHandle logicalFactHandle)
void
setStatus(int status)
java.lang.String
toString()
void
writeExternal(java.io.ObjectOutput out)
-
Methods inherited from class org.drools.core.util.LinkedList
add, addFirst, addLast, clear, contains, fastIterator, get, getFirst, getLast, insertAfter, isEmpty, iterator, javaUtilIterator, remove, removeFirst, removeLast, size
-
-
-
-
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(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
- Specified by:
readExternal
in interfacejava.io.Externalizable
- Overrides:
readExternal
in classLinkedList<DefaultFactHandle>
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Overrides:
writeExternal
in classLinkedList<DefaultFactHandle>
- Throws:
java.io.IOException
-
getLogicalFactHandle
public abstract InternalFactHandle getLogicalFactHandle()
-
setLogicalFactHandle
public abstract void setLogicalFactHandle(InternalFactHandle logicalFactHandle)
-
getFactHandle
public InternalFactHandle getFactHandle()
-
addFactHandle
public void addFactHandle(InternalFactHandle handle)
-
removeFactHandle
public void removeFactHandle(InternalFactHandle handle)
-
getStatus
public int getStatus()
- Returns:
- the status
-
setStatus
public void setStatus(int status)
- Parameters:
status
- the status to set
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
Returns the cached hashCode- Overrides:
hashCode
in classLinkedList<DefaultFactHandle>
- See Also:
Object.hashCode()
-
equals
public boolean equals(java.lang.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 classLinkedList<DefaultFactHandle>
-
-