be.SIRAPRISE.typeimplementations
Interface TypeImplementation

All Known Implementing Classes:
DbmsAngleImplementation, DbmsAverageImplementation, DbmsBarImplementation, DbmsBitsImplementation, DbmsBooleanImplementation, DbmsCharImplementation, DbmsDateImplementation, DbmsDecimalImplementation, DbmsFilenameImplementation, DbmsFloatImplementation, DbmsFooImplementation, DbmsIntImplementation, DbmsLongImplementation, DbmsNameImplementation, DbmsRelationImplementation, DbmsStringImplementation, DbmsTimeofdayImplementation, DbmsTupleImplementation, IntervalTypeImplementation

public interface TypeImplementation

Defines the methods that the implementation class for a sira_prise scalar type must provide.

Author:
Erwin Smout

Method Summary
 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.
 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.
 

Method Detail

getDfltLogicalSize

int getDfltLogicalSize()
Gets the default (logical) size of an attribute of this type. The implementation is responsible for ensuring that the default size is >= the minimum size, and <= the maximum size.

Returns:
the default (logical) size of an attribute of this type.

getMaxLogicalSize

int getMaxLogicalSize()
Gets the maximum logical size of an attribute of this type. If this type has an ordering operator, then the corresponding interval type will have a fixed (i.e. min=max=default) logical size that is equal to twice this maximum size.

Returns:
The maximum logical size of an attribute of this type.

getMinLogicalSize

int getMinLogicalSize()
Gets the minimum logical size of an attribute of this type.

Returns:
The minimum logical size of an attribute of this type

getPossrepImplementations

java.util.Set<PossRepImplementation> getPossrepImplementations()
Gets the set of all PossRepImplementations for this type.

Returns:
The set of all PossRepImplementations for this type.

getPhysicalSizeFor

int getPhysicalSizeFor(int logicalSize)
Determines the number of bytes needed to encode a value of the given logical size of this type. If the type is variable-length, then the number returned here must be >= 4. These four mandatory bytes are used to hold the actual logical length of the encoded value.

Parameters:
logicalSize - The logical size of a declared attribute of this type
Returns:
The total number of bytes needed to encode a value of the given logical size of this type, i.e. including the four length bytes that are used in variable-length types to hold the logical length of the value itself.

getDefaultPossrepImplementation

PossRepImplementation getDefaultPossrepImplementation()
Gets the possrep implementation that is to be considered the default for the type. If the type does not provide any possrep(implementation)s at all, then this method should return null, and this type will be treated as a singleton type.

Returns:
the possrep implementation that is to be considered the default for the type, or null if the type is a singleton.

getPossrepImplementation

PossRepImplementation getPossrepImplementation(java.lang.String componentName)
Gets the PossrepImplementation object implementing the possrep of which the given component name names a component. This method is introduced in version 1.3. The method is optional, but implementers are strongly encouraged to add this method to any implementing class they already have developed.

Parameters:
componentName - The name of a component of some possrep of this type (and for which the corresponding PossrepImplementation object is to be returned)
Returns:
The PossrepImplementation object implementing the possrep of which the given component name names a component