org.drools.facttemplates
Class FactTemplateImpl

java.lang.Object
  extended by org.drools.facttemplates.FactTemplateImpl
All Implemented Interfaces:
Externalizable, Serializable, FactTemplate

public class FactTemplateImpl
extends Object
implements FactTemplate

See Also:
Serialized Form

Constructor Summary
FactTemplateImpl()
           
FactTemplateImpl(Package pkg, String name, FieldTemplate[] fields)
           
 
Method Summary
 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 slots
 FieldTemplate getFieldTemplate(int index)
          get the Slot at the given pattern id
 FieldTemplate 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 slot
 String getName()
          the template name is an alias for an object
 int getNumberOfFields()
          Return the number of slots in the deftemplate
 Package getPackage()
           
 int hashCode()
           
 void readExternal(ObjectInput in)
           
 String toString()
          Method will return a string format with the int type code for the slot type
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FactTemplateImpl

public FactTemplateImpl()

FactTemplateImpl

public FactTemplateImpl(Package pkg,
                        String name,
                        FieldTemplate[] fields)
Method Detail

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

getPackage

public Package getPackage()
Specified by:
getPackage in interface FactTemplate

getName

public String getName()
the template name is an alias for an object

Specified by:
getName in interface FactTemplate
Parameters:
name -
Returns:

getNumberOfFields

public int getNumberOfFields()
Return the number of slots in the deftemplate

Specified by:
getNumberOfFields in interface FactTemplate
Returns:

getAllFieldTemplates

public FieldTemplate[] getAllFieldTemplates()
Return all the slots

Specified by:
getAllFieldTemplates in interface FactTemplate
Returns:

getFieldTemplate

public FieldTemplate getFieldTemplate(String name)
A convienance method for finding the slot matching the String name.

Specified by:
getFieldTemplate in interface FactTemplate
Parameters:
name -
Returns:

getFieldTemplate

public FieldTemplate getFieldTemplate(int index)
get the Slot at the given pattern id

Specified by:
getFieldTemplate in interface FactTemplate
Parameters:
id -
Returns:

getFieldTemplateIndex

public int getFieldTemplateIndex(String name)
Look up the pattern index of the slot

Specified by:
getFieldTemplateIndex in interface FactTemplate
Parameters:
name -
Returns:

createFact

public Fact createFact(long id)
Method takes a list of Slots and creates a deffact from it.

Specified by:
createFact in interface FactTemplate
Parameters:
data -
id -
Returns:

toString

public String toString()
Method will return a string format with the int type code for the slot type

Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Object


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.