1 11 package org.eclipse.jface.text; 12 13 14 15 19 public class TypedRegion extends Region implements ITypedRegion { 20 21 22 private String fType; 23 24 31 public TypedRegion(int offset, int length, String type) { 32 super(offset, length); 33 fType= type; 34 } 35 36 39 public String getType() { 40 return fType; 41 } 42 43 46 public boolean equals(Object o) { 47 if (o instanceof TypedRegion) { 48 TypedRegion r= (TypedRegion) o; 49 return super.equals(r) && ((fType == null && r.getType() == null) || fType.equals(r.getType())); 50 } 51 return false; 52 } 53 54 57 public int hashCode() { 58 int type= fType == null ? 0 : fType.hashCode(); 59 return super.hashCode() | type; 60 } 61 } 62 | Popular Tags |