|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.SIRAPRISE.typeimplementations.DbmsAverageImplementation
public final class DbmsAverageImplementation
Type 'Average' is used when computing averages. Its physical encoding is as follows :
Method Summary | |
---|---|
static ValueBuffer |
getAverageValueBuffer(int count,
double value)
Gets A ValueBuffer holding the given value |
static ValueBuffer |
getAverageValueBufferWithoutException(int count,
double value)
Gets A ValueBuffer holding the given value |
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 DbmsAverageImplementation |
getInstance()
Gets instance |
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. |
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 |
Method Detail |
---|
public static ValueBuffer getAverageValueBuffer(int count, double value)
count
- value
-
public static ValueBuffer getAverageValueBufferWithoutException(int count, double value)
count
- value
-
public static final DbmsAverageImplementation getInstance()
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) throws InvalidValueException
PossRepImplementation
valueFromExternalRepresentation
in interface PossRepImplementation
value
- the value in external format.
InvalidValueException
- If the textual representation does not represent a value of the possrep's type.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 |