1 package Analysis.OwnershipAnalysis;
7 public class HeapRegionNode extends OwnershipNode {
11 protected boolean isSingleObject;
12 protected boolean isFlagged;
13 protected boolean isNewSummary;
15 protected HashSet<TempDescriptor> memberFields;
16 protected HashSet<OwnershipNode> referencers;
18 protected AllocationSite allocSite;
20 protected ReachabilitySet alpha;
22 protected String description;
26 public HeapRegionNode( Integer id,
27 boolean isSingleObject,
30 AllocationSite allocSite,
31 ReachabilitySet alpha,
32 String description ) {
34 this.isSingleObject = isSingleObject;
35 this.isFlagged = isFlagged;
36 this.isNewSummary = isNewSummary;
37 this.allocSite = allocSite;
39 this.description = description;
41 referencers = new HashSet<OwnershipNode>();
42 memberFields = new HashSet<TempDescriptor>();
45 public HeapRegionNode copy() {
46 return new HeapRegionNode( id,
56 public Integer getID() {
60 public boolean equals( HeapRegionNode hrn ) {
63 return id.equals( hrn.getID() ) &&
64 isSingleObject == hrn.isSingleObject() &&
65 isFlagged == hrn.isFlagged() &&
66 isNewSummary == hrn.isNewSummary() &&
67 description.equals( hrn.getDescription() );
72 public boolean isSingleObject() {
73 return isSingleObject;
76 public boolean isFlagged() {
80 public boolean isNewSummary() {
86 public Iterator iteratorToReferencers() {
87 return referencers.iterator();
90 public Iterator iteratorToReferencersClone() {
91 HashSet hs = (HashSet) referencers.clone();
95 public void addReferencer( OwnershipNode on ) {
98 referencers.add( on );
101 public void removeReferencer( OwnershipNode on ) {
103 assert referencers.contains( on );
105 referencers.remove( on );
108 public boolean isReferencedBy( OwnershipNode on ) {
110 return referencers.contains( on );
114 public AllocationSite getAllocationSite() {
119 public ReachabilitySet getAlpha() {
124 public String getIDString() {
125 return id.toString();
128 public String getAlphaString() {
129 return alpha.toStringEscapeNewline();
132 public String toString() {
133 return "HRN"+getIDString();
136 // WHY WHY WHY WHY WHY WHY?!
137 public String getDescription() {
138 return new String( description );
139 //return new String( description+" ID "+getIDString() );