edu.rice.cs.drjava.model
Class BrowserDocumentRegion
java.lang.Object
edu.rice.cs.drjava.model.BrowserDocumentRegion
- All Implemented Interfaces:
- IDocumentRegion, Region, Comparable<BrowserDocumentRegion>
public class BrowserDocumentRegion
- extends Object
- implements IDocumentRegion, Comparable<BrowserDocumentRegion>
Class for document regions that totally ordered by allocation chronology. They do not conform to the invariants
required for OrderedDocumentRegions. TODO: Use a simple stack rather than a TreeSet to represent the collection
of accumulated regions.
- Version:
- $Id$
_doc
protected final OpenDefinitionsDocument _doc
_file
protected final File _file
_startPosition
protected final Position _startPosition
_endPosition
protected final Position _endPosition
_treeNode
protected volatile DefaultMutableTreeNode _treeNode
BrowserDocumentRegion
public BrowserDocumentRegion(OpenDefinitionsDocument doc,
Position sp,
Position ep)
- Create a new simple document region with a bona fide document
hashCode
public int hashCode()
- This hash function is consistent with equals.
- Overrides:
hashCode
in class Object
compareTo
public int compareTo(BrowserDocumentRegion r)
- This relation is consistent with equals.
- Specified by:
compareTo
in interface Comparable<BrowserDocumentRegion>
getIndex
public int getIndex()
getDocument
public OpenDefinitionsDocument getDocument()
- Specified by:
getDocument
in interface IDocumentRegion
- Returns:
- the document.
getFile
public File getFile()
- Returns:
- the file.
getStartOffset
public int getStartOffset()
- Specified by:
getStartOffset
in interface Region
- Returns:
- the start offset
getEndOffset
public int getEndOffset()
- Specified by:
getEndOffset
in interface Region
- Returns:
- the end offset
toString
public String toString()
- Overrides:
toString
in class Object