Package org.owasp.esapi.codecs
Class AbstractPushbackSequence<T>
- java.lang.Object
-
- org.owasp.esapi.codecs.AbstractPushbackSequence<T>
-
- Type Parameters:
T
-
- All Implemented Interfaces:
PushbackSequence<T>
- Direct Known Subclasses:
PushBackSequenceImpl
,PushbackString
public abstract class AbstractPushbackSequence<T> extends java.lang.Object implements PushbackSequence<T>
This Abstract class provides the generic logic for using aPushbackSequence
in regards to iterating strings. The final Impl is intended for the user to supply a type T such that the pushback interface can be utilized for sequences of type T. Presently this generic class is limited by the fact that input is a String.- Author:
- Matt Seil
-
-
Constructor Summary
Constructors Constructor Description AbstractPushbackSequence(java.lang.String input)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Determine if this sequence has another element.int
index()
Get the current index of the PushbackString.void
pushback(T c)
-
-
-
Method Detail
-
pushback
public void pushback(T c)
- Specified by:
pushback
in interfacePushbackSequence<T>
-
index
public int index()
Get the current index of the PushbackString. Typically used in error messages.- Specified by:
index
in interfacePushbackSequence<T>
- Returns:
- The current index of the PushbackSequence.
-
hasNext
public boolean hasNext()
Determine if this sequence has another element.- Specified by:
hasNext
in interfacePushbackSequence<T>
- Returns:
- True if there is another element in this sequence. False otherwise.
-
-