User: norbert
Date: 00/05/25 22:38:23
Modified: src/java/org/spyderMQ/selectors Operator.java Selector.java
Log:
Changes to selector ( classes )
Revision Changes Path
1.9 +16 -18 spyderMQ/src/java/org/spyderMQ/selectors/Operator.java
Index: Operator.java
===================================================================
RCS file:
/products/cvs/ejboss/spyderMQ/src/java/org/spyderMQ/selectors/Operator.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Operator.java 2000/05/24 19:17:20 1.8
+++ Operator.java 2000/05/26 05:38:23 1.9
@@ -11,7 +11,7 @@
*
* @author Norbert Lataille ([EMAIL PROTECTED])
*
- * @version $Revision: 1.8 $
+ * @version $Revision: 1.9 $
*/
public class Operator
{
@@ -200,9 +200,9 @@
{
Class className=oper1.getClass();
- if (className.equals(Identifier.class)) {
+ if (className==Identifier.class) {
arg1=((Identifier)oper1).value;
- } else if (className.equals(Operator.class)) {
+ } else if (className==Operator.class) {
arg1=((Operator)oper1).apply();
} else arg1=oper1;
@@ -213,21 +213,20 @@
className=arg1.getClass();
- if (className.equals(String.class)) class1=1;
- else if (className.equals(Double.class)) class1=2;
- else if (className.equals(Long.class)) class1=3;
- else if (className.equals(Boolean.class)) class1=4;
-
- throw new Exception("ARG1: Bad object type");
+ if (className==String.class) class1=STRING;
+ else if (className==Double.class) class1=DOUBLE;
+ else if (className==Long.class) class1=LONG;
+ else if (className==Boolean.class) class1=BOOLEAN;
+ else throw new Exception("ARG1: Bad object type");
}
void computeArgument2() throws Exception
{
Class className=oper2.getClass();
- if (className.equals(Identifier.class)) {
+ if (className==Identifier.class) {
arg2=((Identifier)oper2).value;
- } else if (className.equals(Operator.class)) {
+ } else if (className==Operator.class) {
arg2=((Operator)oper2).apply();
} else arg2=oper2;
@@ -237,13 +236,12 @@
}
className=arg2.getClass();
-
- if (className.equals(String.class)) class2=1;
- else if (className.equals(Double.class)) class2=2;
- else if (className.equals(Long.class)) class2=3;
- else if (className.equals(Boolean.class)) class2=4;
- throw new Exception("ARG2: Bad object type");
+ if (className==String.class) class2=STRING;
+ else if (className==Double.class) class2=DOUBLE;
+ else if (className==Long.class) class2=LONG;
+ else if (className==Boolean.class) class2=BOOLEAN;
+ else throw new Exception("ARG2: Bad object type");
}
Object apply() throws Exception
@@ -252,7 +250,7 @@
switch (operation) {
case EQUAL: return equal();
- case DIFFERENT: return different();
+ case DIFFERENT: return different();
case GT: return gt();
case NOT: return not();
case AND: return and();
1.7 +5 -5 spyderMQ/src/java/org/spyderMQ/selectors/Selector.java
Index: Selector.java
===================================================================
RCS file:
/products/cvs/ejboss/spyderMQ/src/java/org/spyderMQ/selectors/Selector.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Selector.java 2000/05/24 19:17:20 1.6
+++ Selector.java 2000/05/26 05:38:23 1.7
@@ -17,16 +17,16 @@
*
* @author Norbert Lataille ([EMAIL PROTECTED])
*
- * @version $Revision: 1.6 $
+ * @version $Revision: 1.7 $
*/
-public class Selector
+public class
{
- public HashMap identifiers; // HashMap of Identifiers
+ public HashMap identifiers; // HashMap of Identifiers
public Object result;
- public Selector(String sel) throws JMSException
- {
+ public Selector(String sel) throws JMSException
+ {
parser bob=new parser();
identifiers=new HashMap();