edu.rice.cs.drjava.model
Class BrowserDocumentRegion
java.lang.Object
edu.rice.cs.drjava.model.BrowserDocumentRegion
- All Implemented Interfaces:
- IDocumentRegion, Region, java.lang.Comparable<BrowserDocumentRegion>
public class BrowserDocumentRegion
- extends java.lang.Object
- implements IDocumentRegion, java.lang.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 $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
_indexCounter
private static volatile int _indexCounter
_index
private final int _index
_doc
protected final OpenDefinitionsDocument _doc
_file
protected final java.io.File _file
_startPosition
protected javax.swing.text.Position _startPosition
_endPosition
protected javax.swing.text.Position _endPosition
_treeNode
protected volatile javax.swing.tree.DefaultMutableTreeNode _treeNode
BrowserDocumentRegion
public BrowserDocumentRegion(OpenDefinitionsDocument doc,
javax.swing.text.Position sp,
javax.swing.text.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 java.lang.Object
compareTo
public int compareTo(BrowserDocumentRegion r)
- This relation is coarset than equals.
- Specified by:
compareTo in interface java.lang.Comparable<BrowserDocumentRegion>
getIndex
public int getIndex()
getDocument
public OpenDefinitionsDocument getDocument()
- Specified by:
getDocument in interface IDocumentRegion
- Returns:
- the document.
getFile
public java.io.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 java.lang.String toString()
- Overrides:
toString in class java.lang.Object