com.borland.primetime.editor
Class EditorDocument.MarkList

java.lang.Object
  |
  +--com.borland.primetime.editor.EditorDocument.MarkList
Enclosing class:
EditorDocument

protected class EditorDocument.MarkList
extends java.lang.Object

This class maintains the list of LineMarks for this document.


Constructor Summary
protected EditorDocument.MarkList()
           
 
Method Summary
 int addMark(int index, LineMark mark)
          Add a mark to the document.
 boolean contains(LineMark mark)
          Test to see if a particular mark is in the list.
 LineMark[] getMarks(int index)
          Retrieve the set of marks on a particular line.
 int indexOf(LineMark mark)
          Retrieve the 0-based index of a particular mark.
 void insertLine(int index)
          Insert a line into the MarkList.
 void removeLightweightMark(LineMark mark)
          Remove all occurances of this mark from the list.
 void removeLine(int index)
          Remove a line from the MarkList.
 int removeMark(LineMark mark)
          Remove a mark from the document.
 int size()
          Get the size of the internal list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditorDocument.MarkList

protected EditorDocument.MarkList()
Method Detail

size

public int size()
Get the size of the internal list. This should be maintained to match the number of lines in the document.

getMarks

public LineMark[] getMarks(int index)
Retrieve the set of marks on a particular line.

removeLine

public void removeLine(int index)
Remove a line from the MarkList. This will be called when lines are deleted from the document.

insertLine

public void insertLine(int index)
Insert a line into the MarkList. This will be called when lines are added to the document.

addMark

public int addMark(int index,
                   LineMark mark)
Add a mark to the document. There may be mutiple marks on the same line.
Parameters:
index - The 0-based index at which to add the mark.
mark - The LineMark to add.
Returns:
The 0-based index at which the mark was added.

removeMark

public int removeMark(LineMark mark)
Remove a mark from the document. There may be mutiple marks on the same line.
Parameters:
mark - The LineMark to remove.
Returns:
the 0-based index from which the mark was removed.

removeLightweightMark

public void removeLightweightMark(LineMark mark)
Remove all occurances of this mark from the list.
Parameters:
mark - The lightweight LineMark to remove.

indexOf

public int indexOf(LineMark mark)
Retrieve the 0-based index of a particular mark.
Parameters:
mark - The LineMark to lookup.
Returns:
The 0-based index of a particular mark.

contains

public boolean contains(LineMark mark)
Test to see if a particular mark is in the list.
Parameters:
mark - The LineMark to check.
Returns:
True if the MarkList contains the mark in question.