Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.presumo.jms.selector
Class JmsOperand  view JmsOperand download JmsOperand.java

java.lang.Object
  extended bycom.presumo.jms.selector.JmsOperand
Direct Known Subclasses:
JmsBinaryOperand, JmsDataType, JmsIdentifier, JmsIs, JmsNot

public abstract class JmsOperand
extends java.lang.Object

Base class for all nodes in the JMS parse tree. All functionality is package protected, and calling code should use the access point represented by Parser.


Field Summary
private static java.util.ArrayList allInstances
           
protected static short evalNumber
           
(package private) static short JMS_BINARY_ADD
           
(package private) static short JMS_BINARY_AND
           
(package private) static short JMS_BINARY_DIV
           
(package private) static short JMS_BINARY_MULT
           
(package private) static short JMS_BINARY_OR
           
(package private) static short JMS_BINARY_SUB
           
(package private) static short JMS_BOOLEAN_LITERAL
           
(package private) static short JMS_EQUALS
           
(package private) static short JMS_FLOAT_LITERAL
           
(package private) static short JMS_GREATER
           
(package private) static short JMS_IDENTIFIER
           
(package private) static short JMS_INTEGER_LITERAL
           
(package private) static short JMS_IS
           
(package private) static short JMS_LESS
           
(package private) static short JMS_LIKE
           
(package private) static short JMS_NOT
           
(package private) static short JMS_STRING_LITERAL
           
protected  JmsOperand lastEval
           
protected  short myEvalNumber
           
protected  java.util.Hashtable parents
          keeps track of what children belong to which parent.
protected  int refcount
           
private  boolean tracked
           
 
Constructor Summary
protected JmsOperand()
          All subclasses of JmsOperand will be a modified version of a singleton which only allows one instance for every logical expression within the JVM.
protected JmsOperand(boolean tracked)
          JmsOperands that represent data types have constant evaluation times and don't need to be tracked for the reset functionality.
 
Method Summary
protected  void addParent(JmsOperand parent)
           
protected  void addParentRef(JmsOperand parent)
           
protected  java.util.Enumeration allParents()
          Returns an enumeration of all nodes that point to this instance as a child.
(package private)  void delete()
          Because of the singleton optimizations, code using this parser has to manually free up parse trees.
protected  void delete(JmsOperand fromParent)
           
(package private) abstract  JmsOperand evaluate(javax.jms.Message msg)
          Evaluates the expression tree represented by this node.
(package private)  JmsOperand evaluateOnce(javax.jms.Message msg)
          Method used to evaluate all logically equivelant espressions within a JVM only once.
(package private) static java.util.ArrayList getAllInstances()
           
(package private) abstract  short getType()
           
protected  boolean hasParent(JmsOperand parent)
           
(package private)  void incrementAllRefCounts()
          Increments all reference counts in this tree
(package private)  void incrementRefCount()
           
protected  int numberOfParents()
           
(package private)  void printTree(int level)
           
protected  void removeParent(JmsOperand parent)
           
(package private) static void resetStoredEvals()
           
(package private) abstract  java.lang.String unParse()
          Returns a String representing the SQL form of the filter which is logically equivilant.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

evalNumber

protected static short evalNumber

myEvalNumber

protected short myEvalNumber

lastEval

protected JmsOperand lastEval

tracked

private final boolean tracked

refcount

protected int refcount

parents

protected java.util.Hashtable parents
keeps track of what children belong to which parent.


allInstances

private static java.util.ArrayList allInstances

JMS_EQUALS

static final short JMS_EQUALS
See Also:
Constant Field Values

JMS_INTEGER_LITERAL

static final short JMS_INTEGER_LITERAL
See Also:
Constant Field Values

JMS_IDENTIFIER

static final short JMS_IDENTIFIER
See Also:
Constant Field Values

JMS_BOOLEAN_LITERAL

static final short JMS_BOOLEAN_LITERAL
See Also:
Constant Field Values

JMS_STRING_LITERAL

static final short JMS_STRING_LITERAL
See Also:
Constant Field Values

JMS_FLOAT_LITERAL

static final short JMS_FLOAT_LITERAL
See Also:
Constant Field Values

JMS_LESS

static final short JMS_LESS
See Also:
Constant Field Values

JMS_GREATER

static final short JMS_GREATER
See Also:
Constant Field Values

JMS_NOT

static final short JMS_NOT
See Also:
Constant Field Values

JMS_BINARY_OR

static final short JMS_BINARY_OR
See Also:
Constant Field Values

JMS_BINARY_AND

static final short JMS_BINARY_AND
See Also:
Constant Field Values

JMS_IS

static final short JMS_IS
See Also:
Constant Field Values

JMS_BINARY_MULT

static final short JMS_BINARY_MULT
See Also:
Constant Field Values

JMS_BINARY_DIV

static final short JMS_BINARY_DIV
See Also:
Constant Field Values

JMS_BINARY_ADD

static final short JMS_BINARY_ADD
See Also:
Constant Field Values

JMS_BINARY_SUB

static final short JMS_BINARY_SUB
See Also:
Constant Field Values

JMS_LIKE

static final short JMS_LIKE
See Also:
Constant Field Values
Constructor Detail

JmsOperand

protected JmsOperand()
All subclasses of JmsOperand will be a modified version of a singleton which only allows one instance for every logical expression within the JVM.


JmsOperand

protected JmsOperand(boolean tracked)
JmsOperands that represent data types have constant evaluation times and don't need to be tracked for the reset functionality. This makes the reset functionality more effecient. Furthermore, JmsDataType(s) can be created during the evaulation phase (i.e. through an identifier) If these instances were tracked there would be a memory leak.

Method Detail

getAllInstances

static java.util.ArrayList getAllInstances()

resetStoredEvals

static final void resetStoredEvals()

incrementRefCount

void incrementRefCount()

incrementAllRefCounts

void incrementAllRefCounts()
Increments all reference counts in this tree


allParents

protected final java.util.Enumeration allParents()
Returns an enumeration of all nodes that point to this instance as a child.


numberOfParents

protected final int numberOfParents()

hasParent

protected final boolean hasParent(JmsOperand parent)

addParent

protected final void addParent(JmsOperand parent)

addParentRef

protected final void addParentRef(JmsOperand parent)

removeParent

protected final void removeParent(JmsOperand parent)

evaluate

abstract JmsOperand evaluate(javax.jms.Message msg)
                      throws SelectorFalseException
Evaluates the expression tree represented by this node.


evaluateOnce

JmsOperand evaluateOnce(javax.jms.Message msg)
                  throws SelectorFalseException
Method used to evaluate all logically equivelant espressions within a JVM only once.


unParse

abstract java.lang.String unParse()
Returns a String representing the SQL form of the filter which is logically equivilant.


delete

void delete()
Because of the singleton optimizations, code using this parser has to manually free up parse trees. This operation should only be called on the root node of a parse tree.


delete

protected void delete(JmsOperand fromParent)

printTree

void printTree(int level)

getType

abstract short getType()