1 package Analysis.OwnershipAnalysis;
7 public class HeapRegionNode extends OwnershipNode {
9 public HeapRegionNode( Integer id,
10 boolean isSingleObject,
13 String description ) {
15 this.isSingleObject = isSingleObject;
16 this.isFlagged = isFlagged;
17 this.isNewSummary = isNewSummary;
18 this.description = description;
20 referencers = new HashSet<OwnershipNode>();
21 //analysisRegionAliases = new HashSet<TempDescriptor>();
22 memberFields = new HashSet<TempDescriptor>();
25 public HeapRegionNode copy() {
26 return new HeapRegionNode( id,
39 public Integer getID() {
43 public boolean equals( HeapRegionNode hrn ) {
46 return id.equals( hrn.getID() ) &&
47 isSingleObject == hrn.isSingleObject() &&
48 isFlagged == hrn.isFlagged() &&
49 isNewSummary == hrn.isNewSummary() &&
50 description.equals( hrn.getDescription() );
61 boolean isSingleObject;
62 public boolean isSingleObject() {
63 return isSingleObject;
67 public boolean isFlagged() {
72 public boolean isNewSummary() {
81 ///////////////////////////////////////////
82 // interface with larger graph
83 ///////////////////////////////////////////
84 protected HashSet<TempDescriptor> memberFields;
85 protected HashSet<OwnershipNode> referencers;
87 public Iterator iteratorToReferencers() {
88 return referencers.iterator();
91 public Iterator iteratorToReferencersClone() {
92 HashSet hs = (HashSet) referencers.clone();
96 public void addReferencer( OwnershipNode on ) {
99 referencers.add( on );
102 public void removeReferencer( OwnershipNode on ) {
104 assert referencers.contains( on );
106 referencers.remove( on );
109 public boolean isReferencedBy( OwnershipNode on ) {
111 return referencers.contains( on );
113 ///////////////////////////////////////////////
114 // end interface with larger graph
115 ///////////////////////////////////////////////
120 ///////////////////////////////////////////////
121 // analysis interface
122 ///////////////////////////////////////////////
124 protected HashSet<TempDescriptor> analysisRegionAliases;
126 public void addAnalysisRegionAlias( TempDescriptor td ) {
128 assert !analysisRegionAliases.contains( td );
130 analysisRegionAliases.add( td );
133 public Iterator iteratorToAnalysisRegionAliases() {
134 return analysisRegionAliases.iterator();
137 ///////////////////////////////////////////////
138 // end analysis interface
139 ///////////////////////////////////////////////
145 public String getIDString() {
146 return id.toString();
149 public String toString() {
150 return "HRN"+getIDString();
153 public String getDescription() {