    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class gnu.jel.ExpressionBits

    java.lang.Object
       |
       +----gnu.jel.ExpressionBits

public class ExpressionBits
extends Object
implements Serializable

This class handles storage of compiled expressions, their instantiation and naming.

As You may notice this class is serializable. Serialization of `ExpressionBits` objects is preferred method of persistent storage of compiled expressions. To restore compiled expression first deserialize corresponding `ExpressionBits` object and then call its `getExpression()` method.

The unique class name of the expression is generated automatically by appending successive integer numbers (incremented for each instantiated expression) to the "gnu.jel.generated.E_". The number is represented by long integer allowing to instantiate close to 10^19 expressions during the program lifetime. This means program, instantiating a new expression each second, will fail with numeric overflow in about 300000000000 years, which is big enough for most applications.

##

getExpression()
  Constructs a new instance of the CompiledExpression subclass from these bits.
getImage()
  Used to get the binary image of the class.

##

getExpression

     public CompiledExpression getExpression()

  Constructs a new instance of the CompiledExpression subclass from these bits.

  Returns:
    a CompiledExpression instance or null if there was a error.

getImage

     public byte[] getImage()

  Used to get the binary image of the class.

  This should be used for debugging only. JEL compiled expressions are not represented only by Java bytecode (since constants of type object are allowed) which means saving bytes into classfile and loading it using JVM classloader will not always work.

  Returns:
    a binary class representation.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index