📄 value.java
字号:
/* $Id: Value.java,v 1.2 2004/08/15 12:39:30 eric Exp $ * * ProGuard -- shrinking, optimization, and obfuscation of Java class files. * * Copyright (c) 2002-2004 Eric Lafortune (eric@graphics.cornell.edu) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */package proguard.optimize.evaluation.value;/** * This abstract class represents a partially evaluated value. * * @author Eric Lafortune */public abstract class Value{ public static final int NEVER = -1; public static final int MAYBE = 0; public static final int ALWAYS = 1; public static final int TYPE_INTEGER = 1; public static final int TYPE_LONG = 2; public static final int TYPE_FLOAT = 3; public static final int TYPE_DOUBLE = 4; public static final int TYPE_REFERENCE = 5; public static final int TYPE_INSTRUCTION_OFFSET = 6; /** * Returns this Value as a Category1Value. */ public Category1Value category1Value() { throw new IllegalArgumentException("Value is not a Category 1 value [" + this.getClass().getName() + "]"); } /** * Returns this Value as a Category2Value. */ public Category2Value category2Value() { throw new IllegalArgumentException("Value is not a Category 2 value [" + this.getClass().getName() + "]"); } /** * Returns this Value as an IntegerValue. */ public IntegerValue integerValue() { throw new IllegalArgumentException("Value is not an integer value [" + this.getClass().getName() + "]"); } /** * Returns this Value as a LongValue. */ public LongValue longValue() { throw new IllegalArgumentException("Value is not a long value [" + this.getClass().getName() + "]"); } /** * Returns this Value as a FloatValue. */ public FloatValue floatValue() { throw new IllegalArgumentException("Value is not a float value [" + this.getClass().getName() + "]"); } /** * Returns this Value as a DoubleValue. */ public DoubleValue doubleValue() { throw new IllegalArgumentException("Value is not a double value [" + this.getClass().getName() + "]"); } /** * Returns this Value as a ReferenceValue. */ public ReferenceValue referenceValue() { throw new IllegalArgumentException("Value is not a reference value [" + this.getClass().getName() + "]"); } /** * Returns this Value as a InstructionOffsetValue. */ public InstructionOffsetValue instructionOffsetValue() { throw new IllegalArgumentException("Value is not an instruction offset value [" + this.getClass().getName() + "]"); } /** * Returns whether this Value represents a single specific value. */ public boolean isSpecific() { return false; } /** * Returns the generalization of this Value and the given other Value. */ public abstract Value generalize(Value other); /** * Returns whether the computational type of this Value is a category 2 type. * This means that it takes up the space of two category 1 types on the * stack, for instance. */ public abstract boolean isCategory2(); /** * Returns the computational type of this Value. The type is one of * <ul> * <li><code>TYPE_INTEGER</code> * <li><code>TYPE_LONG</code> * <li><code>TYPE_FLOAT</code> * <li><code>TYPE_DOUBLE</code> * <li><code>TYPE_REFERENCE</code> * <li><code>TYPE_INSTRUCTION_OFFSET</code> * </ul> */ public abstract int computationalType();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -