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()Method takes a list of Slots and creates a deffact from it.booleanequals(Object o)Collection<String>getFieldNames()Return all the slotsFieldTemplategetFieldTemplate(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()voidwriteExternal(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:
-
getFieldNames
public Collection<String> getFieldNames()
Return all the slots- Specified by:
getFieldNamesin 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:
-
getFieldTemplateIndex
public int getFieldTemplateIndex(String name)
Look up the pattern index of the slot- Specified by:
getFieldTemplateIndexin interfaceFactTemplate- Returns:
-
createFact
public Fact createFact()
Method takes a list of Slots and creates a deffact from it.- Specified by:
createFactin interfaceFactTemplate
-
-