Class TextPosn
- java.lang.Object
-
- com.adobe.xfa.text.TextMarkupBase
-
- com.adobe.xfa.text.TextPosnBase
-
- com.adobe.xfa.text.TextPosn
-
public class TextPosn extends TextPosnBase
Class TextPosition represents a position in a particular text stream. We refer to it as a tracked position, meaning that the stream tracks it and will update it as insertions and deletions occur at locations in the stream before this position. For information on a position object that is not tracked, please see the base class, TextPosnBase.For more information, please see the extenral documentation and the base class.
-
-
Field Summary
-
Fields inherited from class com.adobe.xfa.text.TextPosnBase
AFFINITY_AFTER, AFFINITY_BEFORE, POSN_AFTER, POSN_BEFORE, WORD_MODE_ALGORITHMIC, WORD_MODE_LEGACY, WORD_MODE_LOCALE_SENSITIVE
-
-
Constructor Summary
Constructors Constructor Description TextPosn()
Default constructor.TextPosn(TextPosn oSource)
Copy constructor.TextPosn(TextPosnBase oSource)
Copy (base class) constructor.TextPosn(TextStream poNewStream)
Constructor with stream and optional position type.TextPosn(TextStream poNewStream, int nNewIndex)
TextPosn(TextStream poNewStream, int nNewIndex, int eNewPosn)
Constructor with stream, index and optional position type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
associate(TextStream poNewStream)
void
associate(TextStream poNewStream, int eNewPosn)
Overridden: Associate position with a new stream.void
associate(TextStream poNewStream, int nNewIndex, int eNewPosn)
Overridden: Associate position with a new stream and index.void
attr(TextAttr oAttr)
Overridden: Insert attribute change.void
copyFrom(TextPosn oSource)
Assignment operator.void
copyFrom(TextPosnBase oSource)
Assignment operator from base class.boolean
equals(java.lang.Object object)
Equality comparison.int
hashCode()
void
para()
Overridden: Insert a paragraph mark.void
text(java.lang.String sText)
Overridden: Insert text.-
Methods inherited from class com.adobe.xfa.text.TextPosnBase
affinity, affinity, attribute, attribute, attribute, attributePtr, charPosition, charPosition, charRange, deleteAhead, deleteAhead, deleteAhead, deleteBack, deleteBack, deleteBack, down, end, end, enumerateMarkers, field, first, first, gt, gte, index, index, insert, insert, insert, insert, insert, insert, insertPara, isAtStart, isAtStart, isRTL, last, last, legacyPositioning, lt, lte, marker, markerEnd, markerStart, next, next, next, next, nextAttr, nextAttr, nextChar, nextChar, nextData, nextEmbed, nextEmbed, nextField, nextField, nextLine, nextPara, nextUserPosn, nextUserPosn, nextUserPosnType, nextUserPosnType, nextUserPosnType, nextUserPosnType, nextUserPosnTypeData, nextWord, nextWord, nextWord, notEqual, paraEnd, paraStart, position, position, prev, prev, prev, prev, prevAttr, prevAttr, prevChar, prevChar, prevData, prevEmbed, prevEmbed, prevField, prevField, prevLine, prevPara, prevUserPosn, prevUserPosn, prevUserPosnType, prevUserPosnType, prevUserPosnType, prevUserPosnType, prevUserPosnTypeData, prevWord, prevWord, prevWord, setKeyboard, setRTL, start, start, stream, tighten, up, wordEnd, wordEnd, wordStart, wordStart
-
Methods inherited from class com.adobe.xfa.text.TextMarkupBase
closeScopedBlock, issueFirstPara, openScopedBlock
-
-
-
-
Constructor Detail
-
TextPosn
public TextPosn()
Default constructor.The position is not initially associated with any stream.
-
TextPosn
public TextPosn(TextPosn oSource)
Copy constructor.Copy all contents of the source position, including stream association, index and before/after state.
- Parameters:
oSource
- Source position object to copy.
-
TextPosn
public TextPosn(TextPosnBase oSource)
Copy (base class) constructor.This method creates the position objecgt by copying the stream association, index and before/after type from an object in the base class, TextPosnBase. Note: even though this copies the base class, the new position object will be tracked by the stream.
- Parameters:
oSource
- Base class position object to copy.
-
TextPosn
public TextPosn(TextStream poNewStream)
Constructor with stream and optional position type.Construct a position object associated with the given stream and optional position type. The position is placed before the first non-attribute item in the stream.
- Parameters:
poNewStream
- Stream to associate with. NULL creates a position object with no initial association.
-
TextPosn
public TextPosn(TextStream poNewStream, int nNewIndex, int eNewPosn)
Constructor with stream, index and optional position type.Construct a position object associated with the given stream and optional position type. The position is placed at the specified index.
- Parameters:
poNewStream
- Stream to associate with. NULL creates a position object with no initial association.nNewIndex
- Index number for the position. Will be truncated if too large.eNewPosn
- (optional) Position type to use for the object. Default is POSN_AFTER.
-
TextPosn
public TextPosn(TextStream poNewStream, int nNewIndex)
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object object)
Description copied from class:TextPosnBase
Equality comparison. Two text positions are considered equal if they are associated with the same stream, have the same index number. Note that the operation does not compare any other attributes (e.g., before/after, affinity, RTL etc.) This is so that equality comparison has a consistent behaviour with greater/less than comparisons.- Overrides:
equals
in classTextPosnBase
- Parameters:
object
- - Position to compare against.- Returns:
- TRUE if the positions are equal; FALSE if not.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classTextPosnBase
-
copyFrom
public void copyFrom(TextPosn oSource)
Assignment operator.Copy the entire content of the source position object including stream association, index and before/after type. The position object will be tracked by the new stream (if not NULL) and will no longer be tracked by its old stream.
- Parameters:
oSource
- Source position object to copy.
-
copyFrom
public void copyFrom(TextPosnBase oSource)
Assignment operator from base class.Copy the entire content of the source position object including stream association, index and before/after type. The position object will be tracked by the new stream (if not NULL) and will no longer be tracked by its old stream.
- Overrides:
copyFrom
in classTextPosnBase
- Parameters:
oSource
- Source (base class) position object to copy.
-
associate
public void associate(TextStream poNewStream, int eNewPosn)
Overridden: Associate position with a new stream.This method overrides the base class implementation. It associates the position object with the specified stream, immediately before the first non-attribute item. The position object will be tracked by the new stream (if not NULL) and will no longer be tracked by its old stream.
- Overrides:
associate
in classTextPosnBase
- Parameters:
poNewStream
- Stream to associate with. NULL leaves the position object unassociated (and untracked).eNewPosn
- (optional) Position type to use for the object. Default is POSN_AFTER.
-
associate
public void associate(TextStream poNewStream, int nNewIndex, int eNewPosn)
Overridden: Associate position with a new stream and index.This method overrides the base class implementation. It associates the position object with the specified stream, at the specified index position. The position object will be tracked by the new stream (if not NULL) and will no longer be tracked by its old stream.
- Overrides:
associate
in classTextPosnBase
- Parameters:
poNewStream
- Stream to associate with. NULL leaves the position object unassociated (and untracked).nNewIndex
- Index of this position in the new stream. If the value is too large, it is truncated.eNewPosn
- (optional) Position type to use for the object. Default is POSN_AFTER.
-
associate
public void associate(TextStream poNewStream)
- Overrides:
associate
in classTextPosnBase
-
para
public void para()
Description copied from class:TextPosnBase
Overridden: Insert a paragraph mark. This method implements a virtual method declared in base class TextMkBase. It simply calls the InsertPara() method.- Overrides:
para
in classTextPosnBase
-
text
public void text(java.lang.String sText)
Description copied from class:TextPosnBase
Overridden: Insert text. This method implements a virtual method declared in base class TextMkBase. It simply calls the appropriate Insert() overload.- Overrides:
text
in classTextPosnBase
- Parameters:
sText
- - Text to be inserted.
-
attr
public void attr(TextAttr oAttr)
Description copied from class:TextPosnBase
Overridden: Insert attribute change. This method implements a virtual method declared in base class TextMkBase. It simply calls the appropriate Attribute() overload.- Overrides:
attr
in classTextPosnBase
- Parameters:
oAttr
- - Attribute change to insert.
-
-