1 11 package org.eclipse.team.core.diff.provider; 12 13 import org.eclipse.core.runtime.IPath; 14 import org.eclipse.team.core.diff.*; 15 import org.eclipse.team.internal.core.mapping.SyncInfoToDiffConverter; 16 17 25 public abstract class Diff implements IDiff { 26 27 33 public static final int KIND_MASK = 0xFF; 34 35 private final IPath path; 36 37 private final int status; 38 39 46 protected Diff(IPath path, int status) { 47 this.path = path; 48 this.status = status; 49 } 50 51 56 public IPath getPath() { 57 return path; 58 } 59 60 65 public int getKind() { 66 return getStatus() & KIND_MASK; 67 } 68 69 77 public final int getStatus() { 78 return status; 79 } 80 81 84 public String toDiffString() { 85 int kind = getKind(); 86 String label = SyncInfoToDiffConverter.diffKindToString(kind); 87 return label; 88 } 89 90 93 public int hashCode() { 94 return getPath().hashCode(); 95 } 96 97 100 public boolean equals(Object obj) { 101 if (obj == this) 102 return true; 103 if (obj instanceof Diff) { 104 Diff other = (Diff) obj; 105 return other.getPath().equals(getPath()) && getStatus() == other.getStatus(); 106 } 107 return false; 108 } 109 } 110 | Popular Tags |