sk.uniba.euromath.document.interval
Class IntervalOrInsertPoint

java.lang.Object
  extended by sk.uniba.euromath.document.interval.IntervalOrInsertPoint

public final class IntervalOrInsertPoint
extends Object

Result of the DOMIntervalSet.findIntervalOrInsertPoint(sk.uniba.euromath.document.DomPointer) function, differentiates between an interval and an insert point.

Operates on a live instance of the DOMIntervalSet set, may become invalid when this set changes.

Author:
Martin Vysny

Field Summary
 int index
          A 'raw' index - index of an interval owning the pointer.
 int insertIndex
           Insert point where interval starting with given pointer would be inserted.
 DOMInterval interval
          Interval containing the pointer or null if no such interval exists.
 int intervalIndex
          Index of interval containing the pointer or -1 if no such interval exists.
 DOMIntervalSet ownerSet
          The set that owns this object.
 DomPointer ptr
          The pointer being queried.
 
Constructor Summary
IntervalOrInsertPoint(DOMIntervalSet owner, DomPointer ptr, int index)
          Constructor.
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ownerSet

public final DOMIntervalSet ownerSet
The set that owns this object.


ptr

public final DomPointer ptr
The pointer being queried.


index

public final int index
A 'raw' index - index of an interval owning the pointer. If no such interval exists then this is the index of interval which to pointer points closest to the pointer. May be -1 if this object denotes an insertpoint to the beginning of the set.


intervalIndex

public final int intervalIndex
Index of interval containing the pointer or -1 if no such interval exists. If not equal to -1 then it contains the same value as the raw index.


interval

public final DOMInterval interval
Interval containing the pointer or null if no such interval exists.


insertIndex

public final int insertIndex

Insert point where interval starting with given pointer would be inserted. Index of an interval which to pointer is closest to the pointer. Equal to -1 when the pointer points into some interval.

If not -1 then it is equal to raw index + 1.

Note that this object will not denote both interval and an insert point in same time. Thus, if this value is -1 then intervalIndex is >=0 and vice versa.

Constructor Detail

IntervalOrInsertPoint

IntervalOrInsertPoint(DOMIntervalSet owner,
                      DomPointer ptr,
                      int index)
Constructor.

Parameters:
owner - owner set.
ptr - pointer - argument of set's find method.
index - index of an interval owning given pointer. If no such interval exists then this is the index of interval which to pointer points closest to the pointer. May be -1 if this object denotes an insertpoint to the beginning of the set.


Copyright 2003-2003-2006 null. All Rights Reserved.