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
12 public class ChangeTuple
14 private TokenTupleSet toMatch;
15 private TokenTupleSet toAdd;
17 public ChangeTuple( TokenTupleSet toMatch,
18 TokenTupleSet toAdd ) {
19 this.toMatch = toMatch;
23 public TokenTupleSet getSetToMatch() { return toMatch; }
24 public TokenTupleSet getSetToAdd() { return toAdd; }
26 public boolean equals( Object o ) {
27 if( !(o instanceof ChangeTuple) ) {
31 ChangeTuple ct = (ChangeTuple) o;
33 return toMatch.equals( ct.getSetToMatch() ) &&
34 toAdd.equals( ct.getSetToAdd() );
37 public int hashCode() {
38 return toMatch.hashCode() + toAdd.hashCode();
41 public ChangeTuple copy() {
42 return new ChangeTuple( toMatch, toAdd );
45 public String toString() {
46 return new String( "<"+toMatch+" -> "+toAdd+">" );