Class StringWithOffset
- java.lang.Object
-
- org.eclipse.xtext.parser.packrat.matching.StringWithOffset
-
- All Implemented Interfaces:
java.lang.CharSequence
,ICharSequenceWithOffset
,IMarkerFactory
public class StringWithOffset extends java.lang.Object implements ICharSequenceWithOffset, IMarkerFactory
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.xtext.parser.packrat.IMarkerFactory
IMarkerFactory.IMarker
-
-
Constructor Summary
Constructors Constructor Description StringWithOffset(java.lang.String value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description char
charAt(int index)
int
getOffset()
Retrieves the current state of the offset property.void
incOffset()
Increments the offset by one.void
incOffset(int amount)
Increments the offset by the given amount.int
length()
IMarkerFactory.IMarker
mark()
Creates a new marker.void
setOffset(int offset)
Random access to modify the offset.java.lang.CharSequence
subSequence(int start, int end)
-
-
-
Method Detail
-
getOffset
public int getOffset()
Description copied from interface:ICharSequenceWithOffset
Retrieves the current state of the offset property.- Specified by:
getOffset
in interfaceICharSequenceWithOffset
- Returns:
- the current offset.
-
incOffset
public void incOffset()
Description copied from interface:ICharSequenceWithOffset
Increments the offset by one.- Specified by:
incOffset
in interfaceICharSequenceWithOffset
-
incOffset
public void incOffset(int amount)
Description copied from interface:ICharSequenceWithOffset
Increments the offset by the given amount. Can be used to decrement the offset.- Specified by:
incOffset
in interfaceICharSequenceWithOffset
- Parameters:
amount
- the number of offset that should be shifted.
-
setOffset
public void setOffset(int offset)
Description copied from interface:ICharSequenceWithOffset
Random access to modify the offset. Can be set independently from the length of the char sequence.- Specified by:
setOffset
in interfaceICharSequenceWithOffset
- Parameters:
offset
- the new offset.
-
charAt
public char charAt(int index)
- Specified by:
charAt
in interfacejava.lang.CharSequence
-
length
public int length()
- Specified by:
length
in interfacejava.lang.CharSequence
-
subSequence
public java.lang.CharSequence subSequence(int start, int end)
- Specified by:
subSequence
in interfacejava.lang.CharSequence
-
mark
public IMarkerFactory.IMarker mark()
Description copied from interface:IMarkerFactory
Creates a new marker.- Specified by:
mark
in interfaceIMarkerFactory
- Returns:
- the created marker.
-
-