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 [14/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/AvrgInCollection.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/AvrgInCollection.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/AvrgInCollection.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/AvrgInCollection.java Fri Jan 11 10:56:30 2008
@@ -1,201 +1,201 @@
-/*
- * 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.SPLException;
-import org.apache.imperius.spl.parser.expressions.SingleArgumentExpression;
-import org.apache.imperius.spl.parser.util.ExpressionUtility;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class AvrgInCollection extends SingleArgumentExpression implements
-        Expression
-{
-    
-    public String className = AvrgInCollection.class.toString();
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="AvrgInCollection";
-    
-    
-    
-    public AvrgInCollection(List exprList, boolean evaluateExpression)
-            throws SPLException
-    {
-        super(exprList);
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "AvrgInCollection");
-
-        //System.out.println("AvrgInCollection");
-        if (evaluateExpression)
-        {
-            //System.out.println("evaluateExpression " + evaluateExpression);
-            if (!validate())
-            {
-               logger.severe(Thread.currentThread().getName()+" "
-            		   +"validation error: wrong data type passed in "
-                       + this._dataType);
-               
-                throw new SPLException(
-                        "validation error: wrong data type passed in "
-                                + this._dataType);
-            }
-        }
-        
-        this._dataType.copy(this._exp.getType());
-        _dataType.setIsArray(false);
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "AvrgInCollection");
-     
-    }
-    
-    public Object evaluate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-
-        //System.out.println("AvrgInCollection:evaluate");
-        //System.out.println("this.exp class " + this.exp.getClass() + " type "+ this.exp.getType());
-        Object avrgInCollection = null;
-        Object expResult = this._exp.evaluate();
-        if (!(expResult instanceof java.util.List))
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"result of expression is not of type List");
-            throw new SPLException(
-                    "result of expression is not of type List");
-        }
-        ArrayList resultArray = (ArrayList) expResult;
-        Integer size = new Integer(resultArray.size());
-        //System.out.println("resultArray size " + resultArray.size() + " to string " + resultArray.toString());
-        if ((resultArray != null) && (!resultArray.isEmpty()))
-        {
-            Iterator resultIt = resultArray.iterator();
-            while (resultIt.hasNext())
-            {
-                Object resultObject = resultIt.next();
-                //System.out.println("resultObject,class " + resultObject + " " + resultObject.getClass());
-                if (avrgInCollection == null)
-                {
-                    avrgInCollection = resultObject;
-                }
-                else
-                {
-                    //System.out.println("Adding resultObject to sum  "+ resultObject + "  " + avrgInCollection);
-                    avrgInCollection = ExpressionUtility.plus(
-                            (Number) avrgInCollection, (Number) resultObject);
-                }
-                //System.out.println("current sum is " + avrgInCollection);
-            }
-            //System.out.println("sum ,Array size " + avrgInCollection + " " + size);
-            avrgInCollection = ExpressionUtility.division(
-                    (Number) avrgInCollection, (Number) size);
-            //System.out.println("AvrgInCollection=" + avrgInCollection);
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-            
-            return avrgInCollection;
-        }
-        else
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"result Array is empty");
-            throw new SPLException("result Array is empty");
-        }
-        
-    }
-    
-    public boolean validate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-
-        //System.out.println("AvrgInCollection : validate ");
-        //System.out.println("this.exp.getClass() " + this.exp.getClass()+ " type " + this.exp.getType());
-        
-        if (!this._exp.isArray())
-        {
-            //System.out.println("expression is not a valid BasicCollectExpression");
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-            
-            return false;
-        }
-        
-        else
-        {
-            //System.out.println("expression is a valid BasicCollectExpression");
-            switch (this._exp.getType().getType())
-            {
-                case TypeConstants.byteType:
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-                    
-                    return true;
-                case TypeConstants.doubleType:
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-                    
-                    return true;
-                case TypeConstants.floatType:
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-                    
-                    return true;
-                case TypeConstants.intType:
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-                    
-                    return true;
-                case TypeConstants.longType:
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-                    
-                    return true;
-                case TypeConstants.numericType:
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-                    
-                    return true;
-                case TypeConstants.shortType:
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-                    
-                    return true;
-                default:
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-                
-                    return false;
-            }
-            
-        }
-        
-    }
-
-	public String getReferenceTypeName() throws SPLException {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	
-    public String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-
-        String str = "AverageInCollection("+ this._exp.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.SPLException;
+import org.apache.imperius.spl.parser.expressions.SingleArgumentExpression;
+import org.apache.imperius.spl.parser.util.ExpressionUtility;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class AvrgInCollection extends SingleArgumentExpression implements
+        Expression
+{
+    
+    public String className = AvrgInCollection.class.toString();
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="AvrgInCollection";
+    
+    
+    
+    public AvrgInCollection(List exprList, boolean evaluateExpression)
+            throws SPLException
+    {
+        super(exprList);
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "AvrgInCollection");
+
+        //System.out.println("AvrgInCollection");
+        if (evaluateExpression)
+        {
+            //System.out.println("evaluateExpression " + evaluateExpression);
+            if (!validate())
+            {
+               logger.severe(Thread.currentThread().getName()+" "
+            		   +"validation error: wrong data type passed in "
+                       + this._dataType);
+               
+                throw new SPLException(
+                        "validation error: wrong data type passed in "
+                                + this._dataType);
+            }
+        }
+        
+        this._dataType.copy(this._exp.getType());
+        _dataType.setIsArray(false);
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "AvrgInCollection");
+     
+    }
+    
+    public Object evaluate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+
+        //System.out.println("AvrgInCollection:evaluate");
+        //System.out.println("this.exp class " + this.exp.getClass() + " type "+ this.exp.getType());
+        Object avrgInCollection = null;
+        Object expResult = this._exp.evaluate();
+        if (!(expResult instanceof java.util.List))
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"result of expression is not of type List");
+            throw new SPLException(
+                    "result of expression is not of type List");
+        }
+        ArrayList resultArray = (ArrayList) expResult;
+        Integer size = new Integer(resultArray.size());
+        //System.out.println("resultArray size " + resultArray.size() + " to string " + resultArray.toString());
+        if ((resultArray != null) && (!resultArray.isEmpty()))
+        {
+            Iterator resultIt = resultArray.iterator();
+            while (resultIt.hasNext())
+            {
+                Object resultObject = resultIt.next();
+                //System.out.println("resultObject,class " + resultObject + " " + resultObject.getClass());
+                if (avrgInCollection == null)
+                {
+                    avrgInCollection = resultObject;
+                }
+                else
+                {
+                    //System.out.println("Adding resultObject to sum  "+ resultObject + "  " + avrgInCollection);
+                    avrgInCollection = ExpressionUtility.plus(
+                            (Number) avrgInCollection, (Number) resultObject);
+                }
+                //System.out.println("current sum is " + avrgInCollection);
+            }
+            //System.out.println("sum ,Array size " + avrgInCollection + " " + size);
+            avrgInCollection = ExpressionUtility.division(
+                    (Number) avrgInCollection, (Number) size);
+            //System.out.println("AvrgInCollection=" + avrgInCollection);
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+            
+            return avrgInCollection;
+        }
+        else
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"result Array is empty");
+            throw new SPLException("result Array is empty");
+        }
+        
+    }
+    
+    public boolean validate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+
+        //System.out.println("AvrgInCollection : validate ");
+        //System.out.println("this.exp.getClass() " + this.exp.getClass()+ " type " + this.exp.getType());
+        
+        if (!this._exp.isArray())
+        {
+            //System.out.println("expression is not a valid BasicCollectExpression");
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+            
+            return false;
+        }
+        
+        else
+        {
+            //System.out.println("expression is a valid BasicCollectExpression");
+            switch (this._exp.getType().getType())
+            {
+                case TypeConstants.byteType:
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+                    
+                    return true;
+                case TypeConstants.doubleType:
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+                    
+                    return true;
+                case TypeConstants.floatType:
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+                    
+                    return true;
+                case TypeConstants.intType:
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+                    
+                    return true;
+                case TypeConstants.longType:
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+                    
+                    return true;
+                case TypeConstants.numericType:
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+                    
+                    return true;
+                case TypeConstants.shortType:
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+                    
+                    return true;
+                default:
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+                
+                    return false;
+            }
+            
+        }
+        
+    }
+
+	public String getReferenceTypeName() throws SPLException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	
+    public String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+
+        String str = "AverageInCollection("+ this._exp.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/AvrgInCollection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/BooleanConstant.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/BooleanConstant.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/BooleanConstant.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/BooleanConstant.java Fri Jan 11 10:56:30 2008
@@ -1,99 +1,99 @@
-/*
- * 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.BooleanExpression;
-import org.apache.imperius.spl.parser.expressions.ConstantExpression;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class BooleanConstant extends ConstantExpression implements
-        BooleanExpression
-{
-    private boolean _boolVal = false;
-    
-    private TypeInfo _dataType=new TypeInfo();
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="BooleanConstant";
-    
-    
-    
-    public boolean isArray()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-     
-        
-        return _dataType.getIsArray();
-    }
-    
-    public BooleanConstant(boolean val) 
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "BooleanConstant");
-
-        this._boolVal = val;
-        _dataType.setType(TypeConstants.booleanType);
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "BooleanConstant");
-        
-    }
-    
-    public Object evaluate()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-     
-        return new Boolean(_boolVal);
-    }
-    
-    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=Boolean.toString(this._boolVal);
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
-    }
-
-	public String getReferenceTypeName() throws SPLException 
-	{
-		// TODO Auto-generated method stub
-		return null;
-	}
-    
-}
+/*
+ * 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.BooleanExpression;
+import org.apache.imperius.spl.parser.expressions.ConstantExpression;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class BooleanConstant extends ConstantExpression implements
+        BooleanExpression
+{
+    private boolean _boolVal = false;
+    
+    private TypeInfo _dataType=new TypeInfo();
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="BooleanConstant";
+    
+    
+    
+    public boolean isArray()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+     
+        
+        return _dataType.getIsArray();
+    }
+    
+    public BooleanConstant(boolean val) 
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "BooleanConstant");
+
+        this._boolVal = val;
+        _dataType.setType(TypeConstants.booleanType);
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "BooleanConstant");
+        
+    }
+    
+    public Object evaluate()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+     
+        return new Boolean(_boolVal);
+    }
+    
+    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=Boolean.toString(this._boolVal);
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+       
+        return str;
+    }
+
+	public String getReferenceTypeName() throws SPLException 
+	{
+		// TODO Auto-generated method stub
+		return null;
+	}
+    
+}

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

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/ByteConstant.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/ByteConstant.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/ByteConstant.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/ByteConstant.java Fri Jan 11 10:56:30 2008
@@ -1,100 +1,100 @@
-/*
- * 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 ByteConstant extends ConstantExpression implements
-        NumericExpression
-{
-    
-    private byte _byteValue;
-    
-    private TypeInfo _dataType=new TypeInfo() ;
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="ByteConstant";
-    
-    
-    
-    public boolean isArray()
-    {
-
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-     
-        return _dataType.getIsArray();
-    }
-    
-    public ByteConstant(byte val) 
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "ByteConstant");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "ByteConstant");
-        _dataType.setType(TypeConstants.byteType);
-     
-        this._byteValue = val;
-    }
-    
-    public Object evaluate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-     
-        return new Byte(_byteValue);
-    }
-    
-    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=Byte.toString(this._byteValue);
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
-    }
-
-	public String getReferenceTypeName() throws SPLException {
-		// TODO Auto-generated method stub
-		return null;
-	}
-    
-}
+/*
+ * 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 ByteConstant extends ConstantExpression implements
+        NumericExpression
+{
+    
+    private byte _byteValue;
+    
+    private TypeInfo _dataType=new TypeInfo() ;
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="ByteConstant";
+    
+    
+    
+    public boolean isArray()
+    {
+
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+     
+        return _dataType.getIsArray();
+    }
+    
+    public ByteConstant(byte val) 
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "ByteConstant");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "ByteConstant");
+        _dataType.setType(TypeConstants.byteType);
+     
+        this._byteValue = val;
+    }
+    
+    public Object evaluate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+     
+        return new Byte(_byteValue);
+    }
+    
+    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=Byte.toString(this._byteValue);
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+       
+        return str;
+    }
+
+	public String getReferenceTypeName() throws SPLException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+    
+}

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

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Ceiling.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Ceiling.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Ceiling.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Ceiling.java Fri Jan 11 10:56:30 2008
@@ -1,133 +1,133 @@
-/*
- * 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.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.NumericExpression;
-import org.apache.imperius.spl.parser.expressions.SingleArgumentExpression;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.spl.parser.util.TypeResolver;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class Ceiling extends SingleArgumentExpression implements
-        NumericExpression
-{
-    
-    public static final String className = Ceiling.class.getName();
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="Ceiling";
-    
-    
-    
-    public Ceiling(List exprList, boolean validateExpression)
-            throws SPLException
-    {
-        super(exprList);
-
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "Ceiling");
-
-        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()+" "+ "Ceiling");
-     
-    }
-    
-    public Object evaluate() throws SPLException
-    {
-
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-
-        
-        try
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-        
-            return ceiling((Number) _exp.evaluate());
-        }
-        catch (Exception e)
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + e.toString());
-            
-            throw new SPLException("evaluation error: " + e.toString());
-        }
-    }
-    
-    public static Number ceiling(Number o)
-    {
-
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "ceiling");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "ceiling");
-     
-        return new Double(Math.ceil(o.doubleValue()));
-    }
-    
-    public boolean validate() throws SPLException
-    {
-
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-
-        TypeInfo eType = _exp.getType();
-        
-        _dataType.setType(TypeConstants.intType);
-        if (TypeResolver.isNumeric(eType))
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-            
-            return true;
-        }
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-     
-        return false;
-    }
-
-	public String getReferenceTypeName() throws SPLException {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	
-    public String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-
-        String str = "Ceiling("+ this._exp.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.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.NumericExpression;
+import org.apache.imperius.spl.parser.expressions.SingleArgumentExpression;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.spl.parser.util.TypeResolver;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class Ceiling extends SingleArgumentExpression implements
+        NumericExpression
+{
+    
+    public static final String className = Ceiling.class.getName();
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="Ceiling";
+    
+    
+    
+    public Ceiling(List exprList, boolean validateExpression)
+            throws SPLException
+    {
+        super(exprList);
+
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "Ceiling");
+
+        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()+" "+ "Ceiling");
+     
+    }
+    
+    public Object evaluate() throws SPLException
+    {
+
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+
+        
+        try
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+        
+            return ceiling((Number) _exp.evaluate());
+        }
+        catch (Exception e)
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + e.toString());
+            
+            throw new SPLException("evaluation error: " + e.toString());
+        }
+    }
+    
+    public static Number ceiling(Number o)
+    {
+
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "ceiling");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "ceiling");
+     
+        return new Double(Math.ceil(o.doubleValue()));
+    }
+    
+    public boolean validate() throws SPLException
+    {
+
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+
+        TypeInfo eType = _exp.getType();
+        
+        _dataType.setType(TypeConstants.intType);
+        if (TypeResolver.isNumeric(eType))
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+            
+            return true;
+        }
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+     
+        return false;
+    }
+
+	public String getReferenceTypeName() throws SPLException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	
+    public String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+
+        String str = "Ceiling("+ this._exp.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/Ceiling.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/CharConstant.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/CharConstant.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/CharConstant.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/CharConstant.java Fri Jan 11 10:56:30 2008
@@ -1,120 +1,120 @@
-/*
- * 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.Expression;
-import org.apache.imperius.spl.external.TypeConstants;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.util.*;
-import org.apache.imperius.util.SPLLogger;
-
-
-
-public class CharConstant implements Expression
-{
-    
-    private char _charValue;
-    
-    private TypeInfo _dataType =new TypeInfo();
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="CharConstant";
-    
-    
-    
-    public boolean isArray()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-    
-        
-        return _dataType.getIsArray();
-    }
-    
-    public CharConstant(char c)
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "CharConstant");
-
-        this._charValue = c;
-        _dataType.setType(TypeConstants.charType);
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "CharConstant");
-        
-    }
-    
-    // @Override
-    /*
-     * public Object evaluate() { // 
-     * Character(charValue); }
-     * 
-     * @Override public int getType() { 
-     * return TypeConstants.charType; } public boolean validate() throws
-     * CIMSPLException {
-     */
-
-    public Object evaluate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-    
-       
-        return new Character(_charValue);
-    }
-    
-    public TypeInfo getType()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-    
-       
-        return _dataType;
-    }
-    
-    public boolean validate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-    
-       
-        return Character.isLetter(_charValue);
-    }
-    
-    public String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-        
-        String str=Character.toString(this._charValue);
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
-    }
-
-	public String getReferenceTypeName() throws SPLException {
-		
-		return null;
-	}
-    
-}
+/*
+ * 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.Expression;
+import org.apache.imperius.spl.external.TypeConstants;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.*;
+import org.apache.imperius.util.SPLLogger;
+
+
+
+public class CharConstant implements Expression
+{
+    
+    private char _charValue;
+    
+    private TypeInfo _dataType =new TypeInfo();
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="CharConstant";
+    
+    
+    
+    public boolean isArray()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+    
+        
+        return _dataType.getIsArray();
+    }
+    
+    public CharConstant(char c)
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "CharConstant");
+
+        this._charValue = c;
+        _dataType.setType(TypeConstants.charType);
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "CharConstant");
+        
+    }
+    
+    // @Override
+    /*
+     * public Object evaluate() { // 
+     * Character(charValue); }
+     * 
+     * @Override public int getType() { 
+     * return TypeConstants.charType; } public boolean validate() throws
+     * CIMSPLException {
+     */
+
+    public Object evaluate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+    
+       
+        return new Character(_charValue);
+    }
+    
+    public TypeInfo getType()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+    
+       
+        return _dataType;
+    }
+    
+    public boolean validate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+    
+       
+        return Character.isLetter(_charValue);
+    }
+    
+    public String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+        
+        String str=Character.toString(this._charValue);
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+       
+        return str;
+    }
+
+	public String getReferenceTypeName() throws SPLException {
+		
+		return null;
+	}
+    
+}

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

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/CollectionSize.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/CollectionSize.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/CollectionSize.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/CollectionSize.java Fri Jan 11 10:56:30 2008
@@ -1,152 +1,152 @@
-/*
- * 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.ArrayList;
-import java.util.List;
-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.SPLException;
-import org.apache.imperius.spl.parser.expressions.SingleArgumentExpression;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class CollectionSize extends SingleArgumentExpression implements
-        Expression
-{
-    
-    public String className = CollectionSize.class.toString();
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="CollectionSize";
-    
-    
-    
-    public CollectionSize(List exprList, boolean evaluateExpression)
-            throws SPLException
-    {
-        super(exprList);   
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "CollectionSize");
-
-        //System.out.println("CollectionSize");
-        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);
-            }
-        }
-        
-        this._dataType.setType(TypeConstants.intType);
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "CollectionSize");
-    
-    }
-    
-    public Object evaluate() throws SPLException
-    {  
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-
-        //System.out.println("CollectionSize:evaluate");
-        //System.out.println("this.exp class " + this.exp.getClass() + " type "+ this.exp.getType());
-        
-        Object expResult = this._exp.evaluate();
-        if (!(expResult instanceof java.util.List))
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"result of expression is not of type List");
-            throw new SPLException(
-                    "result of expression is not of type List");
-        }
-        ArrayList resultArray = (ArrayList) expResult;
-        //System.out.println("resultArray size " + resultArray.size()+ " to string " + resultArray.toString());
-        // //System.out.println("resultArray is of type "+expression.getType());
-        if ((resultArray != null) && (!resultArray.isEmpty()))
-        {
-            Integer size = new Integer(resultArray.size());
-            //System.out.println("Size of collection is " + size);
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-            
-            return size;
-            
-        }
-        else
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"result Array is empty");
-            throw new SPLException("result Array is empty");
-        }
-        
-    }
-    
-    /*
-     * public int getType() {
-     * 
-     * return this.dataType; }
-     */
-
-    public boolean validate() throws SPLException
-    {  
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-
-        //System.out.println("CollectionSize : validate ");
-        //System.out.println("this.exp.getClass() " + this.exp.getClass()+ " type " + this.exp.getType());
-        
-        if (!this._exp.isArray())
-        {
-            //System.out.println("expression is not a valid BasicCollectExpression");
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-            
-            return false;
-        }
-        else
-        {
-            //System.out.println("expression is a valid BasicCollectExpression");
-
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-        
-            return true;
-        }
-        
-    }
-
-	public String getReferenceTypeName() throws SPLException {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	
-    public String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-
-        String str = "CollectionSize("+ this._exp.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.ArrayList;
+import java.util.List;
+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.SPLException;
+import org.apache.imperius.spl.parser.expressions.SingleArgumentExpression;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class CollectionSize extends SingleArgumentExpression implements
+        Expression
+{
+    
+    public String className = CollectionSize.class.toString();
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="CollectionSize";
+    
+    
+    
+    public CollectionSize(List exprList, boolean evaluateExpression)
+            throws SPLException
+    {
+        super(exprList);   
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "CollectionSize");
+
+        //System.out.println("CollectionSize");
+        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);
+            }
+        }
+        
+        this._dataType.setType(TypeConstants.intType);
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "CollectionSize");
+    
+    }
+    
+    public Object evaluate() throws SPLException
+    {  
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+
+        //System.out.println("CollectionSize:evaluate");
+        //System.out.println("this.exp class " + this.exp.getClass() + " type "+ this.exp.getType());
+        
+        Object expResult = this._exp.evaluate();
+        if (!(expResult instanceof java.util.List))
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"result of expression is not of type List");
+            throw new SPLException(
+                    "result of expression is not of type List");
+        }
+        ArrayList resultArray = (ArrayList) expResult;
+        //System.out.println("resultArray size " + resultArray.size()+ " to string " + resultArray.toString());
+        // //System.out.println("resultArray is of type "+expression.getType());
+        if ((resultArray != null) && (!resultArray.isEmpty()))
+        {
+            Integer size = new Integer(resultArray.size());
+            //System.out.println("Size of collection is " + size);
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+            
+            return size;
+            
+        }
+        else
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"result Array is empty");
+            throw new SPLException("result Array is empty");
+        }
+        
+    }
+    
+    /*
+     * public int getType() {
+     * 
+     * return this.dataType; }
+     */
+
+    public boolean validate() throws SPLException
+    {  
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+
+        //System.out.println("CollectionSize : validate ");
+        //System.out.println("this.exp.getClass() " + this.exp.getClass()+ " type " + this.exp.getType());
+        
+        if (!this._exp.isArray())
+        {
+            //System.out.println("expression is not a valid BasicCollectExpression");
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+            
+            return false;
+        }
+        else
+        {
+            //System.out.println("expression is a valid BasicCollectExpression");
+
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+        
+            return true;
+        }
+        
+    }
+
+	public String getReferenceTypeName() throws SPLException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	
+    public String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+
+        String str = "CollectionSize("+ this._exp.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/CollectionSize.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Concatenate.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Concatenate.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Concatenate.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Concatenate.java Fri Jan 11 10:56:30 2008
@@ -1,118 +1,118 @@
-/*
- * 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.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.DoubleArgumentExpression;
-import org.apache.imperius.spl.parser.expressions.StringExpression;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.spl.parser.util.TypeResolver;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class Concatenate extends DoubleArgumentExpression implements
-        StringExpression
-{
-    
-    public static final String className = Concatenate.class.getName();
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="Concatenate";
-    
-    
-    
-    public Concatenate(List exprList, boolean validateExpression)
-            throws SPLException
-    {
-        super(exprList);
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "Concatenate");
-
-        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()+" "+ "Concatenate");
-        
-    }
-    
-    public Object evaluate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-
-        try
-        {
-            String s0 = (String) _lhsExp.evaluate();
-            String s1 = (String) _rhsExp.evaluate();
-
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-        
-            return new String(s0 + s1);
-        }
-        catch (Exception e)
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + toString());
-            
-            throw new SPLException("evaluation error: " + toString());
-        }
-    }
-    
-    public boolean validate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-
-        TypeInfo lType = _lhsExp.getType();
-        TypeInfo rType = _rhsExp.getType();
-        
-        if (TypeResolver.isString(lType) && TypeResolver.isString(rType))
-        {
-            _dataType.setType(TypeConstants.stringType);
-            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 = "Concatenate("+ 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.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.DoubleArgumentExpression;
+import org.apache.imperius.spl.parser.expressions.StringExpression;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.spl.parser.util.TypeResolver;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class Concatenate extends DoubleArgumentExpression implements
+        StringExpression
+{
+    
+    public static final String className = Concatenate.class.getName();
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="Concatenate";
+    
+    
+    
+    public Concatenate(List exprList, boolean validateExpression)
+            throws SPLException
+    {
+        super(exprList);
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "Concatenate");
+
+        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()+" "+ "Concatenate");
+        
+    }
+    
+    public Object evaluate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+
+        try
+        {
+            String s0 = (String) _lhsExp.evaluate();
+            String s1 = (String) _rhsExp.evaluate();
+
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+        
+            return new String(s0 + s1);
+        }
+        catch (Exception e)
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + toString());
+            
+            throw new SPLException("evaluation error: " + toString());
+        }
+    }
+    
+    public boolean validate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+
+        TypeInfo lType = _lhsExp.getType();
+        TypeInfo rType = _rhsExp.getType();
+        
+        if (TypeResolver.isString(lType) && TypeResolver.isString(rType))
+        {
+            _dataType.setType(TypeConstants.stringType);
+            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 = "Concatenate("+ 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/Concatenate.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/ConstantExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/ConstantExpression.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/ConstantExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/ConstantExpression.java Fri Jan 11 10:56:30 2008
@@ -1,43 +1,43 @@
-/*
- * 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 org.apache.imperius.spl.external.Expression;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-
-
-public abstract class ConstantExpression implements Expression
-{
-    
-    public abstract Object evaluate() throws SPLException;
-    
-    public abstract TypeInfo getType();
-    
-    public boolean validate()
-    {
-        return true;
-    }
-    public String getReferenceTypeName() throws SPLException
-    {
-    	throw new SPLException("Expression not of reference type");
-    }
-    
-}
+/*
+ * 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 org.apache.imperius.spl.external.Expression;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+
+
+public abstract class ConstantExpression implements Expression
+{
+    
+    public abstract Object evaluate() throws SPLException;
+    
+    public abstract TypeInfo getType();
+    
+    public boolean validate()
+    {
+        return true;
+    }
+    public String getReferenceTypeName() throws SPLException
+    {
+    	throw new SPLException("Expression not of reference type");
+    }
+    
+}

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

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Contains.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Contains.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Contains.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Contains.java Fri Jan 11 10:56:30 2008
@@ -1,136 +1,136 @@
-/*
- * 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.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 Contains extends DoubleArgumentExpression implements
-        BooleanExpression
-{
-    
-    public static final String className = Contains.class.getName();
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="Contains";
-    
-    
-    
-    public Contains(List exprList, boolean validateExpression)
-            throws SPLException
-    {
-        super(exprList);
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "Contains");
-
-        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()+" "+ "Contains");
-        
-    }
-    
-    public Object evaluate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-
-        try
-        {
-            String s0 = (String) _lhsExp.evaluate();
-            String s1 = (String) _rhsExp.evaluate();
-
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-         
-            return new Boolean(contains(s0, s1));
-        }
-        catch (Exception e)
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + e.toString());
-            
-            throw new SPLException("evaluation error: " + e.toString());
-        }
-    }
-    
-    public static boolean contains(String o1, String o2)
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "contains");
-
-        if (o1.indexOf(o2) < 0)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "contains");
-            
-            return false;
-        }
-        else
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "contains");
-            
-            return true;
-        }
-    }
-    
-    public boolean validate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-
-        TypeInfo lType = _lhsExp.getType();
-        TypeInfo rType = _rhsExp.getType();
-        
-        if (TypeResolver.isString(lType) && TypeResolver.isString(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 = "Contains("+ 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.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 Contains extends DoubleArgumentExpression implements
+        BooleanExpression
+{
+    
+    public static final String className = Contains.class.getName();
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="Contains";
+    
+    
+    
+    public Contains(List exprList, boolean validateExpression)
+            throws SPLException
+    {
+        super(exprList);
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "Contains");
+
+        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()+" "+ "Contains");
+        
+    }
+    
+    public Object evaluate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+
+        try
+        {
+            String s0 = (String) _lhsExp.evaluate();
+            String s1 = (String) _rhsExp.evaluate();
+
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+         
+            return new Boolean(contains(s0, s1));
+        }
+        catch (Exception e)
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + e.toString());
+            
+            throw new SPLException("evaluation error: " + e.toString());
+        }
+    }
+    
+    public static boolean contains(String o1, String o2)
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "contains");
+
+        if (o1.indexOf(o2) < 0)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "contains");
+            
+            return false;
+        }
+        else
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "contains");
+            
+            return true;
+        }
+    }
+    
+    public boolean validate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+
+        TypeInfo lType = _lhsExp.getType();
+        TypeInfo rType = _rhsExp.getType();
+        
+        if (TypeResolver.isString(lType) && TypeResolver.isString(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 = "Contains("+ 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/Contains.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message