avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From froehl...@apache.org
Subject cvs commit: jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/impl DefaultNumericConstantColumn.java DefaultStringConstantColumn.java
Date Sun, 02 Dec 2001 14:47:02 GMT
froehlich    01/12/02 06:47:02

  Modified:    apps/db/src/java/org/apache/avalon/db/data/impl
                        DefaultStringConstantColumn.java
  Added:       apps/db/src/java/org/apache/avalon/db/data/impl
                        DefaultNumericConstantColumn.java
  Log:
  expressions like col1='Wilma', col2=12334 and col1=122.333
  are now processed correctly!
  
  Revision  Changes    Path
  1.3       +2 -2      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/impl/DefaultStringConstantColumn.java
  
  Index: DefaultStringConstantColumn.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/impl/DefaultStringConstantColumn.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultStringConstantColumn.java	2001/12/01 10:49:43	1.2
  +++ DefaultStringConstantColumn.java	2001/12/02 14:47:02	1.3
  @@ -20,7 +20,7 @@
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
    * @author Gerhard Froehlich <a href="mailto:g-froehlich@gmx.de">g-froehlich@gmx.de</a>*
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public class DefaultStringConstantColumn extends AbstractColumn implements StringConstantColumn
{
   
  @@ -68,6 +68,6 @@
       }
   
       public int getPrecesion() {
  -        return Column.PREC_CONST;
  +        return Column.PREC_STRING_CONST;
       }
   }
  
  
  
  1.1                  jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/impl/DefaultNumericConstantColumn.java
  
  Index: DefaultNumericConstantColumn.java
  ===================================================================
  
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.avalon.db.data.impl;
  
  import org.apache.avalon.db.data.ValidationException;
  import org.apache.avalon.db.data.Row;
  import org.apache.avalon.db.data.Column;
  import org.apache.avalon.db.data.types.NumericConstantColumn;
  import java.math.BigDecimal;
  
  /**
   * Class DefaultNumericConstantColumn
   *
   * @author Gerhard Froehlich <a href="mailto:g-froehlich@gmx.de">g-froehlich@gmx.de</a>*
   * @version $Revision: 1.1 $
   */
  public class DefaultNumericConstantColumn extends AbstractColumn implements NumericConstantColumn
{
  
      private String mNumConstant;
  
      /**
       * Constructor DefaultStringConstantColumn
       *
       *
       * @param name
       * @param strConstant
       *
       */
      public DefaultNumericConstantColumn(String name, String numConstant) {
          super(name,"numeric",String.class.getName());
          mNumConstant = numConstant;
      }
  
      public Object getValue(Row row) {
          return mNumConstant;
      }
  
      public String toString(Row row) {
          return mNumConstant;
      }
  
      public Integer toInteger(Row row) {
          return new Integer(mNumConstant);
      }
  
      public Long toLong(Row row) {
          return new Long(mNumConstant);
      }
  
      public BigDecimal toBigDecimal(Row row) {
          return new BigDecimal(mNumConstant);
      }
  
      public Float toFloat(Row row) {
          return new Float(mNumConstant);
      }
      
      public Short toShort(Row row) {
          return new Short(mNumConstant);
      }
  
      public int getPrecesion() {
          return Column.PREC_NUMERIC_CONST;
      }
  }
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message