|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.text.Format
com.davisor.data.Type
com.davisor.data.LocaleType
com.davisor.data.FormatType
com.davisor.data.TupleType
com.davisor.data.TuplePatternType
TuplePatternType defines an advanced tuple member re-arrangement tool that can reorganize tuple data objects with unknown content to tuple data objects with well-known content. Mapping supports members that match the given single target types, and member groups that match the given target type patterns.
create(int[]),
getTypeIndexMap(com.davisor.data.TupleType),
TupleData,
Serialized Form| Nested Class Summary |
| Nested classes inherited from class java.text.Format |
java.text.Format.Field |
| Field Summary |
| Fields inherited from class com.davisor.data.TupleType |
M_additionalValues, M_keys, TYPENAME |
| Fields inherited from class com.davisor.data.FormatType |
M_pattern, M_sample |
| Fields inherited from class com.davisor.data.LocaleType |
DEFAULT_LOCALE, M_locale |
| Fields inherited from class com.davisor.data.Type |
METADATA_GROUP, METADATA_NAME, METADATA_PARENT, METADATA_SUBCHANNELS |
| Constructor Summary | |
|
TuplePatternType(java.lang.String dataName,
java.lang.String id,
int size,
int patterns)
Creates a new tuple data type of the given number of subtypes. |
protected |
TuplePatternType(java.lang.String typeName,
java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.util.Locale locale,
java.lang.String pattern,
java.lang.Object sample,
Type[] types,
java.util.Map ids,
Type[] patterns)
Creates a new tuple type. |
|
TuplePatternType(TuplePatternType tpt)
Deep copy constructor. |
| Method Summary | |
TupleType |
create(int[] map)
Creates a new tuple type that can re-arrange tuple data objects as described by this tuple pattern and given index map. |
com.davisor.core.Dupable |
dup()
Makes a deep copy of this object. |
java.lang.String |
getFormat()
Gets the pattern tuple customization string. |
Type |
getPatternType(int index)
Gets the tuple member pattern type by index. |
int[] |
getTypeIndexMap(TupleType type)
Creates a two part index map that maps the elements of the given tuple type to the elements of this type. |
void |
setPattern(int index,
Type type)
Sets the tuple pattern member type. |
| Methods inherited from class com.davisor.data.TupleType |
containsKey, createFormatter, equals, getAdditionalValues, getId, getID, getIndex, getMaxDepth, getSize, getSQLCode, getType, getType, getTypeIndex, getTypeIndex, getTypeIndex, getTypeIndex, getTypeIndexes, getTypeIndexes, getValueClass, hashCode, isNumber, keySet, rearrange, setAdditionalValues, setFormat, setType, toData, toData, toData, toData, toString, zero |
| Methods inherited from class com.davisor.data.FormatType |
clearFormatter, getFormatter, getPattern, getSample, setFormat, setLocale, setPattern, setSample |
| Methods inherited from class com.davisor.data.LocaleType |
getLocale, setLocale |
| Methods inherited from class com.davisor.data.Type |
ceil, check, check, compare, create, create, create, create, create, dup, floor, format, getCompatibility, getDataName, getId, getID, getMetaData, getMetaData, getSpecs, getSQLName, getSQLName, getTypeName, isNull, parseObject, register, register, setDataName, setId, setID, setMetaData, setMetaData, setSpecs, toXML, xmlEnd, xmlStart |
| Methods inherited from class java.text.Format |
clone, format, formatToCharacterIterator, parseObject |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public TuplePatternType(TuplePatternType tpt)
public TuplePatternType(java.lang.String dataName,
java.lang.String id,
int size,
int patterns)
dataName - data nameid - type identityType.setFormat(java.lang.String)
protected TuplePatternType(java.lang.String typeName,
java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.util.Locale locale,
java.lang.String pattern,
java.lang.Object sample,
Type[] types,
java.util.Map ids,
Type[] patterns)
typeName - type namedataName - data nameid - type identitymetaData - type meta data map (may be null)locale - type locale (may be null)pattern - format pattern (may be null)sample - format sample (may be null)types - member typesids - member identitiespatterns - type patterns| Method Detail |
public com.davisor.core.Dupable dup()
dup in interface com.davisor.core.Dupabledup in class TupleTypepublic TupleType create(int[] map)
getTypeIndexMap
method. The map has two parts: the first tells how certain tuple
data object members are to be re-arranged so that their order will
match the members of this type. The second part of the map tells
how the tuple data object members are to be re-arranged so that they
match the type patterns described by this object.
The method will return a new ordinary tuple type that represents the
combined result of element and pattern mapping. Furthermore, the
mapping table is modified so that it can be directly used with
the new type and it's rearrange method.
getTypeIndexMap(com.davisor.data.TupleType),
TupleType.rearrange(TupleData,int [])public Type getPatternType(int index)
java.lang.ArrayIndexOutOfBoundsException - if the given index does not
match any member.TupleType.getType(java.lang.String),
TupleType.setType(int, com.davisor.data.Type)public int[] getTypeIndexMap(TupleType type)
map[n] tells which element in another tuple
would match element n in this tuple. A negative value
indicates that there was no match.
After the first N map elements, another map follows that tells with which pattern types that the elements in the given type would match. Unlike normal elements, several elements may match the to given pattern type. The resulting map can be used to construct a replacing type that actually has all the members that the given tuple members would match.
Mapping is based on type names only, not type equality or general compatibility. Operations that assign elements in this tuple to the elements of the target tuple are expected to arrange suitable type conversions.
The primary use for the returned map is to create a new tuple type object
that can re-arrange tuple data objects of the given type to tuple data
objects described by this type. Please see the create
method for more information.
getTypeIndexMap in class TupleTypecreate(int[]),
TupleType.getTypeIndex(java.lang.String),
TupleType.rearrange(com.davisor.data.TupleData, int[])
public void setPattern(int index,
Type type)
index - the index of the new pattern member typetype - the new pattern type (may be null)TupleType.setType(int, com.davisor.data.Type)public java.lang.String getFormat()
getFormat in class TupleTypeTupleType.getFormat()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||