|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.drjava.model.DocumentRegion
public class DocumentRegion
Class for a simple document region that only records region offsets, not positions. Instances of this class represent dummy regions used in searching SortSets of DocumentRegions. Hence, getLineStart() and getLineEnd() should never be called. WARNING: this class overrides the equals method but does not override the hashCode method to maintain consistency. Hence, instances can only be used as keys in identity based hash tables. NOTE: since class instances are mutable, a hashCode method consistent with equals WOULD NOT WORK anyway.
| Field Summary | |
|---|---|
protected OpenDefinitionsDocument |
_doc
|
protected int |
_end
|
protected int |
_start
|
| Constructor Summary | |
|---|---|
DocumentRegion(OpenDefinitionsDocument doc,
int start,
int end)
Create a new simple document region with a bona fide document |
|
| Method Summary | |
|---|---|
int |
compareTo(OrderedDocumentRegion r)
Totally orders regions lexicographically based on (_doc, endOffset, startOffset). |
boolean |
equals(Object o)
Defines the equality relation on DocumentRegions. |
OpenDefinitionsDocument |
getDocument()
|
int |
getEndOffset()
|
int |
getLineEndOffset()
Throws exception indicating that getLineEnd() is not supported. |
int |
getLineStartOffset()
Throws exception indicating that getLineStart() is not supported. |
int |
getStartOffset()
|
String |
getString()
Throws exception indicating that getString() is not supported. |
boolean |
isEmpty()
|
String |
toString()
|
void |
update()
Throws exception indicating that getString() is not supported. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final OpenDefinitionsDocument _doc
protected volatile int _start
protected volatile int _end
| Constructor Detail |
|---|
public DocumentRegion(OpenDefinitionsDocument doc,
int start,
int end)
| Method Detail |
|---|
public final boolean equals(Object o)
equals in class Objectpublic int compareTo(OrderedDocumentRegion r)
compareTo in interface Comparable<OrderedDocumentRegion>public OpenDefinitionsDocument getDocument()
getDocument in interface IDocumentRegionpublic int getStartOffset()
getStartOffset in interface Regionpublic int getEndOffset()
getEndOffset in interface Regionpublic int getLineStartOffset()
getLineStartOffset in interface OrderedDocumentRegionpublic int getLineEndOffset()
getLineEndOffset in interface OrderedDocumentRegionpublic String getString()
getString in interface OrderedDocumentRegionpublic void update()
update in interface OrderedDocumentRegionpublic boolean isEmpty()
isEmpty in interface OrderedDocumentRegionpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||