站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss RULES 4.0.0.11754MR2 API 英文版文档

FactImpl (Drools 4.0.0.11754MR2 API) - JBoss RULES 4.0.0.11754MR2 API 英文版文档


org.drools.facttemplates
Class FactImpl

java.lang.Object
  extended by org.drools.facttemplates.FactImpl
All Implemented Interfaces:
Serializable, Fact

public class FactImpl
extends Object
implements Fact, Serializable

Author:
Peter Lin Deffact is a concrete implementation of Fact interface. It is equivalent to deffact in CLIPS.
See Also:
Serialized Form

Constructor Summary
FactImpl(FactTemplate template, long id)
           
FactImpl(FactTemplate template, Object[] values, long id)
          this is the default constructor
 
Method Summary
 boolean equals(Object object)
           
 long getFactId()
          Return the long factId
 FactTemplate getFactTemplate()
          Return the deftemplate for the fact
 Object getFieldValue(int index)
          Method returns the value of the given slot at the id.
 Object getFieldValue(String name)
           
 int hashCode()
           
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.
 void setFieldValue(int index, Object value)
           
 void setFieldValue(String name, Object value)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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

getFieldValue

public Object getFieldValue(int index)
Method returns the value of the given slot at the id.

Specified by:
getFieldValue in interface Fact
Parameters:
id -
Returns:

getFieldValue

public Object getFieldValue(String name)
Specified by:
getFieldValue in interface Fact

setFieldValue

public void setFieldValue(String name,
                          Object value)
Specified by:
setFieldValue in interface Fact

setFieldValue

public void setFieldValue(int index,
                          Object value)
Specified by:
setFieldValue in interface Fact

getFactId

public long getFactId()
Return the long factId

Specified by:
getFactId in interface Fact
Returns:

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:
getFactTemplate in interface Fact
Returns:

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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


Copyright © 2001-2007 JBoss Inc.. All Rights Reserved.