com.caucho.quercus.env
Class LargeStringBuilderValue

java.lang.Object
  extended by com.caucho.quercus.env.Value
      extended by com.caucho.quercus.env.StringValue
          extended by com.caucho.quercus.env.LargeStringBuilderValue
All Implemented Interfaces:
ByteAppendable, java.io.Serializable, java.lang.CharSequence

public class LargeStringBuilderValue
extends StringValue

Represents a 8-bit PHP 5 style binary builder (unicode.semantics = off), used for large data like file reads.

See Also:
Serialized Form

Field Summary
protected  byte[][] _bufferList
           
protected  int _length
           
static StringValue EMPTY
           
static int SIZE
           
 
Fields inherited from class com.caucho.quercus.env.StringValue
IS_DOUBLE, IS_LONG, IS_STRING, MIN_LENGTH
 
Fields inherited from class com.caucho.quercus.env.Value
L, NULL_ARGS, NULL_VALUE_ARRAY, SCALAR_V
 
Constructor Summary
LargeStringBuilderValue()
           
LargeStringBuilderValue(byte[][] bufferList, int length)
           
LargeStringBuilderValue(StringValue s)
           
 
Method Summary
 StringValue append(boolean v)
          Append a Java boolean to the value.
 StringValue append(byte v)
          Append a Java byte to the value without conversions.
 StringValue append(byte[] buf)
          Append a double to the value.
 StringValue append(byte[] buf, int offset, int length)
          Append a buffer to the value.
 StringValue append(char v)
          Append a Java byte to the value without conversions.
 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(long v)
          Append a Java long to the value.
 StringValue append(java.lang.String s)
          Append a Java string to the value.
 StringValue append(Value v)
          Append a Java value to the value.
 int appendRead(java.io.InputStream is, long length)
          Append from an input stream, using InputStream.read semantics, i.e.
 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.
 void appendTo(StringValue bb)
          Append to a string builder.
 StringValue appendTo(UnicodeBuilderValue sb)
          Append to a string builder.
 StringValue appendUnicode(char[] buf, int offset, int length)
          Append a Java buffer to the value.
 char charAt(int index)
          Returns the character at a particular location
 Value charValueAt(long index)
          Returns the character at an index
 StringValue createEmptyStringBuilder()
          Creates an empty string builder of the same type.
 StringValue createStringBuilder()
          Creates a string builder of the same type.
 StringValue createStringBuilder(int length)
          Creates a string builder of the same type.
 Value get(Value key)
          Returns the character at an index
 java.io.OutputStream getOutputStream()
          Returns an OutputStream.
 java.lang.String getType()
          Returns the type.
 java.lang.String getValue()
          Returns the value.
 ValueType getValueType()
          Returns the ValueType.
 int hashCode()
          Returns the hash code.
 boolean isDouble()
          Returns true for a double
 boolean isLongConvertible()
          Returns true for a long
 boolean isNumber()
          Returns true for a number
 boolean isScalar()
          Returns true for a scalar
 int length()
          Returns the length of the string.
 void print(Env env)
          Prints the value.
 void print(Env env, WriteStream out)
          Prints the value.
 void serialize(Env env, java.lang.StringBuilder sb)
          Serializes the value.
 java.lang.CharSequence subSequence(int start, int end)
          Returns a subsequence
 StringValue toBinaryValue(Env env)
          Converts to a BinaryValue.
 StringValue toBinaryValue(java.lang.String charset)
          Converts to a BinaryValue in desired charset.
 boolean toBoolean()
          Converts to a boolean.
 byte[] toBytes()
          Converts to a byte array, with no consideration of character encoding.
 java.lang.String toDebugString()
           
 double toDouble()
          Converts to a double.
 java.io.InputStream toInputStream()
          Convert to an input stream.
 java.lang.Object toJavaObject()
          Converts to an object.
 Value toKey()
          Converts to a key.
 long toLong()
          Converts to a long.
 StringValue toLowerCase()
          Convert to lower case.
 java.lang.String toString()
          Converts to a string.
 StringValue toStringBuilder()
          Converts to a string builder
 StringValue toStringBuilder(Env env)
          Converts to a string builder
 StringValue toUpperCase()
          Convert to lower case.
 void varDumpImpl(Env env, WriteStream out, int depth, java.util.IdentityHashMap<Value,java.lang.String> valueSet)
           
 
