|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjess.ValueFactory
public class ValueFactory
A ValueFactory creates and possibly caches Value
instances, and instances
of its subclasses. Each Rete engine has its own ValueFactory. You can obtain a reference to a
Rete object's ValueFactory and use it to create your own instances. Using the factory allows for
large memory savings, especially when parsing a lot of redundant data. You can create a
custom subclass to implement your own strategies.
(C) 2013 Sandia Corporation
Constructor Summary | |
---|---|
ValueFactory()
Create a new ValueFactory. |
Method Summary | |
---|---|
Value |
get(boolean v)
Returns one of the contants Funcall.TRUE or Funcall.FALSE . |
Value |
get(double v,
int type)
Return a numeric Value object of the given type. |
Value |
get(int v)
Returns a Value of type RU.INTEGER . |
Value |
get(int v,
int type)
Return a Value appropriate to the type argument. |
Value |
get(long v)
Returns a LongValue representing the argument. |
Value |
get(java.lang.Object v)
Return a new Value of type RU.JAVA_OBJECT . |
Value |
get(java.lang.String v,
int type)
Create a STRING, SYMBOL, VARIABLE or MULTIVARIABLE value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ValueFactory()
Rete.getValueFactory()
Method Detail |
---|
public Value get(java.lang.String v, int type) throws JessException
v
- the contents as a Stringtype
- STRING, SYMBOL, VARIABLE or MULTIVARIABLE
JessException
- if anything goes wrongpublic Value get(double v, int type) throws JessException
v
- a numberic valuetype
- one of RU.INTEGER, RU.FLOAT, or RU.LONG
JessException
public Value get(int v, int type) throws JessException
v
- an integertype
- one of RU.INTEGER, RU.NONE
JessException
public Value get(int v) throws JessException
RU.INTEGER
. You need to watch out for autoboxing;
you'll get different results from an int vs. an Integer.
v
- an int
JessException
- if anything goes wrongpublic Value get(long v) throws JessException
LongValue
representing the argument.
v
- a long value
JessException
- if anything goes wrongpublic Value get(boolean v) throws JessException
Funcall.TRUE
or Funcall.FALSE
.
v
- a boolean value
JessException
- if anything goes wrongpublic Value get(java.lang.Object v) throws JessException
RU.JAVA_OBJECT
.
If the argument is null, returns the constant Funcall.NIL
.
v
- any Java object
JessException
- if anything goes wrong
|
© 2013 Sandia Corporation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |