Class StructuredTextSingle
java.lang.Object
org.eclipse.equinox.bidi.custom.StructuredTextTypeHandler
org.eclipse.equinox.bidi.internal.StructuredTextSingle
A base handler for structured text composed of two parts separated by a
 separator. The first occurrence of the separator delimits the end of the
 first part and the start of the second part. Further occurrences of the
 separator, if any, are treated like regular characters of the second text
 part. The handler makes sure that the text be presented in the form (assuming
 that the equal sign is the separator):
 
part1 = part2The string returned by
getSeparators for this handler should contain exactly one character.
 Additional characters will be ignored.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintReturns 1 as number of special cases handled by this handler.intindexOfSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int fromIndex) Locates occurrences of the separator.intprocessSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int separLocation) Inserts a mark before the separator if needed and skips to the end of the source string.Methods inherited from class org.eclipse.equinox.bidi.custom.StructuredTextTypeHandlergetDirection, getDirection, getSeparators, insertMark, processSeparator, skipProcessing, toString
- 
Constructor Details- 
StructuredTextSingle
 
- 
- 
Method Details- 
indexOfSpecialpublic int indexOfSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int fromIndex) Locates occurrences of the separator.- Overrides:
- indexOfSpecialin class- StructuredTextTypeHandler
- Parameters:
- expert- IStructuredTextExpert instance through which this handler is invoked. The handler can use IStructuredTextExpert methods to query items stored in the expert instance, like the current- environment.
- text- the structured text string before addition of any directional formatting characters.
- charTypes- an object whose methods can be useful to the handler.
- offsets- an object whose methods can be useful to the handler.
- caseNumber- number of the special case to locate. This number varies from 1 to the number of special cases returned by- StructuredTextTypeHandler.getSpecialsCount(org.eclipse.equinox.bidi.advanced.IStructuredTextExpert)for this handler. The meaning of this number is internal to the class implementing- indexOfSpecial.
- fromIndex- the index within- textto start the search from.
- Returns:
- the position where the start of the special case corresponding to
         caseNumberwas located. The method must return the first occurrence of whatever identifies the start of the special case starting fromfromIndex. The method does not have to check if this occurrence appears within the scope of another special case (e.g. a comment starting delimiter within the scope of a literal or vice-versa).
 If no occurrence is found, the method must return -1.
- See Also:
 
- 
processSpecialpublic int processSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int separLocation) Inserts a mark before the separator if needed and skips to the end of the source string.- Overrides:
- processSpecialin class- StructuredTextTypeHandler
- Parameters:
- expert- IStructuredTextExpert instance through which this handler is invoked. The handler can use IStructuredTextExpert methods to query items stored in the expert instance, like the current- environment.
- text- the structured text string before addition of any directional formatting characters.
- charTypes- an object whose methods can be useful to the handler.
- offsets- an object whose methods can be useful to the handler.
- caseNumber- number of the special case to handle.
- separLocation- the position returned by- StructuredTextTypeHandler.indexOfSpecial(org.eclipse.equinox.bidi.advanced.IStructuredTextExpert, java.lang.String, org.eclipse.equinox.bidi.custom.StructuredTextCharTypes, org.eclipse.equinox.bidi.custom.StructuredTextOffsets, int, int). After calls to- IStructuredTextExpert.leanToFullText(java.lang.String)and other methods of- IStructuredTextExpertwhich set a non-null final state,- processSpecialis called when initializing the processing with value of- separLocationequal to- -1.
- Returns:
- the length of text.
 
- 
getSpecialsCountReturns 1 as number of special cases handled by this handler.- Overrides:
- getSpecialsCountin class- StructuredTextTypeHandler
- Parameters:
- expert- IStructuredTextExpert instance through which this handler is invoked. The handler can use IStructuredTextExpert methods to query items stored in the expert instance, like the current- environment.
- Returns:
- 1.
 
 
-