Methods inherited from class com.caucho.quercus.env.StringValue
add, append, append, append, append, append, append, append, append, append, append, appendByte, appendBytes, appendBytes, appendBytes, appendBytes, appendRead, appendReadAll, appendReadAll, appendUnicode, appendUnicode, appendUnicode, appendUnicode, appendUnicode, appendUnicode, appendUnicode, appendUnicode, appendUnicode, appendUnicode, appendUtf8, appendUtf8, bitAnd, bitOr, bitXor, cmp, cmpString, convertToUnicode, create, create, create, create, endsWith, ensureAppendCapacity, eq, equals, equalsIgnoreCase, generate, getArg, getChars, getCrc32Value, getRawCharArray, hashCodeCaseInsensitive, increment, indexOf, indexOf, indexOf, indexOf, isDoubleConvertible, isEmpty, isNumeric, isPHP5String, isset, isString, jsonEncode, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, regionMatches, regionMatches, regionMatchesIgnoreCase, setCharValueAt, stringSubstring, sub, substring, substring, toAutoArray, toAutoObject, toBinaryValueMarshalCost, toByteMarshalCost, toCallable, toCharArray, toCharArrayMarshalCost, toCharMarshalCost, toDouble, toDoubleMarshalCost, toFloatMarshalCost, toInputStream, toIntegerMarshalCost, toLong, toLongMarshalCost, toReader, toShortMarshalCost, toSimpleReader, toStringMarshalCost, toStringValue, toStringValue, toStringValueMarshalCost, toUnicode, toUnicodeValue, valuesToArray, varExport, write, write, writeTo
 
Methods inherited from class com.caucho.quercus.env.Value
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, geq, getArray, getArray, getBaseIterator, getCallableName, getCalledClass, getClassName, getCount, getCountRecursive, getDirty, getField, getFieldArg, getFieldArgRef, getFieldArray, getFieldObject, getFieldVar, getHashCode, getIterator, getKeyArray, getKeyIterator, getObject, getObject, getQuercusClass, getRef, getResourceType, getSize, getThisField, getThisFieldArg, getThisFieldArgRef, getThisFieldArray, getThisFieldObject, getThisFieldVar, getValueArray, getValueIterator, getVar, gt, hasCurrent, initField, isA, isA, isArray, isBinary, isBoolean, isCallable, isDefault, 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, printDepth, printJavaChar, printJavaString, printR, printRImpl, put, put, put, putField, putField, putField, putObject, putThisField, putThisField, putVar, remove, reset, rshift, serialize, set, setFieldInit, setJavaObject, shuffle, sub_rev, sub, subOne, toArgRef, toArray, toArrayValue, toBigDecimal, toBigInteger, toBinaryValue, toBooleanMarshalCost, toByteArrayMarshalCost, toChar, toDoubleValue, toException, toInt, toInternString, toJavaBoolean, toJavaByte, toJavaCalendar, toJavaCharacter, toJavaCollection, toJavaDate, toJavaDouble, toJavaFloat, toJavaInteger, toJavaList, toJavaLong, toJavaMap, toJavaObject, toJavaObjectMarshalCost, toJavaObjectNotNull, toJavaShort, toJavaString, toJavaURL, toLocalRef, toLocalThis, toLocalValue, toLocalValueReadOnly, toLocalVar, toLocalVarDeclAsRef, toLongValue, toObject, toRef, toRefValue, toString, toStringBuilder, toStringBuilder, toUnicodeValue, toUnicodeValue, toUnicodeValueMarshalCost, toValue, toVar, unsetArray, unsetField, unsetThisArray, unsetThisField, varDump
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final StringValue EMPTY

SIZE

public static final int SIZE
See Also:
Constant Field Values

_bufferList

protected byte[][] _bufferList

_length

protected int _length
Constructor Detail

LargeStringBuilderValue

public LargeStringBuilderValue()

LargeStringBuilderValue

public LargeStringBuilderValue(byte[][] bufferList,
                               int length)

LargeStringBuilderValue

public LargeStringBuilderValue(StringValue s)
Method Detail

createEmptyStringBuilder

public StringValue createEmptyStringBuilder()
Creates an empty string builder of the same type.


getValue

public java.lang.String getValue()
Returns the value.


getType

public java.lang.String getType()
Returns the type.

Overrides:
getType in class StringValue

getValueType

public ValueType getValueType()
Returns the ValueType.

Overrides:
getValueType in class StringValue

isLongConvertible

public boolean isLongConvertible()
Returns true for a long

Overrides:
isLongConvertible in class StringValue

isDouble

public boolean isDouble()
Returns true for a double

Overrides:
isDouble in class Value

isNumber

public boolean isNumber()
Returns true for a number

Overrides:
isNumber in class StringValue

isScalar

public boolean isScalar()
Returns true for a scalar

Overrides:
isScalar in class StringValue

toBoolean

public boolean toBoolean()
Converts to a boolean.

Overrides:
toBoolean in class StringValue

toLong

public long toLong()
Converts to a long.

Overrides:
toLong in class Value

toDouble

public double toDouble()
Converts to a double.

Overrides:
toDouble in class StringValue

toInputStream

public java.io.InputStream toInputStream()
Convert to an input stream.

Overrides:
toInputStream in class StringValue
Returns:
InputStream

toString

public java.lang.String toString()
Converts to a string.

Specified by:
toString in interface java.lang.CharSequence
Overrides:
toString in class java.lang.Object

toJavaObject

public java.lang.Object toJavaObject()
Converts to an object.

Overrides:
toJavaObject in class StringValue

