1 11 package org.eclipse.jface.text; 12 13 14 17 public class Region implements IRegion { 18 19 20 private int fOffset; 21 22 private int fLength; 23 24 30 public Region(int offset, int length) { 31 fOffset= offset; 32 fLength= length; 33 } 34 35 38 public int getLength() { 39 return fLength; 40 } 41 42 45 public int getOffset() { 46 return fOffset; 47 } 48 49 52 public boolean equals(Object o) { 53 if (o instanceof IRegion) { 54 IRegion r= (IRegion) o; 55 return r.getOffset() == fOffset && r.getLength() == fLength; 56 } 57 return false; 58 } 59 60 63 public int hashCode() { 64 return (fOffset << 24) | (fLength << 16); 65 } 66 } 67 | Popular Tags |