Package org.parboiled.support
Class StringVar
Simple specialization of a
Var
for Strings. Provides a few convenience helper methods.-
Constructor Details
-
StringVar
public StringVar()Initializes a new StringVar with a null initial value. -
StringVar
Initializes a new StringVar with the given initial value.- Parameters:
value
- the initial value
-
-
Method Details
-
isEmpty
public boolean isEmpty()Returns true if the wrapped string is either null or empty.- Returns:
- true if the wrapped string is either null or empty
-
append
Appends the given string. If this instance is currently uninitialized the given string is used for initialization.- Parameters:
text
- the text to append- Returns:
- true
-
appended
Appends the given string. If this instance is currently uninitialized the given string is used for initialization.- Parameters:
text
- the text to append- Returns:
- this instance
-
append
public boolean append(char c) Appends the given char. If this instance is currently uninitialized the given char is used for initialization.- Parameters:
c
- the char to append- Returns:
- true
-
appended
Appends the given char. If this instance is currently uninitialized the given string is used for initialization.- Parameters:
c
- the char to append- Returns:
- this instance
-