1 package Analysis.OwnershipAnalysis;
9 // a change touple is a pair that indicates if the
10 // first TokenTupleSet is found in a ReachabilitySet,
11 // then the second TokenTupleSet should be added
13 // THIS CLASS IS IMMUTABLE!
15 public class ChangeTuple
17 private TokenTupleSet toMatch;
18 private TokenTupleSet toAdd;
20 public ChangeTuple( TokenTupleSet toMatch,
21 TokenTupleSet toAdd ) {
22 this.toMatch = toMatch;
26 public TokenTupleSet getSetToMatch() { return toMatch; }
27 public TokenTupleSet getSetToAdd() { return toAdd; }
29 public boolean equals( Object o ) {
30 if( !(o instanceof ChangeTuple) ) {
34 ChangeTuple ct = (ChangeTuple) o;
36 return toMatch.equals( ct.getSetToMatch() ) &&
37 toAdd.equals( ct.getSetToAdd() );
40 public int hashCode() {
41 return toMatch.hashCode() + toAdd.hashCode();
44 public String toString() {
45 return new String( "<"+toMatch+" -> "+toAdd+">" );