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.
Warning: this class defines compareTo which implicitly defines a coarser equality relation than equals
- Version:
- $Id: BrowserDocumentRegion.java 5425 2011-02-03 06:46:51Z rcartwright $
_indexCounter
private static volatile int _indexCounter
_index
private final int _index
_doc
protected final OpenDefinitionsDocument _doc
_file
protected final File _file
_startPosition
protected Position _startPosition
_endPosition
protected 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.
- Parameters:
doc - document that contains this regionfile - file that contains the regionsp - start position of the regionep - end position of the region
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 coarset than 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
update
public void update(BrowserDocumentRegion other)
toString
public String toString()
- Overrides:
toString in class Object