jess
Class LongValue

java.lang.Object
  extended byjess.Value
      extended byjess.LongValue
All Implemented Interfaces:
java.io.Serializable

public class LongValue
extends Value
implements java.io.Serializable

A class to represent a Java long.

(C) 1998 E.J. Friedman-Hill and the Sandia Corporation

Author:
Ernest J. Friedman-Hill
See Also:
Serialized Form

Constructor Summary
LongValue(long l)
          Create a LongValue
 
Method Summary
 boolean equals(Value v)
          Compare this value to another value.
 int intValue(Context c)
          Returns the contents of this value, as an int
 long longValue(Context c)
          Returns the contents of this value, as a long
 double numericValue(Context c)
          Returns the contents of this value, as a number
 java.lang.String stringValue(Context c)
          Returns the contents of this value, as a String
 java.lang.String toString()
          Pretty-print this value, without adding parens to any lists
 
Methods inherited from class jess.Value
atomValue, equals, equalsStar, externalAddressValue, factValue, floatValue, funcallValue, hashCode, listValue, resolveValue, toStringWithParens, type, variableValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LongValue

public LongValue(long l)
          throws JessException
Create a LongValue

Parameters:
l - The long value
Throws:
JessException - If the type is invalid
Method Detail

longValue

public final long longValue(Context c)
                     throws JessException
Description copied from class: Value
Returns the contents of this value, as a long

Overrides:
longValue in class Value
Returns:
The number as a long
Throws:
JessException - If this value does not contain any kind of number

numericValue

public final double numericValue(Context c)
                          throws JessException
Description copied from class: Value
Returns the contents of this value, as a number

Overrides:
numericValue in class Value
Returns:
The number as a double
Throws:
JessException - If this value does not contain any kind of number

intValue

public final int intValue(Context c)
                   throws JessException
Description copied from class: Value
Returns the contents of this value, as an int

Overrides:
intValue in class Value
Returns:
The number as an int
Throws:
JessException - If this value does not contain any kind of number

stringValue

public final java.lang.String stringValue(Context c)
                                   throws JessException
Description copied from class: Value
Returns the contents of this value, as a String

Overrides:
stringValue in class Value
Returns:
The string
Throws:
JessException - If this value does not contain any kind of String

toString

public final java.lang.String toString()
Description copied from class: Value
Pretty-print this value, without adding parens to any lists

Overrides:
toString in class Value
Returns:
The formatted string

equals

public final boolean equals(Value v)
Description copied from class: Value
Compare this value to another value. Believe it or not, using this separate overloaded routine has a measurable impact on performance - since so much time is spent comparing Values.

Overrides:
equals in class Value
Parameters:
v - The Value to compare to.
Returns:
True if the Values are equivalent.

© 2001 E.J. Friedman-Hill and Sandia Corporation