public abstract class StringValue extends Value implements java.lang.CharSequence, ByteAppendable
Modifier and Type | Field and Description |
---|---|
static StringValue |
EMPTY |
protected static int |
IS_DOUBLE |
protected static int |
IS_LONG |
protected static int |
IS_STRING |
protected static int |
MIN_LENGTH |
L, NULL_ARGS, NULL_VALUE_ARRAY
Constructor and Description |
---|
StringValue() |
Modifier and Type | Method and Description |
---|---|
Value |
add(long rValue)
Adds to the following value.
|
StringValue |
append(boolean v)
Append a Java boolean to the value.
|
StringValue |
append(byte[] buf)
Append a byte buffer to the value.
|
StringValue |
append(byte[] buf,
int offset,
int length)
Append a byte buffer to the value.
|
StringValue |
append(char v)
Append a Java char to the value.
|
StringValue |
append(char[] buf)
Append a Java double to the value.
|
StringValue |
append(char[] buf,
int offset,
int length)
Append a Java buffer to the value.
|
StringValue |
append(java.lang.CharSequence buf,
int head,
int tail)
Append a Java buffer to the value.
|
StringValue |
append(double v)
Append a Java double to the value.
|
StringValue |
append(Env env,
StringValue unicodeStr,
java.lang.String charset) |
StringValue |
append(long v)
Append a Java long to the value.
|
StringValue |
append(java.lang.Object v)
Append a Java value to the value.
|
StringValue |
append(java.io.Reader reader)
Append from a read stream
|
StringValue |
append(java.io.Reader reader,
long length)
Append from a read stream
|
StringValue |
append(java.lang.String s)
Append a Java string to the value.
|
StringValue |
append(StringBuilderValue sb,
int head,
int tail)
Append a Java buffer to the value.
|
StringValue |
append(java.lang.String s,
int start,
int end)
Append a Java string to the value.
|
StringValue |
append(TempBuffer ptr)
Append from a temp buffer list
|
StringValue |
append(UnicodeBuilderValue sb,
int head,
int tail)
Append a Java buffer to the value.
|
StringValue |
append(Value v)
Append a Java value to the value.
|
Value |
append(Value index,
Value value)
Sets the array value, returning the new array, e.g.
|
StringValue |
appendByte(int v)
Append a Java byte to the value without conversions.
|
StringValue |
appendBytes(byte[] bytes,
int offset,
int end)
Append Java bytes to the value without conversions.
|
StringValue |
appendBytes(char[] buf,
int offset,
int length)
Append a Java char[] to the value without conversions.
|
StringValue |
appendBytes(java.lang.String s)
Append a Java String to the value without conversions.
|
StringValue |
appendBytes(StringValue s)
Append a Java String to the value without conversions.
|
int |
appendRead(BinaryInput is,
long length)
Append from an input stream, using InputStream semantics, i.e
call is.read() only once.
|
int |
appendRead(java.io.InputStream is,
long length)
Append from an input stream, using InputStream.read semantics,
i.e.
|
int |
appendReadAll(BinaryInput is,
long length)
Append from an input stream, reading all available data from the
stream.
|
int |
appendReadAll(java.io.InputStream is,
long length)
Append from an input stream, reading from the input stream until
end of file or the length is reached.
|
int |
appendReadAll(ReadStream is,
long length)
Append from an input stream, reading from the input stream until
end of file or the length is reached.
|
StringValue |
appendTo(UnicodeBuilderValue sb)
Append to a string builder.
|
StringValue |
appendUnicode(boolean v)
Append a Java boolean to the value.
|
StringValue |
appendUnicode(char v)
Append a Java char, possibly converting to a unicode string
|
StringValue |
appendUnicode(char[] buffer)
Append a Java char buffer, possibly converting to a unicode string
|
StringValue |
appendUnicode(char[] buffer,
int offset,
int length)
Append a Java char buffer, possibly converting to a unicode string
|
StringValue |
appendUnicode(double v)
Append a Java double to the value.
|
StringValue |
appendUnicode(long v)
Append a Java long to the value.
|
StringValue |
appendUnicode(java.lang.Object v)
Append a Java value to the value.
|
StringValue |
appendUnicode(java.lang.String value)
Append a Java char buffer, possibly converting to a unicode string
|
StringValue |
appendUnicode(java.lang.String value,
int offset,
int length)
Append a Java char buffer, possibly converting to a unicode string
|
StringValue |
appendUnicode(Value value)
Append a Java char buffer, possibly converting to a unicode string
|
StringValue |
appendUnicode(Value v1,
Value v2)
Append a Java char buffer, possibly converting to a unicode string
|
StringValue |
appendUtf8(byte[] buf)
Append a byte buffer to the value.
|
StringValue |
appendUtf8(byte[] buf,
int offset,
int length)
Append a byte buffer to the value.
|
Value |
bitAnd(Value rValue) |
Value |
bitOr(Value rValue) |
Value |
bitXor(Value rValue)
Binary xor.
|
char |
charAt(int index)
Returns the character at a particular location
|
Value |
charValueAt(long index)
Returns the character at an index
|
int |
cmp(Value rValue)
Returns true for equality
|
int |
cmpString(StringValue rValue)
Compare two strings
|
StringValue |
convertToUnicode(Env env,
java.lang.String charset)
Decodes from charset and returns UnicodeValue.
|
static StringValue |
create(char value)
Creates the string.
|
StringValue |
create(Env env,
StringValue unicodeStr,
java.lang.String charset) |
static Value |
create(java.lang.Object value)
Creates the string.
|
static Value |
create(java.lang.String value)
Creates the string.
|
abstract StringValue |
createStringBuilder()
Creates a string builder of the same type.
|
abstract StringValue |
createStringBuilder(int length)
Creates a string builder of the same type.
|
boolean |
endsWith(java.lang.CharSequence tail)
Returns true if the string ends with another string.
|
void |
ensureAppendCapacity(int size)
Ensure enough append capacity.
|
boolean |
eq(Value rValue)
Returns true for equality
|
boolean |
equals(java.lang.Object o)
Test for equality
|
boolean |
equalsIgnoreCase(java.lang.Object o)
Test for equality
|
boolean |
equalsString(java.lang.CharSequence s) |
boolean |
equalsStringIgnoreCase(java.lang.CharSequence s) |
void |
generate(java.io.PrintWriter out)
Generates code to recreate the expression.
|
Value |
get(Value key)
Returns the character at an index
|
Value |
getArg(Value key,
boolean isTop)
Returns the character at an index
|
void |
getChars(int stringOffset,
char[] buffer,
int offset,
int length)
Copies the chars
|
long |
getCrc32Value()
Calculates CRC32 value.
|
java.io.OutputStream |
getOutputStream()
Returns an OutputStream.
|
char[] |
getRawCharArray() |
java.lang.String |
getType()
Returns the type.
|
ValueType |
getValueType()
Returns the ValueType.
|
int |
hashCode()
Returns the hash code.
|
int |
hashCodeCaseInsensitive()
Returns the case-insensitive hash code
|
Value |
increment(int incr)
Increment the following value.
|
int |
indexOf(char match)
Returns the last index of the match string, starting from the head.
|
int |
indexOf(char match,
int head)
Returns the last index of the match string, starting from the head.
|
int |
indexOf(java.lang.CharSequence match)
Returns the first index of the match string, starting from the head.
|
int |
indexOf(java.lang.CharSequence match,
int head)
Returns the first index of the match string, starting from the head.
|
StringValue |
intern()
Interns the string.
|
boolean |
isCallable(Env env,
boolean isCheckSyntaxOnly,
Value nameRef)
Returns true for a callable object.
|
boolean |
isDoubleConvertible()
Returns true for a double
|
boolean |
isEmpty()
Returns true if the value is empty
|
boolean |
isLongConvertible()
Returns true for a long
|
boolean |
isNumber()
Returns true for a number
|
boolean |
isNumeric()
Returns true for is_numeric
|
boolean |
isScalar()
Returns true for a scalar
|
boolean |
isset(Value indexV)
Return true if the array value is set
|
boolean |
isString()
Returns true for StringValue
|
void |
jsonEncode(Env env,
JsonEncodeContext context,
StringValue sb)
Encodes the value in JSON.
|
int |
lastIndexOf(char match)
Returns the last index of the match string, starting from the head.
|
int |
lastIndexOf(char match,
int tail)
Returns the last index of the match string, starting from the head.
|
int |
lastIndexOf(java.lang.CharSequence match)
Returns the last index of the match string, starting from the tail.
|
int |
lastIndexOf(java.lang.CharSequence match,
int tail)
Returns the last index of the match string, starting from the tail.
|
int |
length()
Returns the length of the string.
|
Value |
putThisFieldArray(Env env,
Value obj,
StringValue fieldName,
Value index,
Value value)
Appends a value to an array that is a field of an object.
|
boolean |
regionMatches(int offset,
char[] mBuffer,
int mOffset,
int mLength)
Returns true if the region matches
|
boolean |
regionMatches(int offset,
StringValue match,
int mOffset,
int mLength)
Returns true if the region matches
|
boolean |
regionMatchesIgnoreCase(int offset,
char[] match,
int mOffset,
int mLength)
Returns true if the region matches
|
void |
serialize(Env env,
java.lang.StringBuilder sb)
Serializes the value.
|
Value |
setCharValueAt(long index,
Value value)
sets the character at an index
|
void |
setLength(int length)
Sets the length.
|
boolean |
startsWith(java.lang.CharSequence head)
Returns true if the string begins with another string.
|
java.lang.String |
stringSubstring(int begin,
int end)
Returns a String substring
|
Value |
sub(long rValue)
Adds to the following value.
|
java.lang.CharSequence |
subSequence(int start,
int end)
Returns a subsequence
|
StringValue |
substring(int head)
Returns a StringValue substring.
|
StringValue |
substring(int begin,
int end)
Returns a StringValue substring.
|
Value |
toAutoArray()
Converts to an array if null.
|
Value |
toAutoObject(Env env)
Converts to an object.
|
int |
toBinaryValueMarshalCost()
Cost to convert to a binary value
|
boolean |
toBoolean()
Converts to a boolean.
|
int |
toByteMarshalCost()
Cost to convert to a byte
|
byte[] |
toBytes() |
Callable |
toCallable(Env env,
boolean isOptional)
Converts to a callable object
|
char[] |
toCharArray()
Returns a character array
|
int |
toCharArrayMarshalCost()
Cost to convert to a char[]
|
int |
toCharMarshalCost()
Cost to convert to a character
|
abstract java.lang.String |
toDebugString() |
double |
toDouble()
Converts to a double.
|
static double |
toDouble(java.lang.String s)
Converts to a double.
|
int |
toDoubleMarshalCost()
Cost to convert to a double
|
int |
toFloatMarshalCost()
Cost to convert to a float
|
java.io.InputStream |
toInputStream()
Returns a byteArrayInputStream for the value.
|
int |
toIntegerMarshalCost()
Cost to convert to an integer
|
java.lang.Object |
toJavaObject()
Converts to a Java object.
|
Value |
toKey()
Converts to a key.
|
static long |
toLong(java.lang.String string)
Converts to a long.
|
int |
toLongMarshalCost()
Cost to convert to a long
|
StringValue |
toLowerCase() |
StringValue |
toLowerCase(java.util.Locale locale)
Convert to lower case.
|
java.io.Reader |
toReader(java.lang.String charset)
Returns a char stream.
|
int |
toShortMarshalCost()
Cost to convert to a short
|
java.io.Reader |
toSimpleReader() |
java.lang.String |
toString(java.lang.String charset) |
StringValue |
toStringBuilder(Env env)
Converts to a string builder
|
int |
toStringMarshalCost()
Cost to convert to a String
|
StringValue |
toStringValue()
Converts to a string value.
|
StringValue |
toStringValue(Env env)
Converts to a string value.
|
int |
toStringValueMarshalCost()
Cost to convert to a StringValue
|
StringValue |
toUnicode(Env env)
Converts to a unicode value.
|
StringValue |
toUnicodeValue(Env env,
java.lang.String charset)
Decodes from charset and returns UnicodeValue.
|
StringValue |
toUpperCase() |
StringValue |
toUpperCase(java.util.Locale locale)
Convert to upper case.
|
java.lang.Object |
valuesToArray(Env env,
java.lang.Class elementType)
Takes the values of this array, unmarshalls them to objects of type
elementType, and puts them in a java array.
|
abstract void |
varDumpImpl(Env env,
WriteStream out,
int depth,
java.util.IdentityHashMap<Value,java.lang.String> valueSet) |
protected void |
varExportImpl(StringValue sb,
int level)
Exports the value.
|
void |
write(byte[] buffer,
int offset,
int len)
Appends buffer to the ByteAppendable.
|
void |
write(int value)
Appends value to the ByteAppendable.
|
void |
writeTo(java.io.OutputStream os)
Writes to a stream
|
abs, add, addOne, appendTo, appendTo, appendTo, call, call, call, call, call, call, call, callCopy, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callRef, callRef, callRef, callRef, callRef, callRef, callRef, checkPrivate, checkProtected, clone, containsKey, copy, copy, copy, copyArrayItem, copyReturn, copySaveFunArg, copyStringBuilder, copyTree, current, div, div, end, eql, eqValue, findFunction, findQuercusClass, geq, get, getArgTail, getArray, getArray, getBaseIterator, getCallableName, getCalledClass, getClassName, getCount, getCountRecursive, getDirty, getField, getFieldArg, getFieldArgRef, getFieldArray, getFieldObject, getFieldVar, getHashCode, getIterator, getKeyArray, getKeyIterator, getObject, getObject, getObjectHash, getQuercusClass, getRef, getResourceType, getSize, getStaticFieldValue, getStaticFieldVar, getThisField, getThisFieldArg, getThisFieldArgRef, getThisFieldArray, getThisFieldObject, getThisFieldVar, getValueArray, getValueIterator, getVar, gt, hasCurrent, initField, initField, initField, initIncompleteField, isA, isA, isArray, isBinary, isBoolean, isDefault, isDouble, isEmpty, isFieldExists, isFieldInit, isLong, isNull, isNumberConvertible, isObject, isResource, isset, issetField, issetThisField, isUnicode, isVar, key, keyExists, leq, lshift, lt, mod, mul, mul, neg, next, nextIndex, pop, pos, postdecr, postincr, postincr, predecr, preincr, preincr, prev, print, print, printDepth, printJavaChar, printJavaString, printR, printRImpl, put, put, put, putArray, putField, putField, putField, putObject, putThisField, putThisField, putVar, remove, reset, rshift, serialize, set, setFieldInit, setJavaObject, setStaticFieldRef, shuffle, sub_rev, sub, subOne, toArgRef, toArray, toArrayValue, toBigDecimal, toBigInteger, toBinaryValue, toBinaryValue, toBinaryValue, toBooleanMarshalCost, toByteArrayMarshalCost, toChar, toDouble, toDouble, toDouble, toDouble, toDoubleValue, toException, toInt, toInternString, toJavaBoolean, toJavaByte, toJavaCalendar, toJavaCharacter, toJavaCollection, toJavaDate, toJavaDouble, toJavaEnum, toJavaFloat, toJavaInteger, toJavaList, toJavaLong, toJavaMap, toJavaObject, toJavaObjectMarshalCost, toJavaObjectNotNull, toJavaShort, toJavaString, toJavaURL, toLocalRef, toLocalThis, toLocalValue, toLocalValueReadOnly, toLocalVar, toLocalVarDeclAsRef, toLong, toLong, toLong, toLong, toLong, toLongValue, toObject, toRef, toRefValue, toString, toStringBuilder, toStringBuilder, toStringBuilder, toUnicodeValue, toUnicodeValue, toUnicodeValueMarshalCost, toValue, toVar, unsetArray, unsetField, unsetThisArray, unsetThisField, unsetThisPrivateField, varDump, varExport
public static final StringValue EMPTY
protected static final int MIN_LENGTH
protected static final int IS_STRING
protected static final int IS_LONG
protected static final int IS_DOUBLE
public abstract StringValue createStringBuilder()
public abstract StringValue createStringBuilder(int length)
public static Value create(java.lang.String value)
public static StringValue create(char value)
public static Value create(java.lang.Object value)
public StringValue create(Env env, StringValue unicodeStr, java.lang.String charset)
public ValueType getValueType()
getValueType
in class Value
public boolean isLongConvertible()
isLongConvertible
in class Value
public boolean isDoubleConvertible()
isDoubleConvertible
in class Value
public boolean isNumber()
public boolean isNumeric()
public boolean isScalar()
public final boolean isString()
public boolean isEmpty()
public boolean isCallable(Env env, boolean isCheckSyntaxOnly, Value nameRef)
Value
isCallable
in class Value
public int toDoubleMarshalCost()
toDoubleMarshalCost
in class Value
public int toFloatMarshalCost()
toFloatMarshalCost
in class Value
public int toLongMarshalCost()
toLongMarshalCost
in class Value
public int toIntegerMarshalCost()
toIntegerMarshalCost
in class Value
public int toShortMarshalCost()
toShortMarshalCost
in class Value
public int toByteMarshalCost()
toByteMarshalCost
in class Value
public int toCharMarshalCost()
toCharMarshalCost
in class Value
public int toStringMarshalCost()
toStringMarshalCost
in class Value
public int toCharArrayMarshalCost()
toCharArrayMarshalCost
in class Value
public int toStringValueMarshalCost()
toStringValueMarshalCost
in class Value
public int toBinaryValueMarshalCost()
toBinaryValueMarshalCost
in class Value
public int cmpString(StringValue rValue)
public StringValue toStringValue()
toStringValue
in class Value
public StringValue toStringValue(Env env)
toStringValue
in class Value
public static long toLong(java.lang.String string)
public static double toDouble(java.lang.String s)
public final Value toAutoObject(Env env)
toAutoObject
in class Value
public Value toAutoArray()
toAutoArray
in class Value
public java.lang.Object toJavaObject()
toJavaObject
in class Value
public java.lang.Object valuesToArray(Env env, java.lang.Class elementType)
valuesToArray
in class Value
public Callable toCallable(Env env, boolean isOptional)
toCallable
in class Value
public Value append(Value index, Value value)
public Value putThisFieldArray(Env env, Value obj, StringValue fieldName, Value index, Value value)
putThisFieldArray
in class Value
public Value charValueAt(long index)
charValueAt
in class Value
public Value setCharValueAt(long index, Value value)
setCharValueAt
in class Value
public Value increment(int incr)
public void serialize(Env env, java.lang.StringBuilder sb)
public void jsonEncode(Env env, JsonEncodeContext context, StringValue sb)
jsonEncode
in class Value
public StringValue append(java.lang.String s)
public StringValue append(java.lang.String s, int start, int end)
public StringValue append(char[] buf, int offset, int length)
public StringValue append(char[] buf)
public StringValue append(java.lang.CharSequence buf, int head, int tail)
public StringValue append(StringBuilderValue sb, int head, int tail)
public StringValue append(UnicodeBuilderValue sb, int head, int tail)
public StringValue append(Env env, StringValue unicodeStr, java.lang.String charset)
public StringValue append(char v)
public StringValue append(boolean v)
public StringValue append(long v)
public StringValue append(double v)
public StringValue append(java.lang.Object v)
public StringValue append(Value v)
public void ensureAppendCapacity(int size)
public StringValue append(byte[] buf, int offset, int length)
public StringValue append(byte[] buf)
public StringValue appendUtf8(byte[] buf, int offset, int length)
public StringValue appendUtf8(byte[] buf)
public StringValue appendTo(UnicodeBuilderValue sb)
public StringValue appendUnicode(boolean v)
public StringValue appendUnicode(long v)
public StringValue appendUnicode(double v)
public StringValue appendUnicode(java.lang.Object v)
public StringValue appendUnicode(char v)
public StringValue appendUnicode(char[] buffer, int offset, int length)
public StringValue appendUnicode(char[] buffer)
public StringValue appendUnicode(java.lang.String value)
public StringValue appendUnicode(java.lang.String value, int offset, int length)
public StringValue appendUnicode(Value value)
public StringValue appendUnicode(Value v1, Value v2)
public StringValue appendByte(int v)
public StringValue appendBytes(java.lang.String s)
public StringValue appendBytes(StringValue s)
public StringValue appendBytes(char[] buf, int offset, int length)
public StringValue appendBytes(byte[] bytes, int offset, int end)
public StringValue append(TempBuffer ptr)
public StringValue append(java.io.Reader reader) throws java.io.IOException
java.io.IOException
public StringValue append(java.io.Reader reader, long length) throws java.io.IOException
java.io.IOException
public int appendRead(java.io.InputStream is, long length)
public int appendReadAll(java.io.InputStream is, long length)
public int appendReadAll(ReadStream is, long length)
public int appendRead(BinaryInput is, long length)
public int appendReadAll(BinaryInput is, long length)
protected void varExportImpl(StringValue sb, int level)
varExportImpl
in class Value
public int length()
public char charAt(int index)
charAt
in interface java.lang.CharSequence
public java.lang.CharSequence subSequence(int start, int end)
subSequence
in interface java.lang.CharSequence
public void setLength(int length)
public final int indexOf(java.lang.CharSequence match)
public int indexOf(java.lang.CharSequence match, int head)
public int indexOf(char match)
public int indexOf(char match, int head)
public final int lastIndexOf(char match)
public int lastIndexOf(char match, int tail)
public int lastIndexOf(java.lang.CharSequence match)
public int lastIndexOf(java.lang.CharSequence match, int tail)
public boolean regionMatches(int offset, char[] mBuffer, int mOffset, int mLength)
public boolean regionMatches(int offset, StringValue match, int mOffset, int mLength)
public boolean regionMatchesIgnoreCase(int offset, char[] match, int mOffset, int mLength)
public boolean startsWith(java.lang.CharSequence head)
public boolean endsWith(java.lang.CharSequence tail)
public StringValue substring(int head)
public StringValue substring(int begin, int end)
public java.lang.String stringSubstring(int begin, int end)
public char[] toCharArray()
public char[] getRawCharArray()
public void getChars(int stringOffset, char[] buffer, int offset, int length)
public final StringValue toLowerCase()
public StringValue toLowerCase(java.util.Locale locale)
public StringValue toUpperCase()
public StringValue toUpperCase(java.util.Locale locale)
public java.io.InputStream toInputStream()
toInputStream
in class Value
public java.io.Reader toSimpleReader()
public java.io.Reader toReader(java.lang.String charset) throws java.io.UnsupportedEncodingException
charset
- to decode bytes byjava.io.UnsupportedEncodingException
public java.lang.String toString(java.lang.String charset) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public byte[] toBytes()
public StringValue toUnicode(Env env)
public StringValue toUnicodeValue(Env env, java.lang.String charset)
env
- charset
- public StringValue convertToUnicode(Env env, java.lang.String charset)
env
- charset
- public StringValue toStringBuilder(Env env)
toStringBuilder
in class Value
public boolean isset(Value indexV)
public void writeTo(java.io.OutputStream os)
public java.io.OutputStream getOutputStream()
public long getCrc32Value()
public void write(int value)
ByteAppendable
write
in interface ByteAppendable
public void write(byte[] buffer, int offset, int len)
write
in interface ByteAppendable
public int hashCodeCaseInsensitive()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public boolean equalsIgnoreCase(java.lang.Object o)
public boolean equalsString(java.lang.CharSequence s)
public boolean equalsStringIgnoreCase(java.lang.CharSequence s)
public void generate(java.io.PrintWriter out) throws java.io.IOException
public abstract java.lang.String toDebugString()
toDebugString
in class Value
public abstract void varDumpImpl(Env env, WriteStream out, int depth, java.util.IdentityHashMap<Value,java.lang.String> valueSet) throws java.io.IOException
varDumpImpl
in class Value
java.io.IOException
public StringValue intern()