orc.trace.values
Class ObjectValue

java.lang.Object
  extended by orc.trace.values.AbstractValue
      extended by orc.trace.values.ObjectValue
All Implemented Interfaces:
java.io.Serializable, Term, Value

public class ObjectValue
extends AbstractValue

The only thing we can reliably record about a Java object is its identity. We could represent object identity by object identity (i.e. eschew any explicit id property), but that would require serialization to preserve object identity, which is not the case if you call ObjectOutputStream.reset(). So instead we use an explicit unique numeric id for each instance.

Author:
quark
See Also:
Serialized Form

Field Summary
 java.lang.Class class_
           
 long id
          A long is necessary instead of an int because our id space needs to include a unique id for all values ever, not just for all values at a particular point in the program (like an address).
 
Constructor Summary
ObjectValue(java.lang.Class class_)
           
 
Method Summary
 boolean equals(java.lang.Object that)
           
 int hashCode()
           
 void prettyPrint(java.io.Writer out, int indent)
          Pretty-print the term to out.
 
Methods inherited from class orc.trace.values.AbstractValue
toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

id

public final long id
A long is necessary instead of an int because our id space needs to include a unique id for all values ever, not just for all values at a particular point in the program (like an address).


class_

public final java.lang.Class class_
Constructor Detail

ObjectValue

public ObjectValue(java.lang.Class class_)
Method Detail

equals

public boolean equals(java.lang.Object that)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

prettyPrint

public void prettyPrint(java.io.Writer out,
                        int indent)
                 throws java.io.IOException
Description copied from interface: Term
Pretty-print the term to out. If the term is multiple lines, each newline should be followed by at least indent tabs. The value should not begin or end with a newline.

Throws:
java.io.IOException
See Also:
Terms.indent(Writer, int)