edu.wisc.cs.stego.heap
Class HObject

java.lang.Object
  |
  +--edu.wisc.cs.stego.heap.HVertex
        |
        +--edu.wisc.cs.stego.heap.HObject

public class HObject
extends HVertex

Each object in the heap profile is represented by one HObject instance.


Fields inherited from class edu.wisc.cs.stego.heap.HVertex
address, in_pointers, key, resolved, type
 
Constructor Summary
HObject(java.lang.String line)
          Constructs a new HObject object from a line read from a heap profile.
 
Method Summary
 void addMember(java.lang.String line)
          Adds a new element to the object.
 HVertex getMember(java.lang.Object o)
          Find and returns the value of a member of this object.
 HVertex getMember(java.lang.String name)
          Find and returns the value of a member of this object.
 java.util.Iterator getMemberNames()
          Returns an iterator containing the names of the members for this object.
 java.util.Iterator getMembers()
          Returns the set of vertices which are succesors of this one.
 void resolve(java.util.HashMap heap)
          Resolves the references contained in this object to actual HVertex objects.
 
Methods inherited from class edu.wisc.cs.stego.heap.HVertex
addInPointer, finalize, getAddress, getInPointer, getKey, getNInPointers, getType, removeInPointer
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HObject

public HObject(java.lang.String line)
Constructs a new HObject object from a line read from a heap profile. This line is assumed to be a line beginning with OBJ and containing the type type information for this object.
Parameters:
line - a line from a heap profile describing an object.
Method Detail

getMembers

public java.util.Iterator getMembers()
Returns the set of vertices which are succesors of this one.
Overrides:
getMembers in class HVertex
Returns:
the set of vertices which are succesors of this one.

addMember

public void addMember(java.lang.String line)
Adds a new element to the object. This is expected to be a line containing the member name and pointer to another HVertex object.
Overrides:
addMember in class HVertex
Parameters:
line - an object member line from a heap profile.

resolve

public void resolve(java.util.HashMap heap)
Resolves the references contained in this object to actual HVertex objects.
Overrides:
resolve in class HVertex
Parameters:
heap - a HashMap containing all of the objects from the heap profile.

getMemberNames

public java.util.Iterator getMemberNames()
Returns an iterator containing the names of the members for this object.
Returns:
an iterator containing the names of the members for this object.

getMember

public HVertex getMember(java.lang.Object o)
Find and returns the value of a member of this object. This version is provided so that the iterator of member names may be used directly without casting to index into an object. The object parameter is expected to be of type String. If an object of any other type is passed in, or the requested member is not found, the return value will be the null reference.
Parameters:
o - the name of a member of this object.
Returns:
the object referred to by the requested member, null if not found.

getMember

public HVertex getMember(java.lang.String name)
Find and returns the value of a member of this object. If a member with the requested name is not found, the return value will be the null reference.
Parameters:
name - the name of a member of this object.
Returns:
the object referred to by the requested member, null if not found.