Package org.drools.core.facttemplates
Class FactTemplateImpl
- java.lang.Object
-
- org.drools.core.facttemplates.FactTemplateImpl
-
- All Implemented Interfaces:
Externalizable,Serializable,FactTemplate
public class FactTemplateImpl extends Object implements FactTemplate
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FactTemplateImpl()FactTemplateImpl(InternalKnowledgePackage pkg, String name, FieldTemplate... fields)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FactcreateFact(long id)Method takes a list of Slots and creates a deffact from it.booleanequals(Object object)FieldTemplate[]getAllFieldTemplates()Return all the slotsFieldTemplategetFieldTemplate(int index)get the Slot at the given pattern idFieldTemplategetFieldTemplate(String name)A convienance method for finding the slot matching the String name.intgetFieldTemplateIndex(String name)Look up the pattern index of the slotStringgetName()the template name is an alias for an objectintgetNumberOfFields()Return the number of slots in the deftemplateInternalKnowledgePackagegetPackage()inthashCode()voidreadExternal(ObjectInput in)StringtoString()Method will return a string format with the int type code for the slot typevoidwriteExternal(ObjectOutput out)
-
-
-
Constructor Detail
-
FactTemplateImpl
public FactTemplateImpl()
-
FactTemplateImpl
public FactTemplateImpl(InternalKnowledgePackage pkg, String name, FieldTemplate... fields)
-
-
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
-
getPackage
public InternalKnowledgePackage getPackage()
- Specified by:
getPackagein interfaceFactTemplate
-
getName
public String getName()
the template name is an alias for an object- Specified by:
getNamein interfaceFactTemplate- Returns:
-
getNumberOfFields
public int getNumberOfFields()
Return the number of slots in the deftemplate- Specified by:
getNumberOfFieldsin interfaceFactTemplate- Returns:
-
getAllFieldTemplates
public FieldTemplate[] getAllFieldTemplates()
Return all the slots- Specified by:
getAllFieldTemplatesin interfaceFactTemplate- Returns:
-
getFieldTemplate
public FieldTemplate getFieldTemplate(String name)
A convienance method for finding the slot matching the String name.- Specified by:
getFieldTemplatein interfaceFactTemplate- Parameters:
name-- Returns:
-
getFieldTemplate
public FieldTemplate getFieldTemplate(int index)
get the Slot at the given pattern id- Specified by:
getFieldTemplatein interfaceFactTemplate- Returns:
-
getFieldTemplateIndex
public int getFieldTemplateIndex(String name)
Look up the pattern index of the slot- Specified by:
getFieldTemplateIndexin interfaceFactTemplate- Returns:
-
createFact
public Fact createFact(long id)
Method takes a list of Slots and creates a deffact from it.- Specified by:
createFactin interfaceFactTemplate
-
toString
public String toString()
Method will return a string format with the int type code for the slot type
-
-