toStringBuilder

public StringValue toStringBuilder()
Converts to a string builder

Overrides:
toStringBuilder in class Value

toBinaryValue

public StringValue toBinaryValue(Env env)
Converts to a BinaryValue.

Overrides:
toBinaryValue in class Value

toBinaryValue

public StringValue toBinaryValue(java.lang.String charset)
Converts to a BinaryValue in desired charset.

Overrides:
toBinaryValue in class Value

appendTo

public void appendTo(StringValue bb)
Append to a string builder.


toKey

public Value toKey()
Converts to a key.

Overrides:
toKey in class StringValue

toBytes

public byte[] toBytes()
Converts to a byte array, with no consideration of character encoding. Each character becomes one byte, characters with values above 255 are not correctly preserved.

Overrides:
toBytes in class StringValue

get

public Value get(Value key)
Returns the character at an index

Overrides:
get in class StringValue

charValueAt

public Value charValueAt(long index)
Returns the character at an index

Overrides:
charValueAt in class StringValue

length

public int length()
Returns the length of the string.

Specified by:
length in interface java.lang.CharSequence
Overrides:
length in class StringValue

charAt

public char charAt(int index)
Returns the character at a particular location

Specified by:
charAt in interface java.lang.CharSequence
Overrides:
charAt in class StringValue

subSequence

public java.lang.CharSequence subSequence(int start,
                                          int end)
Returns a subsequence

Specified by:
subSequence in interface java.lang.CharSequence
Overrides:
subSequence in class StringValue

toLowerCase

public StringValue toLowerCase()
Convert to lower case.

Overrides:
toLowerCase in class StringValue

toUpperCase

public StringValue toUpperCase()
Convert to lower case.

Overrides:
toUpperCase in class StringValue

createStringBuilder

public StringValue createStringBuilder()
Creates a string builder of the same type.

Specified by:
createStringBuilder in class StringValue

createStringBuilder

public StringValue createStringBuilder(int length)
Creates a string builder of the same type.

Specified by:
createStringBuilder in class StringValue

toStringBuilder

public StringValue toStringBuilder(Env env)
Converts to a string builder

Overrides:
toStringBuilder in class StringValue

appendUnicode

public final StringValue appendUnicode(char[] buf,
                                       int offset,
                                       int length)
Append a Java buffer to the value.

Overrides:
appendUnicode in class StringValue

append

public StringValue append(java.lang.String s)
Append a Java string to the value.

Overrides:
append in class StringValue

append

public StringValue append(java.lang.CharSequence buf,
                          int head,
                          int tail)
Append a Java buffer to the value.

Overrides:
append in class StringValue

append

public final StringValue append(char[] buf,
                                int offset,
                                int length)
Append a Java buffer to the value.

Overrides:
append in class StringValue

append

public final StringValue append(byte[] buf,
                                int offset,
                                int length)
Append a buffer to the value.

Overrides:
append in class StringValue

append

public final StringValue append(byte[] buf)
Append a double to the value.

Overrides:
append in class StringValue

append

public final StringValue append(char v)
Append a Java byte to the value without conversions.

Overrides:
append in class StringValue

append

public final StringValue append(byte v)
Append a Java byte to the value without conversions.


append

public final StringValue append(boolean v)
Append a Java boolean to the value.

Overrides:
append in class StringValue

append

public StringValue append(long v)
Append a Java long to the value.

Overrides:
append in class StringValue

append

public StringValue append(double v)
Append a Java double to the value.

Overrides:
append in class StringValue

append

public final StringValue append(Value v)
Append a Java value to the value.

Overrides:
append in class StringValue

appendRead

public int appendRead(java.io.InputStream is,
                      long length)
Append from an input stream, using InputStream.read semantics, i.e. just call is.read once even if more data is available.

Overrides:
appendRead in class StringValue

appendReadAll

public 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.

Overrides:
appendReadAll in class StringValue

appendTo

public StringValue appendTo(UnicodeBuilderValue sb)
Append to a string builder.

Overrides:
appendTo in class StringValue

print

public void print(Env env)
Prints the value.

Overrides:
print in class Value
Parameters:
env -

print

public void print(Env env,
                  WriteStream out)
Prints the value.

Overrides:
print in class Value
Parameters:
env -

serialize

public void serialize(Env env,
                      java.lang.StringBuilder sb)
Serializes the value.

Overrides:
serialize in class StringValue

getOutputStream

public java.io.OutputStream getOutputStream()
Returns an OutputStream.


hashCode

public int hashCode()
Returns the hash code.

Overrides:
hashCode in class StringValue

toDebugString

public java.lang.String toDebugString()
Specified by:
toDebugString in class StringValue

varDumpImpl

public void varDumpImpl(Env env,
                        WriteStream out,
                        int depth,
                        java.util.IdentityHashMap<Value,java.lang.String> valueSet)
                 throws java.io.IOException
Specified by:
varDumpImpl in class StringValue
Throws:
java.io.IOException