incubator-imperius-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r611261 [20/43] - in /incubator/imperius/trunk: ./ imperius-javaspl/ imperius-javaspl/src/main/java/org/apache/imperius/javaspl/ imperius-splcore/ imperius-splcore/src/main/antlr/org/apache/imperius/spl/parser/compiler/ imperius-splcore/src...
Date Fri, 11 Jan 2008 18:57:14 GMT
Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/InCollection.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/InCollection.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/InCollection.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/InCollection.java Fri Jan 11 10:56:30 2008
@@ -1,212 +1,212 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Prashant Baliga <prabalig@in.ibm.com>
- *
- */
-package org.apache.imperius.spl.parser.expressions.impl;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.Expression;
-import org.apache.imperius.spl.external.TypeConstants;
-import org.apache.imperius.spl.parser.exceptions.IllegalParameterTypeException;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.expressions.DoubleArgumentExpression;
-import org.apache.imperius.spl.parser.util.ExpressionUtility;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class InCollection extends DoubleArgumentExpression implements
-        Expression
-{
-    
-    public String className = InCollection.class.toString();
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="InCollection";
-    
-    
-    
-    public InCollection(List exprList, boolean evaluateExpression)
-            throws SPLException
-    {
-        super(exprList);
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "InCollection");
-
-        this._dataType.setType(TypeConstants.booleanType);
-        this._dataType.setIsArray(false);
-       //System.out.println("InCollection");
-        if (evaluateExpression)
-        {
-           //System.out.println("evaluateExpression " + evaluateExpression);
-            if (!validate())
-            {
-
-                logger.severe(
-                        "validation error: wrong data type passed in "
-                        + this._dataType);
-             
-                throw new SPLException(
-                        "validation error: wrong data type passed in "
-                                + this._dataType);
-            }
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "InCollection");
-        
-    }
-    
-    public Object evaluate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-     
-       //System.out.println("InCollection:evaluate");
-        Expression lhsExpression = (Expression) this._lhsExp;
-        Expression rhsExpression = (Expression) this._rhsExp;
-        if (rhsExpression.isArray())
-        {
-           //System.out.println("rhs is of type Basic Collection");
-            Object rhsResult = rhsExpression.evaluate();
-           //System.out.println("rhsResult , class " + rhsResult + " "+ rhsResult.getClass());
-            if (!(rhsResult instanceof java.util.List))
-            {
-                logger.severe(Thread.currentThread().getName()+" "+"rhsResult is not of type List");
-                throw new SPLException("rhsResult is not of type List");
-            }
-            // BasicCollectionExpression
-            // expression=(BasicCollectionExpression)rhsExpression;
-            Boolean result = Boolean.FALSE;
-            ArrayList rhsResultArray = (ArrayList) rhsResult;
-           //System.out.println("resultArray size " + rhsResultArray.size()+ " to string " + rhsResultArray.toString());
-            ////System.out.println("resultArray is of type
-            // "+expression.getType());
-           //System.out.println("LHS expression is of type "+ lhsExpression.getType());
-            if ((rhsResultArray != null) && (!rhsResultArray.isEmpty()))
-            {
-                Object lhsResult = (Object) lhsExpression.evaluate();
-                // String lhsResultString=lhsResult.toString();
-               //System.out.println("lhsResult " + lhsResult.toString());
-                Iterator rhsResultIt = rhsResultArray.iterator();
-                while (rhsResultIt.hasNext())
-                {
-                    Object value = (Object) rhsResultIt.next();
-                    // String valueString=value.toString();
-                   //System.out.println("rhsResult element " + value.toString());
-                    if (ExpressionUtility.compare(lhsResult, value) == 0)
-                    {
-                       //System.out.println("InCollection:true");
-                        result = Boolean.TRUE;
-                        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-                        
-                        return result;
-                    }
-                    
-                    /*
-                     *System.out.println("rhs Array value "+value.toString());
-                     * if(valueString.compareTo(lhsResultString)==0){
-                     *System.out.println("InCollection:true");
-                     * result=Boolean.TRUE; return result; }
-                     */
-                   //System.out.println("did not match");
-                }
-               //System.out.println("no matches: Lhs not inCollection");
-                result = Boolean.FALSE;
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-                
-                return result;
-            }
-            else
-            { 
-                logger.severe(
-                "the RHS of InCollection expression is null BasicCollection");
-                throw new IllegalParameterTypeException(
-                        "the RHS of InCollection expression is null BasicCollection");
-            }
-        }
-        else
-        {
-            logger.severe(
-            "the RHS of InCollection expression should be of BasicCollection type");
-            
-            throw new IllegalParameterTypeException(
-                    "the RHS of InCollection expression should be of BasicCollection type");
-        }
-        
-    }
-    
-    public boolean validate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-
-       //System.out.println("InCollection : validate ");
-        Expression lhsExpression = (Expression) this._lhsExp;
-        Expression rhsExpression = (Expression) this._rhsExp;
-        
-        if (rhsExpression.isArray())
-        {
-            if (lhsExpression.getType().getType() != rhsExpression.getType().getType())
-            {
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-                
-                throw new SPLException(
-                        "lhsExpression.getType()!=rhsExpression.getType()");
-            }
-           //System.out.println("rhs is of type BasicCollection ,class=" + rhsExpression.getClass() + "   "+ rhsExpression.toString());
-            /*
-             * BasicCollectionExpression
-             * rhsBasicCollectionExpression=(BasicCollectionExpression)rhsExpression;
-             * System.out.println("lhs Type() : rhsBasicCollection
-             * CollectionType() "+lhsExpression.getType() +" :
-             * "+rhsBasicCollectionExpression.getCollectionType());
-             * if(lhsExpression.getType()
-             * !=rhsBasicCollectionExpression.getCollectionType()){
-             * System.out.println("Validation:false "); return false; } else{
-             * System.out.println("validation: true lhs:rhs
-             * "+lhsExpression.getType()+":"+rhsBasicCollectionExpression.getCollectionType());
-             * 
-             * return true; }
-             */
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-            
-            return true;
-        }
-        else
-        {
-           //System.out.println("RHS of InCollection is not of type Basic Collection, returning false(Validation)");
-
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-            return false;
-        }
-        
-    }
-    
-    public String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-
-        String str = "InCollection("+this._lhsExp.toString() + "," + this._rhsExp.toString() +")";
-        	
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
-    }
-    
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Prashant Baliga <prabalig@in.ibm.com>
+ *
+ */
+package org.apache.imperius.spl.parser.expressions.impl;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.Expression;
+import org.apache.imperius.spl.external.TypeConstants;
+import org.apache.imperius.spl.parser.exceptions.IllegalParameterTypeException;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.expressions.DoubleArgumentExpression;
+import org.apache.imperius.spl.parser.util.ExpressionUtility;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class InCollection extends DoubleArgumentExpression implements
+        Expression
+{
+    
+    public String className = InCollection.class.toString();
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="InCollection";
+    
+    
+    
+    public InCollection(List exprList, boolean evaluateExpression)
+            throws SPLException
+    {
+        super(exprList);
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "InCollection");
+
+        this._dataType.setType(TypeConstants.booleanType);
+        this._dataType.setIsArray(false);
+       //System.out.println("InCollection");
+        if (evaluateExpression)
+        {
+           //System.out.println("evaluateExpression " + evaluateExpression);
+            if (!validate())
+            {
+
+                logger.severe(
+                        "validation error: wrong data type passed in "
+                        + this._dataType);
+             
+                throw new SPLException(
+                        "validation error: wrong data type passed in "
+                                + this._dataType);
+            }
+        }
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "InCollection");
+        
+    }
+    
+    public Object evaluate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+     
+       //System.out.println("InCollection:evaluate");
+        Expression lhsExpression = (Expression) this._lhsExp;
+        Expression rhsExpression = (Expression) this._rhsExp;
+        if (rhsExpression.isArray())
+        {
+           //System.out.println("rhs is of type Basic Collection");
+            Object rhsResult = rhsExpression.evaluate();
+           //System.out.println("rhsResult , class " + rhsResult + " "+ rhsResult.getClass());
+            if (!(rhsResult instanceof java.util.List))
+            {
+                logger.severe(Thread.currentThread().getName()+" "+"rhsResult is not of type List");
+                throw new SPLException("rhsResult is not of type List");
+            }
+            // BasicCollectionExpression
+            // expression=(BasicCollectionExpression)rhsExpression;
+            Boolean result = Boolean.FALSE;
+            ArrayList rhsResultArray = (ArrayList) rhsResult;
+           //System.out.println("resultArray size " + rhsResultArray.size()+ " to string " + rhsResultArray.toString());
+            ////System.out.println("resultArray is of type
+            // "+expression.getType());
+           //System.out.println("LHS expression is of type "+ lhsExpression.getType());
+            if ((rhsResultArray != null) && (!rhsResultArray.isEmpty()))
+            {
+                Object lhsResult = (Object) lhsExpression.evaluate();
+                // String lhsResultString=lhsResult.toString();
+               //System.out.println("lhsResult " + lhsResult.toString());
+                Iterator rhsResultIt = rhsResultArray.iterator();
+                while (rhsResultIt.hasNext())
+                {
+                    Object value = (Object) rhsResultIt.next();
+                    // String valueString=value.toString();
+                   //System.out.println("rhsResult element " + value.toString());
+                    if (ExpressionUtility.compare(lhsResult, value) == 0)
+                    {
+                       //System.out.println("InCollection:true");
+                        result = Boolean.TRUE;
+                        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+                        
+                        return result;
+                    }
+                    
+                    /*
+                     *System.out.println("rhs Array value "+value.toString());
+                     * if(valueString.compareTo(lhsResultString)==0){
+                     *System.out.println("InCollection:true");
+                     * result=Boolean.TRUE; return result; }
+                     */
+                   //System.out.println("did not match");
+                }
+               //System.out.println("no matches: Lhs not inCollection");
+                result = Boolean.FALSE;
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+                
+                return result;
+            }
+            else
+            { 
+                logger.severe(
+                "the RHS of InCollection expression is null BasicCollection");
+                throw new IllegalParameterTypeException(
+                        "the RHS of InCollection expression is null BasicCollection");
+            }
+        }
+        else
+        {
+            logger.severe(
+            "the RHS of InCollection expression should be of BasicCollection type");
+            
+            throw new IllegalParameterTypeException(
+                    "the RHS of InCollection expression should be of BasicCollection type");
+        }
+        
+    }
+    
+    public boolean validate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+
+       //System.out.println("InCollection : validate ");
+        Expression lhsExpression = (Expression) this._lhsExp;
+        Expression rhsExpression = (Expression) this._rhsExp;
+        
+        if (rhsExpression.isArray())
+        {
+            if (lhsExpression.getType().getType() != rhsExpression.getType().getType())
+            {
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+                
+                throw new SPLException(
+                        "lhsExpression.getType()!=rhsExpression.getType()");
+            }
+           //System.out.println("rhs is of type BasicCollection ,class=" + rhsExpression.getClass() + "   "+ rhsExpression.toString());
+            /*
+             * BasicCollectionExpression
+             * rhsBasicCollectionExpression=(BasicCollectionExpression)rhsExpression;
+             * System.out.println("lhs Type() : rhsBasicCollection
+             * CollectionType() "+lhsExpression.getType() +" :
+             * "+rhsBasicCollectionExpression.getCollectionType());
+             * if(lhsExpression.getType()
+             * !=rhsBasicCollectionExpression.getCollectionType()){
+             * System.out.println("Validation:false "); return false; } else{
+             * System.out.println("validation: true lhs:rhs
+             * "+lhsExpression.getType()+":"+rhsBasicCollectionExpression.getCollectionType());
+             * 
+             * return true; }
+             */
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+            
+            return true;
+        }
+        else
+        {
+           //System.out.println("RHS of InCollection is not of type Basic Collection, returning false(Validation)");
+
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+            return false;
+        }
+        
+    }
+    
+    public String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+
+        String str = "InCollection("+this._lhsExp.toString() + "," + this._rhsExp.toString() +")";
+        	
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+       
+        return str;
+    }
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/InCollection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/IntegerConstant.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/IntegerConstant.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/IntegerConstant.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/IntegerConstant.java Fri Jan 11 10:56:30 2008
@@ -1,102 +1,102 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Prashant Baliga <prabalig@in.ibm.com>
- *
- */
-package org.apache.imperius.spl.parser.expressions.impl;
-
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.TypeConstants;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.expressions.ConstantExpression;
-import org.apache.imperius.spl.parser.expressions.NumericExpression;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class IntegerConstant extends ConstantExpression implements
-        NumericExpression
-{
-    
-    private int integerValue;
-    
-    public TypeInfo _dataType = new TypeInfo(TypeConstants.intType);
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="IntegerConstant";
-    
-    
-    
-    public boolean isArray()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-     
-        
-        return _dataType.getIsArray();
-    }
-    
-    public IntegerConstant(int val)
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "IntegerConstant");
-       
-        this.integerValue = val;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "IntegerConstant");
-        
-    }
-    
-    public Object evaluate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-
-        try
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-            
-            return new Integer(integerValue);
-        }
-        catch (Exception e)
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"evaluation errro: " + e.toString());
-            
-            throw new SPLException("evaluation errro: " + e.toString());
-        }
-    }
-    
-    public TypeInfo getType()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-     
-        return _dataType;
-    }
-    
-    public String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-        
-        String str=Integer.toString(this.integerValue);
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
-    }
-    
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Prashant Baliga <prabalig@in.ibm.com>
+ *
+ */
+package org.apache.imperius.spl.parser.expressions.impl;
+
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.TypeConstants;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.expressions.ConstantExpression;
+import org.apache.imperius.spl.parser.expressions.NumericExpression;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class IntegerConstant extends ConstantExpression implements
+        NumericExpression
+{
+    
+    private int integerValue;
+    
+    public TypeInfo _dataType = new TypeInfo(TypeConstants.intType);
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="IntegerConstant";
+    
+    
+    
+    public boolean isArray()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+     
+        
+        return _dataType.getIsArray();
+    }
+    
+    public IntegerConstant(int val)
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "IntegerConstant");
+       
+        this.integerValue = val;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "IntegerConstant");
+        
+    }
+    
+    public Object evaluate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+
+        try
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+            
+            return new Integer(integerValue);
+        }
+        catch (Exception e)
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"evaluation errro: " + e.toString());
+            
+            throw new SPLException("evaluation errro: " + e.toString());
+        }
+    }
+    
+    public TypeInfo getType()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+     
+        return _dataType;
+    }
+    
+    public String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+        
+        String str=Integer.toString(this.integerValue);
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+       
+        return str;
+    }
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/IntegerConstant.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/IsAfter.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/IsAfter.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/IsAfter.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/IsAfter.java Fri Jan 11 10:56:30 2008
@@ -1,121 +1,121 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Xiping Wang
- *
- */
-package org.apache.imperius.spl.parser.expressions.impl;
-
-import java.util.Calendar;
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.TypeConstants;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.expressions.BooleanExpression;
-import org.apache.imperius.spl.parser.expressions.DoubleArgumentExpression;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.spl.parser.util.TypeResolver;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class IsAfter extends DoubleArgumentExpression implements
-        BooleanExpression
-{
-    
-    public static final String className = IsAfter.class.getName();
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="IsAfter";
-    
-    
-    
-    public IsAfter(List exprList, boolean validateExpression)
-            throws SPLException
-    {
-        super(exprList);
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "IsAfter");
-
-        if (validateExpression)
-        {
-            if (!validate())
-            {
-                logger.severe(Thread.currentThread().getName()+" "+"validation error: " + className
-                        + " has wrong data type passed in.");
-                
-                throw new SPLException("validation error: " + className
-                        + " has wrong data type passed in.");
-            }
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "IsAfter");
-        
-    }
-    
-    public Object evaluate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-
-        try
-        {
-            Calendar o1 = (Calendar) _lhsExp.evaluate();
-            Calendar o2 = (Calendar) _rhsExp.evaluate();
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-            
-            return new Boolean(o1.after(o2));
-        }
-        catch (Exception e)
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + e.toString());
-            
-            throw new SPLException("evaluation error: " + e.toString());
-        }
-    }
-    
-    public boolean validate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-
-        TypeInfo lType = _lhsExp.getType();
-        TypeInfo rType = _rhsExp.getType();
-        
-        if (!lType.getIsArray() && !rType.getIsArray() &&
-        		TypeResolver.isCalendar(lType) && TypeResolver.isCalendar(rType))
-        {
-            _dataType.setType(TypeConstants.booleanType);
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-            
-            return true;
-        }
-        else
-        {
-        	throw new SPLException("Invalid input types " + lType + rType + "for isAfter");
-        }
-
-        
-    }
-    
-    public String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-
-        String str = "isAfter("+this._lhsExp.toString() + "," + this._rhsExp.toString() +")";
-        	
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
-    }
-    
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Xiping Wang
+ *
+ */
+package org.apache.imperius.spl.parser.expressions.impl;
+
+import java.util.Calendar;
+import java.util.List;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.TypeConstants;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.expressions.BooleanExpression;
+import org.apache.imperius.spl.parser.expressions.DoubleArgumentExpression;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.spl.parser.util.TypeResolver;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class IsAfter extends DoubleArgumentExpression implements
+        BooleanExpression
+{
+    
+    public static final String className = IsAfter.class.getName();
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="IsAfter";
+    
+    
+    
+    public IsAfter(List exprList, boolean validateExpression)
+            throws SPLException
+    {
+        super(exprList);
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "IsAfter");
+
+        if (validateExpression)
+        {
+            if (!validate())
+            {
+                logger.severe(Thread.currentThread().getName()+" "+"validation error: " + className
+                        + " has wrong data type passed in.");
+                
+                throw new SPLException("validation error: " + className
+                        + " has wrong data type passed in.");
+            }
+        }
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "IsAfter");
+        
+    }
+    
+    public Object evaluate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+
+        try
+        {
+            Calendar o1 = (Calendar) _lhsExp.evaluate();
+            Calendar o2 = (Calendar) _rhsExp.evaluate();
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+            
+            return new Boolean(o1.after(o2));
+        }
+        catch (Exception e)
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + e.toString());
+            
+            throw new SPLException("evaluation error: " + e.toString());
+        }
+    }
+    
+    public boolean validate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+
+        TypeInfo lType = _lhsExp.getType();
+        TypeInfo rType = _rhsExp.getType();
+        
+        if (!lType.getIsArray() && !rType.getIsArray() &&
+        		TypeResolver.isCalendar(lType) && TypeResolver.isCalendar(rType))
+        {
+            _dataType.setType(TypeConstants.booleanType);
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+            
+            return true;
+        }
+        else
+        {
+        	throw new SPLException("Invalid input types " + lType + rType + "for isAfter");
+        }
+
+        
+    }
+    
+    public String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+
+        String str = "isAfter("+this._lhsExp.toString() + "," + this._rhsExp.toString() +")";
+        	
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+       
+        return str;
+    }
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/IsAfter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/IsBefore.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/IsBefore.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/IsBefore.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/IsBefore.java Fri Jan 11 10:56:30 2008
@@ -1,121 +1,121 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Prashant Baliga <prabalig@in.ibm.com>
- *
- */
-package org.apache.imperius.spl.parser.expressions.impl;
-
-import java.util.Calendar;
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.TypeConstants;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.expressions.BooleanExpression;
-import org.apache.imperius.spl.parser.expressions.DoubleArgumentExpression;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.spl.parser.util.TypeResolver;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class IsBefore extends DoubleArgumentExpression implements
-        BooleanExpression
-{
-    
-    public static final String className = IsBefore.class.getName();
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="IsBefore";
-    
-    
-    
-    public IsBefore(List exprList, boolean validateExpression)
-            throws SPLException
-    {
-        super(exprList);
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "IsBefore");
-
-        if (validateExpression)
-        {
-            if (!validate())
-            {
-                logger.severe(Thread.currentThread().getName()+" "+"validation error: " + className
-                        + " has wrong data type passed in.");
-                
-                throw new SPLException("validation error: " + className
-                        + " has wrong data type passed in.");
-            }
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "IsBefore");
-        
-    }
-    
-    public Object evaluate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-
-        try
-        {
-            Calendar o1 = (Calendar) _lhsExp.evaluate();
-            Calendar o2 = (Calendar) _rhsExp.evaluate();
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-            
-            return new Boolean(o1.before(o2));
-        }
-        catch (Exception e)
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + e.toString());
-            
-            throw new SPLException("evaluation error: " + e.toString());
-        }
-    }
-    
-    public boolean validate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-
-        TypeInfo lType = _lhsExp.getType();
-        TypeInfo rType = _rhsExp.getType();
-        
-        if (!lType.getIsArray() && !rType.getIsArray() &&
-        		TypeResolver.isCalendar(lType) && TypeResolver.isCalendar(rType))
-        {
-            _dataType.setType(TypeConstants.booleanType);
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-            
-            return true;
-        }
-        else
-        {
-        	throw new SPLException("Invalid input types " + lType + rType + "for isbefore");
-        }
-
-        
-    }
-    
-    public String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-
-        String str = "isBefore("+this._lhsExp.toString() + "," + this._rhsExp.toString() +")";
-        	
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
-    }
-    
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Prashant Baliga <prabalig@in.ibm.com>
+ *
+ */
+package org.apache.imperius.spl.parser.expressions.impl;
+
+import java.util.Calendar;
+import java.util.List;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.TypeConstants;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.expressions.BooleanExpression;
+import org.apache.imperius.spl.parser.expressions.DoubleArgumentExpression;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.spl.parser.util.TypeResolver;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class IsBefore extends DoubleArgumentExpression implements
+        BooleanExpression
+{
+    
+    public static final String className = IsBefore.class.getName();
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="IsBefore";
+    
+    
+    
+    public IsBefore(List exprList, boolean validateExpression)
+            throws SPLException
+    {
+        super(exprList);
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "IsBefore");
+
+        if (validateExpression)
+        {
+            if (!validate())
+            {
+                logger.severe(Thread.currentThread().getName()+" "+"validation error: " + className
+                        + " has wrong data type passed in.");
+                
+                throw new SPLException("validation error: " + className
+                        + " has wrong data type passed in.");
+            }
+        }
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "IsBefore");
+        
+    }
+    
+    public Object evaluate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+
+        try
+        {
+            Calendar o1 = (Calendar) _lhsExp.evaluate();
+            Calendar o2 = (Calendar) _rhsExp.evaluate();
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+            
+            return new Boolean(o1.before(o2));
+        }
+        catch (Exception e)
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + e.toString());
+            
+            throw new SPLException("evaluation error: " + e.toString());
+        }
+    }
+    
+    public boolean validate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+
+        TypeInfo lType = _lhsExp.getType();
+        TypeInfo rType = _rhsExp.getType();
+        
+        if (!lType.getIsArray() && !rType.getIsArray() &&
+        		TypeResolver.isCalendar(lType) && TypeResolver.isCalendar(rType))
+        {
+            _dataType.setType(TypeConstants.booleanType);
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+            
+            return true;
+        }
+        else
+        {
+        	throw new SPLException("Invalid input types " + lType + rType + "for isbefore");
+        }
+
+        
+    }
+    
+    public String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+
+        String str = "isBefore("+this._lhsExp.toString() + "," + this._rhsExp.toString() +")";
+        	
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+       
+        return str;
+    }
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/IsBefore.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/IsWithin.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/IsWithin.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/IsWithin.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/IsWithin.java Fri Jan 11 10:56:30 2008
@@ -1,132 +1,132 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Xiping Wang
- * @modified Neeraj Joshi
- *
- */
-package org.apache.imperius.spl.parser.expressions.impl;
-
-import java.util.Calendar;
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.TypeConstants;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.expressions.BooleanExpression;
-import org.apache.imperius.spl.parser.expressions.TripleArgumentExpression;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.spl.parser.util.TypeResolver;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class IsWithin extends TripleArgumentExpression implements
-        BooleanExpression
-{
-    
-    public static final String className = IsWithin.class.getName();
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="IsWithin";
-    
-    
-    
-    public IsWithin(List exprList, boolean validateExpression)
-            throws SPLException
-    {
-        super(exprList);
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "IsWithin");
-
-        if (validateExpression)
-        {
-            if (!validate())
-            {
-                logger.severe(Thread.currentThread().getName()+" "+"validation error: " + className
-                        + " has wrong data type passed in.");
-                
-                throw new SPLException("validation error: " + className
-                        + " has wrong data type passed in.");
-            }
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "IsWithin");
-        
-    }
-    
-    public Object evaluate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-
-        try
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-            
-            return new Boolean(_isWithin((Calendar) _lhsExp.evaluate(),
-                    (Calendar) _midExp.evaluate(), (Calendar) _rhsExp.evaluate()));
-        }
-        catch (Exception e)
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + e.toString());
-            
-            throw new SPLException("evaluation error: " + e.toString());
-        }
-    }
-    
-    private boolean _isWithin(Calendar date, Calendar startDate, Calendar endDate)
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isWithin");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isWithin");
-     
-        return !(date.before(startDate) || date.after(endDate));
-    }
-    
-    public boolean validate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-
-        TypeInfo lType = _lhsExp.getType();
-        TypeInfo mType = _midExp.getType();
-        TypeInfo rType = _rhsExp.getType();
-        
-        if (!lType.getIsArray() && !mType.getIsArray() && !rType.getIsArray() &&
-        		TypeResolver.isCalendar(lType) && TypeResolver.isCalendar(mType)
-                && TypeResolver.isCalendar(rType))
-        {
-            _dataType.setType(TypeConstants.booleanType);
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-            
-            return true;
-        }
-        else
-        {
-        	throw new SPLException("Invalid input types " + lType + rType + mType + "for isWithin");
-        }
-
-        
-    }
-    
-    public String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-
-        String str = "isWithin("+this._lhsExp.toString() + "," + this._midExp.toString() + "," + this._rhsExp.toString() +")";
-        	
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
-    }
-    
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Xiping Wang
+ * @modified Neeraj Joshi
+ *
+ */
+package org.apache.imperius.spl.parser.expressions.impl;
+
+import java.util.Calendar;
+import java.util.List;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.TypeConstants;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.expressions.BooleanExpression;
+import org.apache.imperius.spl.parser.expressions.TripleArgumentExpression;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.spl.parser.util.TypeResolver;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class IsWithin extends TripleArgumentExpression implements
+        BooleanExpression
+{
+    
+    public static final String className = IsWithin.class.getName();
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="IsWithin";
+    
+    
+    
+    public IsWithin(List exprList, boolean validateExpression)
+            throws SPLException
+    {
+        super(exprList);
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "IsWithin");
+
+        if (validateExpression)
+        {
+            if (!validate())
+            {
+                logger.severe(Thread.currentThread().getName()+" "+"validation error: " + className
+                        + " has wrong data type passed in.");
+                
+                throw new SPLException("validation error: " + className
+                        + " has wrong data type passed in.");
+            }
+        }
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "IsWithin");
+        
+    }
+    
+    public Object evaluate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+
+        try
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+            
+            return new Boolean(_isWithin((Calendar) _lhsExp.evaluate(),
+                    (Calendar) _midExp.evaluate(), (Calendar) _rhsExp.evaluate()));
+        }
+        catch (Exception e)
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + e.toString());
+            
+            throw new SPLException("evaluation error: " + e.toString());
+        }
+    }
+    
+    private boolean _isWithin(Calendar date, Calendar startDate, Calendar endDate)
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isWithin");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isWithin");
+     
+        return !(date.before(startDate) || date.after(endDate));
+    }
+    
+    public boolean validate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+
+        TypeInfo lType = _lhsExp.getType();
+        TypeInfo mType = _midExp.getType();
+        TypeInfo rType = _rhsExp.getType();
+        
+        if (!lType.getIsArray() && !mType.getIsArray() && !rType.getIsArray() &&
+        		TypeResolver.isCalendar(lType) && TypeResolver.isCalendar(mType)
+                && TypeResolver.isCalendar(rType))
+        {
+            _dataType.setType(TypeConstants.booleanType);
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+            
+            return true;
+        }
+        else
+        {
+        	throw new SPLException("Invalid input types " + lType + rType + mType + "for isWithin");
+        }
+
+        
+    }
+    
+    public String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+
+        String str = "isWithin("+this._lhsExp.toString() + "," + this._midExp.toString() + "," + this._rhsExp.toString() +")";
+        	
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+       
+        return str;
+    }
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/IsWithin.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LeftSubstring.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LeftSubstring.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LeftSubstring.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LeftSubstring.java Fri Jan 11 10:56:30 2008
@@ -1,274 +1,274 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Xiping Wang
- * @modified Neeraj Joshi
- *
- */
-package org.apache.imperius.spl.parser.expressions.impl;
-
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.TypeConstants;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.expressions.StringExpression;
-import org.apache.imperius.spl.parser.expressions.TripleArgumentExpression;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.spl.parser.util.TypeResolver;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class LeftSubstring extends TripleArgumentExpression implements
-        StringExpression
-{
-    
-    public static final String className = LeftSubstring.class.getName();
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="LeftSubstring";
-    
-    
-    
-    public LeftSubstring(List exprList, boolean validateExpression)
-            throws SPLException
-    {
-        super(exprList);
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "LeftSubstring");
-
-        if (validateExpression)
-        {
-            if (!validate())
-            {
-                logger.severe(Thread.currentThread().getName()+" "+"validation error: " + className
-                        + " has wrong data type passed in.");
-                
-                throw new SPLException("validation error: " + className
-                        + " has wrong data type passed in.");
-            }
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "LeftSubstring");
-        
-    }
-    
-    public Object evaluate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-
-        try
-        {
-            String o1 = (String) _lhsExp.evaluate();
-            Object o2 = _midExp.evaluate();
-            String o3 = (String) _rhsExp.evaluate();
-            
-            boolean leftToRight;
-            if (o3.equals("LeftToRight"))
-            {
-                leftToRight = true;
-            }
-            else if (o3.equals("RightToLeft"))
-            {
-                leftToRight = false;
-            }
-            else
-            {
-                logger.severe(
-                "Illegal direction argument.");
-                
-                throw new IllegalArgumentException(
-                        "Illegal direction argument.");
-            }
-            
-            if (o2 instanceof String)
-            {
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-                String sub = _leftSubstring(o1, (String) o2, leftToRight); 
-                return sub;
-            }
-            else
-            {
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-                String sub = _leftSubstring(o1, ((Number) o2).intValue(), leftToRight); 
-                return sub;
-            }
-        }
-        catch (Exception e)
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + e.toString());
-            
-            throw new SPLException("evaluation error: " + e.toString());
-        }
-    }
-    
-    /**
-     * Returns a specified LeftSubstring from a string. If
-     * directionLeftToRight=true, numberChars is the number of characters to
-     * return starting from the left. If the number is 2, the first two
-     * characters of the string are returned; if the number is 5, the first five
-     * characters are returned, and so on. If the number is negative, the entire
-     * string is returned. If instead the directionLeftToRight=false,
-     * numberChars is the number of characters to skip counting from right to
-     * left. All the characters to the left of that number of characters are
-     * returned. If the number is negative, the empty string is returned.<br>
-     * Examples: LeftSubstring("AutonomicComputing", 4, LeftToRight) = "Auto".
-     * LeftSubstring("AutonomicComputing", 4, RightToLeft) = "AutonomicCompu".
-     * 
-     * @param string
-     * @param numberChars
-     * @param directionLeftToRight
-     * 
-     * @return the resulting substring
-     */
-    private String _leftSubstring(String string, int numberChars,
-            boolean directionLeftToRight)
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
-
-        
-        if (directionLeftToRight)
-        {
-            if (numberChars < 0)
-            {
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
-                
-                return string;
-            }
-            else if (numberChars > string.length())
-            {
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
-                
-                return string;
-            }
-            else
-            {
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
-                
-                return string.substring(0, numberChars);
-            }
-        }
-        else
-        {
-            if (numberChars < 0)
-            {
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
-                
-                return "";
-            }
-            else if (numberChars > string.length())
-            {
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
-                
-                return string;
-            }
-            else
-            {
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
-                
-                return string.substring(0, string.length() - numberChars);
-            }
-        }
-    }
-    
-    /**
-     * Returns a specified LeftSubstring from a string. LeftSubstring returns
-     * the characters from the String the left of the startString, not including
-     * the startString characters. If directionLeftToRight=true, then it finds
-     * startString by searching the String from left to right. If
-     * directionLeftToRight=false, then it finds StartString by searching the
-     * String from right to left. If the StartString is not found in the String,
-     * then an empty string is returned.<br>
-     * Examples: LeftSubstring("AutonomicComputing", "om", LeftToRight)="Auton"
-     * LeftSubstring("AutonomicComputing", "om", RightToLeft)="AutonomicC"
-     * 
-     * @param string
-     * @param startString
-     * @param directionLeftToRight
-     * 
-     * @return the resulting substring
-     */
-    private String _leftSubstring(String string, String startString,
-            boolean directionLeftToRight)
-    {
-
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
-
-        int offsetpoint; // Position of the beginning of the startString
-        
-        if (directionLeftToRight)
-        {
-            offsetpoint = string.indexOf(startString);
-            if (offsetpoint < 0)
-            {
-                // Did not find the string
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
-                
-                return "";
-            }
-        }
-        else
-        {
-            offsetpoint = string.lastIndexOf(startString);
-            if (offsetpoint < 0)
-            {
-                // Did not find the string
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
-                
-                return "";
-            }
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
-        
-        return string.substring(0, offsetpoint);
-    }
-    
-    public boolean validate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-
-        TypeInfo lType = _lhsExp.getType();
-        TypeInfo mType = _midExp.getType();
-        TypeInfo rType = _rhsExp.getType();
-        
-        if (!lType.getIsArray() && !mType.getIsArray() && 
-        		!rType.getIsArray() && TypeResolver.isString(lType) && 
-        		(TypeResolver.isString(mType) || TypeResolver
-                        .isNumeric(mType)) && TypeResolver.isString(rType))
-        {
-            _dataType.setType(TypeConstants.stringType);
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-            
-            return true;
-        }
-        else
-        {
-        	throw new SPLException("Invalid input types " + lType + rType + mType + "for leftsubstring");
-        }
-
-        
-    }
-    
-    public String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-
-        String str = "LeftSubstring("+this._lhsExp.toString() + "," + this._midExp.toString() + "," + this._rhsExp.toString() +")";
-        	
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
-    }
-    
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Xiping Wang
+ * @modified Neeraj Joshi
+ *
+ */
+package org.apache.imperius.spl.parser.expressions.impl;
+
+import java.util.List;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.TypeConstants;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.expressions.StringExpression;
+import org.apache.imperius.spl.parser.expressions.TripleArgumentExpression;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.spl.parser.util.TypeResolver;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class LeftSubstring extends TripleArgumentExpression implements
+        StringExpression
+{
+    
+    public static final String className = LeftSubstring.class.getName();
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="LeftSubstring";
+    
+    
+    
+    public LeftSubstring(List exprList, boolean validateExpression)
+            throws SPLException
+    {
+        super(exprList);
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "LeftSubstring");
+
+        if (validateExpression)
+        {
+            if (!validate())
+            {
+                logger.severe(Thread.currentThread().getName()+" "+"validation error: " + className
+                        + " has wrong data type passed in.");
+                
+                throw new SPLException("validation error: " + className
+                        + " has wrong data type passed in.");
+            }
+        }
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "LeftSubstring");
+        
+    }
+    
+    public Object evaluate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+
+        try
+        {
+            String o1 = (String) _lhsExp.evaluate();
+            Object o2 = _midExp.evaluate();
+            String o3 = (String) _rhsExp.evaluate();
+            
+            boolean leftToRight;
+            if (o3.equals("LeftToRight"))
+            {
+                leftToRight = true;
+            }
+            else if (o3.equals("RightToLeft"))
+            {
+                leftToRight = false;
+            }
+            else
+            {
+                logger.severe(
+                "Illegal direction argument.");
+                
+                throw new IllegalArgumentException(
+                        "Illegal direction argument.");
+            }
+            
+            if (o2 instanceof String)
+            {
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+                String sub = _leftSubstring(o1, (String) o2, leftToRight); 
+                return sub;
+            }
+            else
+            {
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+                String sub = _leftSubstring(o1, ((Number) o2).intValue(), leftToRight); 
+                return sub;
+            }
+        }
+        catch (Exception e)
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + e.toString());
+            
+            throw new SPLException("evaluation error: " + e.toString());
+        }
+    }
+    
+    /**
+     * Returns a specified LeftSubstring from a string. If
+     * directionLeftToRight=true, numberChars is the number of characters to
+     * return starting from the left. If the number is 2, the first two
+     * characters of the string are returned; if the number is 5, the first five
+     * characters are returned, and so on. If the number is negative, the entire
+     * string is returned. If instead the directionLeftToRight=false,
+     * numberChars is the number of characters to skip counting from right to
+     * left. All the characters to the left of that number of characters are
+     * returned. If the number is negative, the empty string is returned.<br>
+     * Examples: LeftSubstring("AutonomicComputing", 4, LeftToRight) = "Auto".
+     * LeftSubstring("AutonomicComputing", 4, RightToLeft) = "AutonomicCompu".
+     * 
+     * @param string
+     * @param numberChars
+     * @param directionLeftToRight
+     * 
+     * @return the resulting substring
+     */
+    private String _leftSubstring(String string, int numberChars,
+            boolean directionLeftToRight)
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
+
+        
+        if (directionLeftToRight)
+        {
+            if (numberChars < 0)
+            {
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
+                
+                return string;
+            }
+            else if (numberChars > string.length())
+            {
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
+                
+                return string;
+            }
+            else
+            {
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
+                
+                return string.substring(0, numberChars);
+            }
+        }
+        else
+        {
+            if (numberChars < 0)
+            {
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
+                
+                return "";
+            }
+            else if (numberChars > string.length())
+            {
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
+                
+                return string;
+            }
+            else
+            {
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
+                
+                return string.substring(0, string.length() - numberChars);
+            }
+        }
+    }
+    
+    /**
+     * Returns a specified LeftSubstring from a string. LeftSubstring returns
+     * the characters from the String the left of the startString, not including
+     * the startString characters. If directionLeftToRight=true, then it finds
+     * startString by searching the String from left to right. If
+     * directionLeftToRight=false, then it finds StartString by searching the
+     * String from right to left. If the StartString is not found in the String,
+     * then an empty string is returned.<br>
+     * Examples: LeftSubstring("AutonomicComputing", "om", LeftToRight)="Auton"
+     * LeftSubstring("AutonomicComputing", "om", RightToLeft)="AutonomicC"
+     * 
+     * @param string
+     * @param startString
+     * @param directionLeftToRight
+     * 
+     * @return the resulting substring
+     */
+    private String _leftSubstring(String string, String startString,
+            boolean directionLeftToRight)
+    {
+
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
+
+        int offsetpoint; // Position of the beginning of the startString
+        
+        if (directionLeftToRight)
+        {
+            offsetpoint = string.indexOf(startString);
+            if (offsetpoint < 0)
+            {
+                // Did not find the string
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
+                
+                return "";
+            }
+        }
+        else
+        {
+            offsetpoint = string.lastIndexOf(startString);
+            if (offsetpoint < 0)
+            {
+                // Did not find the string
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
+                
+                return "";
+            }
+        }
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "leftSubstring");
+        
+        return string.substring(0, offsetpoint);
+    }
+    
+    public boolean validate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+
+        TypeInfo lType = _lhsExp.getType();
+        TypeInfo mType = _midExp.getType();
+        TypeInfo rType = _rhsExp.getType();
+        
+        if (!lType.getIsArray() && !mType.getIsArray() && 
+        		!rType.getIsArray() && TypeResolver.isString(lType) && 
+        		(TypeResolver.isString(mType) || TypeResolver
+                        .isNumeric(mType)) && TypeResolver.isString(rType))
+        {
+            _dataType.setType(TypeConstants.stringType);
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+            
+            return true;
+        }
+        else
+        {
+        	throw new SPLException("Invalid input types " + lType + rType + mType + "for leftsubstring");
+        }
+
+        
+    }
+    
+    public String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+
+        String str = "LeftSubstring("+this._lhsExp.toString() + "," + this._midExp.toString() + "," + this._rhsExp.toString() +")";
+        	
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+       
+        return str;
+    }
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LeftSubstring.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Less.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Less.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Less.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Less.java Fri Jan 11 10:56:30 2008
@@ -1,143 +1,143 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Neeraj Joshi
- *
- */
-package org.apache.imperius.spl.parser.expressions.impl;
-
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.TypeConstants;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.expressions.BooleanExpression;
-import org.apache.imperius.spl.parser.expressions.DoubleArgumentExpression;
-import org.apache.imperius.spl.parser.util.ExpressionUtility;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.spl.parser.util.TypeResolver;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class Less extends DoubleArgumentExpression implements BooleanExpression
-{
-    
-    public static final String className = Less.class.getName();
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="DoubleArgumentExpression";
-    
-    
-    
-    public Less(List exprList, boolean validateExpression)
-            throws SPLException
-    {
-        super(exprList);
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "Less");
-
-        if (validateExpression)
-        {
-            if (!validate())
-            {
-                logger.severe(Thread.currentThread().getName()+" "+"validation error: " + className
-                        + " has wrong data type passed in.");
-                
-                throw new SPLException("validation error: " + className
-                        + " has wrong data type passed in.");
-            }
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "Less");
-        
-    }
-    
-    public Object evaluate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-
-        try
-        {
-           //System.out.println("Less::LHS type: RHS type ::" + lhsExp.getType()+ ":" + rhsExp.getType());
-            Object lhsValue = _lhsExp.evaluate();
-            Object rhsValue = _rhsExp.evaluate();
-           //System.out.println("Less::after Evaluation LHS: RHS ::" + lhsValue+ ":" + rhsValue);
-            
-            if (ExpressionUtility.compare(lhsValue, rhsValue) < 0)
-            {
-               //System.out.println("Less::True");
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-                
-                return Boolean.TRUE;
-            }
-            else
-            {
-               //System.out.println("Less::False");
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-                
-                return Boolean.FALSE;
-            }
-        }
-        catch (Exception e)
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + e.toString());
-            
-            throw new SPLException("evaluation error: " + e.toString());
-        }
-    }
-    
-    public boolean validate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-
-        TypeInfo lType = _lhsExp.getType();
-        TypeInfo rType = _rhsExp.getType();
-       //System.out.println("Less:validate:TypeResolver.isNumeric(lType)"+ TypeResolver.isNumeric(lType));
-       //System.out.println("Less:validate:TypeResolver.isNumeric(rType)"+ TypeResolver.isNumeric(rType));
-        if(!lType.getIsArray() && !rType.getIsArray())
-        {	
-	        if (TypeResolver.isTypeAssignableForRelation(lType, rType))
-	        {
-	            _dataType.setType(TypeConstants.booleanType);
-	            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-	            
-	            return true;
-	        }
-	        if ((TypeResolver.isCalendar(lType))
-	                && (TypeResolver.isCalendar(rType)))
-	        {
-	            _dataType.setType(TypeConstants.booleanType);
-	            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-	            
-	            return true;
-	        }
-        }    
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-     
-        return false;
-    }
-    
-    public String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-
-        String str = this._lhsExp.toString() + "<" + this._rhsExp.toString();
-        	
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
-    }
-    
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Neeraj Joshi
+ *
+ */
+package org.apache.imperius.spl.parser.expressions.impl;
+
+import java.util.List;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.TypeConstants;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.expressions.BooleanExpression;
+import org.apache.imperius.spl.parser.expressions.DoubleArgumentExpression;
+import org.apache.imperius.spl.parser.util.ExpressionUtility;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.spl.parser.util.TypeResolver;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class Less extends DoubleArgumentExpression implements BooleanExpression
+{
+    
+    public static final String className = Less.class.getName();
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="DoubleArgumentExpression";
+    
+    
+    
+    public Less(List exprList, boolean validateExpression)
+            throws SPLException
+    {
+        super(exprList);
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "Less");
+
+        if (validateExpression)
+        {
+            if (!validate())
+            {
+                logger.severe(Thread.currentThread().getName()+" "+"validation error: " + className
+                        + " has wrong data type passed in.");
+                
+                throw new SPLException("validation error: " + className
+                        + " has wrong data type passed in.");
+            }
+        }
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "Less");
+        
+    }
+    
+    public Object evaluate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+
+        try
+        {
+           //System.out.println("Less::LHS type: RHS type ::" + lhsExp.getType()+ ":" + rhsExp.getType());
+            Object lhsValue = _lhsExp.evaluate();
+            Object rhsValue = _rhsExp.evaluate();
+           //System.out.println("Less::after Evaluation LHS: RHS ::" + lhsValue+ ":" + rhsValue);
+            
+            if (ExpressionUtility.compare(lhsValue, rhsValue) < 0)
+            {
+               //System.out.println("Less::True");
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+                
+                return Boolean.TRUE;
+            }
+            else
+            {
+               //System.out.println("Less::False");
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+                
+                return Boolean.FALSE;
+            }
+        }
+        catch (Exception e)
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + e.toString());
+            
+            throw new SPLException("evaluation error: " + e.toString());
+        }
+    }
+    
+    public boolean validate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+
+        TypeInfo lType = _lhsExp.getType();
+        TypeInfo rType = _rhsExp.getType();
+       //System.out.println("Less:validate:TypeResolver.isNumeric(lType)"+ TypeResolver.isNumeric(lType));
+       //System.out.println("Less:validate:TypeResolver.isNumeric(rType)"+ TypeResolver.isNumeric(rType));
+        if(!lType.getIsArray() && !rType.getIsArray())
+        {	
+	        if (TypeResolver.isTypeAssignableForRelation(lType, rType))
+	        {
+	            _dataType.setType(TypeConstants.booleanType);
+	            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+	            
+	            return true;
+	        }
+	        if ((TypeResolver.isCalendar(lType))
+	                && (TypeResolver.isCalendar(rType)))
+	        {
+	            _dataType.setType(TypeConstants.booleanType);
+	            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+	            
+	            return true;
+	        }
+        }    
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+     
+        return false;
+    }
+    
+    public String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+
+        String str = this._lhsExp.toString() + "<" + this._rhsExp.toString();
+        	
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+       
+        return str;
+    }
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Less.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message