KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > presumo > jms > selector > JmsDataType


1 /**
2  * This file is part of Presumo.
3  *
4  * Presumo is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * Presumo is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Presumo; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  *
19  * Copyright 2001 Dan Greff
20  */

21 package com.presumo.jms.selector;
22
23 import javax.jms.Message JavaDoc;
24
25 /**
26  * Base class for all expression nodes representing data.
27  *
28  * @author Dan Greff
29  */

30 abstract class JmsDataType extends JmsOperand
31 {
32   protected String JavaDoc stringRepresentation;
33
34     /////////////////////////////////////////////////////////////////////////
35
// Constructor //
36
/////////////////////////////////////////////////////////////////////////
37
protected JmsDataType(boolean tracked)
38   {
39     super(tracked);
40   }
41
42
43     /////////////////////////////////////////////////////////////////////////
44
// Public Methods //
45
/////////////////////////////////////////////////////////////////////////
46

47   public String JavaDoc toString() { return stringRepresentation; }
48   
49   
50     /////////////////////////////////////////////////////////////////////////
51
// Package Methods //
52
/////////////////////////////////////////////////////////////////////////
53

54   abstract JmsBooleanLiteral eq(JmsDataType value) throws SelectorFalseException;
55
56   /**
57    * Returns the object represented by this instance.
58    */

59   final JmsOperand evaluate(Message JavaDoc msg) throws SelectorFalseException
60   {
61     return this;
62   }
63
64   /**
65    * Returns the object represented by this instance. Saves
66    * a method call on something that already has a constant
67    * evaluation time.
68    */

69   final JmsOperand evaluateOnce(Message JavaDoc msg) throws SelectorFalseException
70   {
71     return this;
72   }
73  
74   String JavaDoc unParse() { return stringRepresentation; }
75
76 }
77
78
79
80
81
Popular Tags