net.sf.farrago.type.runtime
Class EncodedCharPointer

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.ByteArrayInputStream
          extended by net.sf.farrago.type.runtime.BytePointer
              extended by net.sf.farrago.type.runtime.EncodedCharPointer
All Implemented Interfaces:
Closeable, CharSequence, AssignableValue, DataValue
Direct Known Subclasses:
Ucs2CharPointer

public abstract class EncodedCharPointer
extends BytePointer

EncodedCharPointer specializes BytePointer to interpret its bytes as characters encoded via a given charset.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/type/runtime/EncodedCharPointer.java#14 $
Author:
John V. Sichi

Field Summary
 
Fields inherited from class net.sf.farrago.type.runtime.BytePointer
CONCAT_METHOD_NAME, emptyBytes, ENFORCE_PRECISION_METHOD_NAME, GET_BYTE_COUNT_METHOD_NAME, INITCAP_METHOD_NAME, L1, LOWER_METHOD_NAME, OVERLAY_METHOD_NAME, ownBytes, POSITION_METHOD_NAME, S1, SET_POINTER_METHOD_NAME, SUBSTRING_METHOD_NAME, TRIM_METHOD_NAME, UPPER_METHOD_NAME
 
Fields inherited from class java.io.ByteArrayInputStream
buf, count, mark, pos
 
Fields inherited from interface net.sf.farrago.type.runtime.AssignableValue
ASSIGNMENT_METHOD_NAME
 
Constructor Summary
EncodedCharPointer()
           
 
Method Summary
protected  byte[] getBytesForString(String string)
          Gets the byte representation of a string.
protected abstract  String getCharsetName()
           
 Object getNullableData()
           
 String toString()
           
 
Methods inherited from class net.sf.farrago.type.runtime.BytePointer
allocateOwnBytes, allocateOwnBytesForPrecision, assignFrom, attemptFastAsciiByteToLong, calcSubstringPointers, cast, cast, cast, cast, cast, charAt, compareBytes, concat, copyFrom, enforceBytePrecision, finishOverlay, getByteCount, getByteCountForPrecision, initcap, isNull, length, lower, overlay, position, positionImpl, setCharAt, setNull, setPointer, subSequence, substring, trim, upper, writeToBuffer, writeToBufferAbsolute
 
Methods inherited from class java.io.ByteArrayInputStream
available, close, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.io.InputStream
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EncodedCharPointer

public EncodedCharPointer()
Method Detail

toString

public String toString()
Specified by:
toString in interface CharSequence
Overrides:
toString in class BytePointer

getCharsetName

protected abstract String getCharsetName()
Overrides:
getCharsetName in class BytePointer
Returns:
the charset used for this pointer's encoding, or BINARY if no character data is encoded

getBytesForString

protected byte[] getBytesForString(String string)
Description copied from class: BytePointer
Gets the byte representation of a string. Subclasses may override.

Overrides:
getBytesForString in class BytePointer
Parameters:
string - source
Returns:
byte representation

getNullableData

public Object getNullableData()
Specified by:
getNullableData in interface DataValue
Overrides:
getNullableData in class BytePointer
Returns:
an Object representation of this value's data, or null if this value is null