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 charcharAt(int index)intgetOffset()Retrieves the current state of the offset property.voidincOffset()Increments the offset by one.voidincOffset(int amount)Increments the offset by the given amount.intlength()IMarkerFactory.IMarkermark()Creates a new marker.voidsetOffset(int offset)Random access to modify the offset.java.lang.CharSequencesubSequence(int start, int end)
-
-
-
Method Detail
-
getOffset
public int getOffset()
Description copied from interface:ICharSequenceWithOffsetRetrieves the current state of the offset property.- Specified by:
getOffsetin interfaceICharSequenceWithOffset- Returns:
- the current offset.
-
incOffset
public void incOffset()
Description copied from interface:ICharSequenceWithOffsetIncrements the offset by one.- Specified by:
incOffsetin interfaceICharSequenceWithOffset
-
incOffset
public void incOffset(int amount)
Description copied from interface:ICharSequenceWithOffsetIncrements the offset by the given amount. Can be used to decrement the offset.- Specified by:
incOffsetin interfaceICharSequenceWithOffset- Parameters:
amount- the number of offset that should be shifted.
-
setOffset
public void setOffset(int offset)
Description copied from interface:ICharSequenceWithOffsetRandom access to modify the offset. Can be set independently from the length of the char sequence.- Specified by:
setOffsetin interfaceICharSequenceWithOffset- Parameters:
offset- the new offset.
-
charAt
public char charAt(int index)
- Specified by:
charAtin interfacejava.lang.CharSequence
-
length
public int length()
- Specified by:
lengthin interfacejava.lang.CharSequence
-
subSequence
public java.lang.CharSequence subSequence(int start, int end)- Specified by:
subSequencein interfacejava.lang.CharSequence
-
mark
public IMarkerFactory.IMarker mark()
Description copied from interface:IMarkerFactoryCreates a new marker.- Specified by:
markin interfaceIMarkerFactory- Returns:
- the created marker.
-
-