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 Fact
createFact(long id)
Method takes a list of Slots and creates a deffact from it.boolean
equals(Object object)
FieldTemplate[]
getAllFieldTemplates()
Return all the slotsFieldTemplate
getFieldTemplate(int index)
get the Slot at the given pattern idFieldTemplate
getFieldTemplate(String name)
A convienance method for finding the slot matching the String name.int
getFieldTemplateIndex(String name)
Look up the pattern index of the slotString
getName()
the template name is an alias for an objectint
getNumberOfFields()
Return the number of slots in the deftemplateInternalKnowledgePackage
getPackage()
int
hashCode()
void
readExternal(ObjectInput in)
String
toString()
Method will return a string format with the int type code for the slot typevoid
writeExternal(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:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
getPackage
public InternalKnowledgePackage getPackage()
- Specified by:
getPackage
in interfaceFactTemplate
-
getName
public String getName()
the template name is an alias for an object- Specified by:
getName
in interfaceFactTemplate
- Returns:
-
getNumberOfFields
public int getNumberOfFields()
Return the number of slots in the deftemplate- Specified by:
getNumberOfFields
in interfaceFactTemplate
- Returns:
-
getAllFieldTemplates
public FieldTemplate[] getAllFieldTemplates()
Return all the slots- Specified by:
getAllFieldTemplates
in interfaceFactTemplate
- Returns:
-
getFieldTemplate
public FieldTemplate getFieldTemplate(String name)
A convienance method for finding the slot matching the String name.- Specified by:
getFieldTemplate
in interfaceFactTemplate
- Parameters:
name
-- Returns:
-
getFieldTemplate
public FieldTemplate getFieldTemplate(int index)
get the Slot at the given pattern id- Specified by:
getFieldTemplate
in interfaceFactTemplate
- Returns:
-
getFieldTemplateIndex
public int getFieldTemplateIndex(String name)
Look up the pattern index of the slot- Specified by:
getFieldTemplateIndex
in interfaceFactTemplate
- Returns:
-
createFact
public Fact createFact(long id)
Method takes a list of Slots and creates a deffact from it.- Specified by:
createFact
in interfaceFactTemplate
-
toString
public String toString()
Method will return a string format with the int type code for the slot type
-
-