Home | History | Annotate | Download | only in value
      1 /*
      2  * ProGuard -- shrinking, optimization, obfuscation, and preverification
      3  *             of Java bytecode.
      4  *
      5  * Copyright (c) 2002-2014 Eric Lafortune (eric (at) graphics.cornell.edu)
      6  *
      7  * This program is free software; you can redistribute it and/or modify it
      8  * under the terms of the GNU General Public License as published by the Free
      9  * Software Foundation; either version 2 of the License, or (at your option)
     10  * any later version.
     11  *
     12  * This program is distributed in the hope that it will be useful, but WITHOUT
     13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
     15  * more details.
     16  *
     17  * You should have received a copy of the GNU General Public License along
     18  * with this program; if not, write to the Free Software Foundation, Inc.,
     19  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
     20  */
     21 package proguard.evaluation.value;
     22 
     23 /**
     24  * This class represents a partially evaluated double value.
     25  *
     26  * @author Eric Lafortune
     27  */
     28 public class UnknownDoubleValue extends DoubleValue
     29 {
     30     // Basic unary methods.
     31 
     32     public DoubleValue negate()
     33     {
     34         return this;
     35     }
     36 
     37     public IntegerValue convertToInteger()
     38     {
     39         return ValueFactory.INTEGER_VALUE;
     40     }
     41 
     42     public LongValue convertToLong()
     43     {
     44         return ValueFactory.LONG_VALUE;
     45     }
     46 
     47     public FloatValue convertToFloat()
     48     {
     49         return ValueFactory.FLOAT_VALUE;
     50     }
     51 
     52 
     53     // Basic binary methods.
     54 
     55     public DoubleValue generalize(DoubleValue other)
     56     {
     57         return this;
     58     }
     59 
     60     public DoubleValue add(DoubleValue other)
     61     {
     62         return this;
     63     }
     64 
     65     public DoubleValue subtract(DoubleValue other)
     66     {
     67         return this;
     68     }
     69 
     70     public DoubleValue subtractFrom(DoubleValue other)
     71     {
     72         return this;
     73     }
     74 
     75     public DoubleValue multiply(DoubleValue other)
     76     {
     77         return this;
     78     }
     79 
     80     public DoubleValue divide(DoubleValue other)
     81     {
     82         return this;
     83     }
     84 
     85     public DoubleValue divideOf(DoubleValue other)
     86     {
     87         return this;
     88     }
     89 
     90     public DoubleValue remainder(DoubleValue other)
     91     {
     92         return this;
     93     }
     94 
     95     public DoubleValue remainderOf(DoubleValue other)
     96     {
     97         return this;
     98     }
     99 
    100     public IntegerValue compare(DoubleValue other)
    101     {
    102         return ValueFactory.INTEGER_VALUE;
    103     }
    104 
    105 
    106     // Implementations for Object.
    107 
    108     public boolean equals(Object object)
    109     {
    110         return object != null &&
    111                this.getClass() == object.getClass();
    112     }
    113 
    114 
    115     public int hashCode()
    116     {
    117         return this.getClass().hashCode();
    118     }
    119 
    120 
    121     public String toString()
    122     {
    123         return "d";
    124     }
    125 }