edu.umd.cs.findbugs.ba
Class ValueNumber

java.lang.Object
  extended by edu.umd.cs.findbugs.ba.ValueNumber
All Implemented Interfaces:
java.lang.Comparable<ValueNumber>

public class ValueNumber
extends java.lang.Object
implements java.lang.Comparable<ValueNumber>

A "value number" is a value produced somewhere in a methods. We use value numbers as dataflow values in Frames. When two frame slots have the same value number, then the same value is in both of those slots.

Instances of ValueNumbers produced by the same ValueNumberFactory are unique, so reference equality may be used to determine whether or not two value numbers are the same. In general, ValueNumbers from different factories cannot be compared.

Author:
David Hovemeyer
See Also:
ValueNumberAnalysis

Field Summary
(package private)  int flags
          Flags representing meta information about the value.
(package private)  int number
          The value number.
static int RETURN_VALUE
          Flag specifying that this value was the return value of a called method.
 
Constructor Summary
ValueNumber(int number)
          Constructor.
 
Method Summary
 int compareTo(ValueNumber other)
           
 int getFlags()
           
 int getNumber()
           
 boolean hasFlag(int flag)
           
 void setFlag(int flag)
           
 void setFlags(int flags)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

number

int number
The value number.


flags

int flags
Flags representing meta information about the value.


RETURN_VALUE

public static final int RETURN_VALUE
Flag specifying that this value was the return value of a called method.

See Also:
Constant Field Values
Constructor Detail

ValueNumber

ValueNumber(int number)
Constructor.

Parameters:
number - the value number
Method Detail

getNumber

public int getNumber()

getFlags

public int getFlags()

setFlags

public void setFlags(int flags)

setFlag

public void setFlag(int flag)

hasFlag

public boolean hasFlag(int flag)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(ValueNumber other)
Specified by:
compareTo in interface java.lang.Comparable<ValueNumber>