edu.wisc.cs.stego.heap
Class HArray

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

public class HArray
extends HVertex

Each array in a heap profile is represented by a single HArray object.


Fields inherited from class edu.wisc.cs.stego.heap.HVertex
address, in_pointers, key, resolved, type
 
Constructor Summary
HArray(java.lang.String line)
          Constructs a new HArray object from a line read from a heap profile.
 
Method Summary
 void addMember(java.lang.String line)
          Adds a new element to the array.
 HVertex getMember(int i)
          Returns a specific member of this array.
 java.util.Iterator getMembers()
          Returns the set of vertices which are succesors of this one.
 int getNElems()
          Returns the runtime length of this array.
 void resolve(java.util.HashMap heap)
          Resolves the references contained in this array to actual HVertex objects.
 int size()
          Returns the number of members contained in this array.
 
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

HArray

public HArray(java.lang.String line)
Constructs a new HArray object from a line read from a heap profile. This line is assumed to be a line beginning with ARR and containing the length and type information for this array.
Parameters:
line - a line from a heap profile describing an array.
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 array. This is expected to be a line containing the index and pointer to another HVertex object.
Overrides:
addMember in class HVertex
Parameters:
line - an array member line from a heap profile.

resolve

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

getNElems

public int getNElems()
Returns the runtime length of this array. Note that the value returned by this method may be different than the actual number of members contained in this representation. This representation only contains members that are non-null;
Returns:
the runtime length of this array.

size

public int size()
Returns the number of members contained in this array. Only non-null members are included.
Returns:
the number of members contained in this array.

getMember

public HVertex getMember(int i)
Returns a specific member of this array. Calling this method is similar to using the indexing operator at runtime.
Parameters:
i - the index into the array.
Returns:
the HVertex contained in index i.