|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.SIRAPRISE.typeimplementations.DbmsBooleanImplementation
public final class DbmsBooleanImplementation
The implementation for the system-defined Boolean type. The physical encoding of boolean values is a 4-byte integer that holds the value -1 for true, or the integer value 0 for false.
Field Summary | |
---|---|
static int |
_FALSE
The numeric value for false |
static int |
_TRUE
The numeric value for true |
static ScalarValueBuffer |
falseValue
Value representing 'false' |
static ScalarValueBuffer |
trueValue
Value representing 'true' |
Method Summary | |
---|---|
java.util.Map<java.lang.String,java.lang.String> |
getComponentNameMap()
Gets a map of component/type names. |
ValueBuffer |
getComponentValue(java.lang.String componentName,
ScalarValueBuffer valueBuffer)
"Extracts" a possrep component value out of a value of the type |
PossRepImplementation |
getDefaultPossrepImplementation()
Gets the possrep implementation that is to be considered the default for the type. |
int |
getDfltLogicalSize()
Gets the default (logical) size of an attribute of this type. |
static DbmsBooleanImplementation |
getInstance()
Gets instance |
static boolean |
getJavaBoolean(ScalarValueBuffer buffer)
Converts a ValueBuffer holding a boolean into a java boolean |
int |
getMaxLogicalSize()
Gets the maximum logical size of an attribute of this type. |
int |
getMinLogicalSize()
Gets the minimum logical size of an attribute of this type. |
static boolean |
getNegatedJavaBoolean(ScalarValueBuffer buffer)
Converts a ValueBuffer holding a boolean into a java boolean representing the negation of that boolean |
static ScalarValueBuffer |
getNegatedJavaBooleanBuffer(ScalarValueBuffer buffer)
Converts a ValueBuffer holding a boolean into a java boolean |
int |
getPhysicalSizeFor(int logicalSize)
Determines the number of bytes needed to encode a value of the given logical size of this type. |
PossRepImplementation |
getPossrepImplementation(java.lang.String componentName)
Gets the PossrepImplementation object implementing the possrep of which the given component name names a component. |
java.util.Set<PossRepImplementation> |
getPossrepImplementations()
Gets the set of all PossRepImplementations for this type. |
java.lang.String |
getPossrepName()
Gets the possrep name |
ValueBuffer |
valueFromComponentValues(java.util.HashMap<java.lang.String,ValueBuffer> componentValueMap,
int logicalSize)
Returns a ValueBuffer holding the value of the type that this PossRepImplementation is for, and that corresponds to the component values given in the componentValueMap argument. |
ValueBuffer |
valueFromExternalRepresentation(java.lang.String value)
Convert a value of this possrep's type to internal format. |
ValueBuffer |
valueFromExternalRepresentation(java.lang.String value,
int maximumLogicalLengthAllowed)
Converts a value of this type from external to internal format, given a specified maximum allowable logical size for the value to be returned. |
java.lang.String |
valueToEscapedExternalRepresentation(ValueBuffer valueBuffer)
Converts a value in internal format to the appropriate textual representation of that value for this possrep. |
java.lang.String |
valueToExternalRepresentation(ValueBuffer valueBuffer)
Converts a value in internal format to the appropriate textual representation of that value for this possrep. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int _FALSE
public static final int _TRUE
public static final ScalarValueBuffer falseValue
public static final ScalarValueBuffer trueValue
Method Detail |
---|
public static DbmsBooleanImplementation getInstance()
public static boolean getJavaBoolean(ScalarValueBuffer buffer)
buffer
- The ValueBuffer holding a boolean value
public static boolean getNegatedJavaBoolean(ScalarValueBuffer buffer)
buffer
- The ValueBuffer holding a boolean value
public static ScalarValueBuffer getNegatedJavaBooleanBuffer(ScalarValueBuffer buffer)
buffer
- The ValueBuffer holding a boolean value
public java.util.Map<java.lang.String,java.lang.String> getComponentNameMap()
PossRepImplementation
getComponentNameMap
in interface PossRepImplementation
public ValueBuffer getComponentValue(java.lang.String componentName, ScalarValueBuffer valueBuffer)
PossRepImplementation
getComponentValue
in interface PossRepImplementation
componentName
- The possrep component NamevalueBuffer
- The scalarValueBuffer holding the value of which the possrep's component's value is to be extracted
public PossRepImplementation getDefaultPossrepImplementation()
TypeImplementation
getDefaultPossrepImplementation
in interface TypeImplementation
public int getDfltLogicalSize()
TypeImplementation
getDfltLogicalSize
in interface TypeImplementation
public int getMaxLogicalSize()
TypeImplementation
getMaxLogicalSize
in interface TypeImplementation
public int getMinLogicalSize()
TypeImplementation
getMinLogicalSize
in interface TypeImplementation
public int getPhysicalSizeFor(int logicalSize)
TypeImplementation
getPhysicalSizeFor
in interface TypeImplementation
logicalSize
- The logical size of a declared attribute of this type
public PossRepImplementation getPossrepImplementation(java.lang.String componentName)
TypeImplementation
getPossrepImplementation
in interface TypeImplementation
componentName
- The name of a component of some possrep of this type (and for which the corresponding PossrepImplementation object is to be returned)
public java.util.Set<PossRepImplementation> getPossrepImplementations()
TypeImplementation
getPossrepImplementations
in interface TypeImplementation
public java.lang.String getPossrepName()
PossRepImplementation
getPossrepName
in interface PossRepImplementation
public ValueBuffer valueFromComponentValues(java.util.HashMap<java.lang.String,ValueBuffer> componentValueMap, int logicalSize)
PossRepImplementation
valueFromComponentValues
in interface PossRepImplementation
componentValueMap
- A Map holding component names and their corresponding values, held in a ValueBuffer.logicalSize
- The maximum logical size that the returned value is allowed to have. This only applies to certain variable-length types. E.g. imagine that type STRING has a possrep with components LENGTH and NONBLANKS, such that the string represented by LENGTH(12)NONBLANKS(A) represents the string "A ". An InvalidValueException should be thrown if these component values are passed to this method, along with a logicalSize of, say, 8.
public ValueBuffer valueFromExternalRepresentation(java.lang.String value)
PossRepImplementation
valueFromExternalRepresentation
in interface PossRepImplementation
value
- the value in external format.
public ValueBuffer valueFromExternalRepresentation(java.lang.String value, int maximumLogicalLengthAllowed) throws InvalidValueException
PossRepImplementation
valueFromExternalRepresentation
in interface PossRepImplementation
value
- the textual representation of the value.maximumLogicalLengthAllowed
- the maximum logical length that the returned value can be allowed to have.
InvalidValueException
- If the textual representation does not represent a value of the possrep's type.public java.lang.String valueToEscapedExternalRepresentation(ValueBuffer valueBuffer)
PossRepImplementation
valueToEscapedExternalRepresentation
in interface PossRepImplementation
valueBuffer
- The value in internal format.
public java.lang.String valueToExternalRepresentation(ValueBuffer valueBuffer)
PossRepImplementation
valueToExternalRepresentation
in interface PossRepImplementation
valueBuffer
- The value in internal format.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |