Package org.drools.core.facttemplates
Class FactImpl
- java.lang.Object
-
- org.drools.core.facttemplates.FactImpl
-
- All Implemented Interfaces:
Externalizable,Serializable,Fact
public class FactImpl extends Object implements Fact, Externalizable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FactImpl()FactImpl(FactTemplate template, long id)FactImpl(FactTemplate template, Object[] values, long id)this is the default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object object)longgetFactId()Return the long factIdFactTemplategetFactTemplate()Return the deftemplate for the factObjectgetFieldValue(int index)Method returns the value of the given slot at the id.ObjectgetFieldValue(String name)inthashCode()voidreadExternal(ObjectInput in)protected voidresetId(Fact fact)this is used to reset the id, in the event an user tries to assert the same fact again, we reset the id to the existing one.voidsetFieldValue(int index, Object value)voidsetFieldValue(String name, Object value)voidwriteExternal(ObjectOutput out)
-
-
-
Constructor Detail
-
FactImpl
public FactImpl()
-
FactImpl
public FactImpl(FactTemplate template, Object[] values, long id)
this is the default constructor- Parameters:
instance-values-
-
FactImpl
public FactImpl(FactTemplate template, long id)
-
-
Method Detail
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
getFieldValue
public Object getFieldValue(int index)
Method returns the value of the given slot at the id.- Specified by:
getFieldValuein interfaceFact- Parameters:
id-- Returns:
-
getFieldValue
public Object getFieldValue(String name)
- Specified by:
getFieldValuein interfaceFact
-
setFieldValue
public void setFieldValue(String name, Object value)
- Specified by:
setFieldValuein interfaceFact
-
setFieldValue
public void setFieldValue(int index, Object value)- Specified by:
setFieldValuein interfaceFact
-
getFactId
public long getFactId()
Return the long factId
-
resetId
protected void resetId(Fact fact)
this is used to reset the id, in the event an user tries to assert the same fact again, we reset the id to the existing one.- Parameters:
fact-
-
getFactTemplate
public FactTemplate getFactTemplate()
Return the deftemplate for the fact- Specified by:
getFactTemplatein interfaceFact- Returns:
-
-