1 11 package org.eclipse.team.core.diff.provider; 12 13 import org.eclipse.core.runtime.IPath; 14 import org.eclipse.team.core.diff.ITwoWayDiff; 15 16 26 public class TwoWayDiff extends Diff implements ITwoWayDiff { 27 28 36 protected static final int FLAG_MASK = 0xFF00; 37 38 44 public TwoWayDiff(IPath path, int kind, int flags) { 45 super(path, (kind & KIND_MASK) | (flags & ~KIND_MASK)); 46 } 47 48 51 public int getFlags() { 52 return getStatus() & ~KIND_MASK; 53 } 54 55 58 public IPath getToPath() { 59 return null; 60 } 61 62 65 public IPath getFromPath() { 66 return null; 67 } 68 69 72 public boolean equals(Object obj) { 73 if (obj == this) 74 return true; 75 if (super.equals(obj)) { 76 if (obj instanceof TwoWayDiff) { 77 TwoWayDiff other = (TwoWayDiff) obj; 78 return pathsEqual(getFromPath(), other.getFromPath()) && pathsEqual(getToPath(), other.getToPath()); 79 } 80 } 81 return false; 82 } 83 84 private boolean pathsEqual(IPath path1, IPath path2) { 85 if (path1 == null) 86 return path2 == null; 87 if (path2 == null) 88 return false; 89 return path1.equals(path2); 90 } 91 92 } 93 | Popular Tags |