| java.lang.Object org.netbeans.editor.MarkBlock
MarkBlock | public class MarkBlock (Code) | | Block of text created using two marks. These blocks can be chained. Existing
block can be compared to other block (better pair of positions) and there's
extensive list of result values of such comparison.
author: Miloslav Metelka version: 1.00 |
Field Summary | |
final public static int | AFTER Tested block completely after THIS mark block. | final public static int | BEFORE Tested block completely before THIS mark block. | final public static int | CONTINUE Single bit value that means that the tested block doesn't overlap with
THIS block, but either its start position is equal to end position of
THIS block or its end position is equal to the start position of THIS
block. | final public static int | CONTINUE_BEGIN Tested block completely before THIS mark block but its end position
equals to the start position of THIS block. | final public static int | CONTINUE_END Tested block completely after THIS mark block but its start position
equals to the end position of THIS block. | final public static int | EMPTY Single bit value meaning that the tested block has zero size. | final public static int | EXTEND Two bit value meaning that the tested block fully includes THIS block.
The block must be extended at least by one character, otherwise the
'inside' values will be used. | final public static int | EXTEND_BEGIN Start position of the tested block is lower than the start position of
THIS block and both end positions are the same. | final public static int | EXTEND_END End position of the tested block is greater than the end position of THIS
block and both start positions are the same. | final public static int | IGNORE_EMPTY This value can be used to clear the two bits saying if the tested or THIS
block are empty (The EMPTY and THIS_EMPTY are cleared). | final public static int | INCLUDE Tested block fully includes THIS block and extends it by at least one
character in both directions. | final public static int | INNER Tested block is fully inside THIS block and there is at least one more
character left in THIS block after the end of the tested block in both
directions. | final public static int | INSIDE Two bit value meaning that the tested block is fully inside THIS block. | final public static int | INSIDE_BEGIN Tested block completely inside THIS block and its end position is lower
than end position of THIS block and start positions are the same. | final public static int | INSIDE_END Tested block completely inside THIS block and its start position is
greater than THIS block start position and end positions are the same. | final public static int | INVALID This value is not used directly in this class but can be used by other
classes to report that the comparison of blocks has no sense for some
reason. | final public static int | OVERLAP Single bit value that means that tested block and THIS block partially or
fully overlap. | final public static int | OVERLAP_BEGIN Tested block partly covers begining of THIS mark block. | final public static int | OVERLAP_END Tested block partly covers end of THIS mark block. | final public static int | SAME The blocks have exactly the same start and end positions. | final public static int | THIS_EMPTY Single bit value meaning that THIS block has zero size. | protected BaseDocument | doc | public Mark | endMark | protected MarkBlock | next | protected MarkBlock | prev | public Mark | startMark |
AFTER | final public static int AFTER(Code) | | Tested block completely after THIS mark block.
|
BEFORE | final public static int BEFORE(Code) | | Tested block completely before THIS mark block.
|
CONTINUE | final public static int CONTINUE(Code) | | Single bit value that means that the tested block doesn't overlap with
THIS block, but either its start position is equal to end position of
THIS block or its end position is equal to the start position of THIS
block. Simply they together make one continuous block. The values for
which this bit is set are: CONTINUE_BEGIN, CONTINUE_END.
|
CONTINUE_BEGIN | final public static int CONTINUE_BEGIN(Code) | | Tested block completely before THIS mark block but its end position
equals to the start position of THIS block. They together make one
continuous block. The value is BEFORE | CONTINUE.
|
CONTINUE_END | final public static int CONTINUE_END(Code) | | Tested block completely after THIS mark block but its start position
equals to the end position of THIS block. They together make one
continuous block. The value is AFTER | CONTINUE.
|
EMPTY | final public static int EMPTY(Code) | | Single bit value meaning that the tested block has zero size.
|
EXTEND | final public static int EXTEND(Code) | | Two bit value meaning that the tested block fully includes THIS block.
The block must be extended at least by one character, otherwise the
'inside' values will be used. It is included in the following values:
EXTEND_BEGIN, INCLUDE, EXTEND_END. The value includes OVERLAP.
|
EXTEND_BEGIN | final public static int EXTEND_BEGIN(Code) | | Start position of the tested block is lower than the start position of
THIS block and both end positions are the same. The value is
OVERLAP_BEGIN | EXTEND.
|
EXTEND_END | final public static int EXTEND_END(Code) | | End position of the tested block is greater than the end position of THIS
block and both start positions are the same. The value is OVERLAP_END |
EXTEND.
|
IGNORE_EMPTY | final public static int IGNORE_EMPTY(Code) | | This value can be used to clear the two bits saying if the tested or THIS
block are empty (The EMPTY and THIS_EMPTY are cleared). To do that, use
value ANDed by IGNORE_EMPTY expression.
|
INCLUDE | final public static int INCLUDE(Code) | | Tested block fully includes THIS block and extends it by at least one
character in both directions. The value is EXTEND_BEGIN | EXTEND_END.
|
INNER | final public static int INNER(Code) | | Tested block is fully inside THIS block and there is at least one more
character left in THIS block after the end of the tested block in both
directions. The value includes INSIDE.
|
INSIDE | final public static int INSIDE(Code) | | Two bit value meaning that the tested block is fully inside THIS block.
It is included in the following values: INSIDE_BEGIN, SAME, INSIDE_END.
The value includes OVERLAP.
|
INSIDE_BEGIN | final public static int INSIDE_BEGIN(Code) | | Tested block completely inside THIS block and its end position is lower
than end position of THIS block and start positions are the same. The
value includes INSIDE.
|
INSIDE_END | final public static int INSIDE_END(Code) | | Tested block completely inside THIS block and its start position is
greater than THIS block start position and end positions are the same.
The value includes INSIDE.
|
INVALID | final public static int INVALID(Code) | | This value is not used directly in this class but can be used by other
classes to report that the comparison of blocks has no sense for some
reason.
|
OVERLAP | final public static int OVERLAP(Code) | | Single bit value that means that tested block and THIS block partially or
fully overlap. If this bit is not set then the blocks don't overlap at
all. The values for which this bit is set are: OVERLAP_BEGIN,
OVERLAP_END, EXTEND_BEGIN, EXTEND_END, INCLUDE, INSIDE_BEGIN, INSIDE_END,
SAME, INNER. The values for which this bit is not set are: BEFORE, AFTER,
CONTINUE_BEGIN, CONTINUE_END.
|
OVERLAP_BEGIN | final public static int OVERLAP_BEGIN(Code) | | Tested block partly covers begining of THIS mark block. The value
includes OVERLAP.
|
OVERLAP_END | final public static int OVERLAP_END(Code) | | Tested block partly covers end of THIS mark block. The value includes
OVERLAP.
|
SAME | final public static int SAME(Code) | | The blocks have exactly the same start and end positions. They simply
cover exactly the same area. The value is INSIDE_BEGIN | INSIDE_END.
|
THIS_EMPTY | final public static int THIS_EMPTY(Code) | | Single bit value meaning that THIS block has zero size.
|
checkReverse | public boolean checkReverse()(Code) | | |
compare | public int compare(int startPos, int endPos)(Code) | | Compares the position of the given block against current block.
Parameters: startPos - starting position of the compared block Parameters: endPos - ending position of the compared block or it is the same asstartPos when testing just for insert relation of compared block against this guarded block |
debugRelation | public static String debugRelation(int rel)(Code) | | |
destroyMarks | void destroyMarks()(Code) | | Remove the marks if they were not removed yet
|
extend | public boolean extend(int startPos, int endPos, boolean concat) throws BadLocationException(Code) | | Extend this mark block by start and end positions. First test whether the
given block intersects with this mark block. If not nothing is done.
whether this mark block has been extended |
extend | public boolean extend(MarkBlock blk, boolean concat)(Code) | | Extend this mark block by some other block.
whether the block was extended. If it was, the caller isresponsible for possibly removing blk from the chain |
extendEnd | public int extendEnd(int endPos) throws BadLocationException(Code) | | Possibly move end mark if its position is above the given number.
new position |
extendStart | public int extendStart(int startPos) throws BadLocationException(Code) | | Possibly move start mark if its position is above the given number.
new position |
finalize | protected void finalize() throws Throwable(Code) | | Destroy the marks if necessary
|
getEndOffset | public int getEndOffset()(Code) | | |
getStartOffset | public int getStartOffset()(Code) | | |
isReverse | public boolean isReverse()(Code) | | |
removeChain | public MarkBlock removeChain()(Code) | | Remove this block from the chain
next chain member or null for end of chain |
reverse | public void reverse()(Code) | | |
setNextChain | public void setNextChain(MarkBlock b)(Code) | | Set the next block of this one in the chain.
|
setPrevChain | public void setPrevChain(MarkBlock b)(Code) | | Set the previous block of this one in the chain
|
shrink | public int shrink(int startPos, int endPos) throws BadLocationException(Code) | | Shrink this mark block by the block specified. startMark is moved to the
endPos if OVERLAP_BEGIN or INSIDE_BEGIN is returned from compare().
endMark is moved to the startPos if OVERLAP_END or INSIDE_END is returned
from compare(). If other status is returned or either block is empty,
then no action is taken. It's up to caller to handle these situations.
relation of tested block to mark block |
toString | public String toString()(Code) | | Debugs this mark block
|
toStringChain | public String toStringChain()(Code) | | Debug possibly whole chain of marks
|
|
|