|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mckoi.database.TType
com.mckoi.database.TStringType
public final class TStringType
An implementation of TType for a String.
Field Summary |
---|
Fields inherited from class com.mckoi.database.TType |
---|
ARRAY_TYPE, BINARY_TYPE, BOOLEAN_TYPE, DATE_TYPE, NULL_TYPE, NUMERIC_TYPE, QUERY_PLAN_TYPE, STRING_TYPE |
Constructor Summary | |
---|---|
TStringType(int sql_type,
int max_size,
java.util.Locale locale,
int strength,
int decomposition)
Constructs a type with the given sql_type value, the maximum size, and the locale of the string. |
|
TStringType(int sql_type,
int max_size,
java.lang.String locale_str)
Constructor without strength and decomposition that sets to default levels. |
|
TStringType(int sql_type,
int max_size,
java.lang.String locale_str,
int strength,
int decomposition)
Constructs a type with the given sql_type value, the maximum size, and the locale of the string. |
Method Summary | |
---|---|
int |
calculateApproximateMemoryUse(java.lang.Object ob)
Calculates the approximate memory usage of an object of this type in bytes. |
boolean |
comparableTypes(TType type)
For strings, the locale must be the same for the types to be comparable. |
int |
compareObs(java.lang.Object ob1,
java.lang.Object ob2)
Compares two objects that are logically comparable under this type. |
int |
getDecomposition()
Returns the decomposition of this string type as defined in java.text.Collator. |
java.util.Locale |
getLocale()
Returns the locale of the string. |
java.lang.String |
getLocaleString()
Returns the locale information as a formatted string. |
int |
getMaximumSize()
Returns the maximum size of the string (-1 is don't care). |
int |
getStrength()
Returns the strength of this string type as defined in java.text.Collator. |
java.lang.Class |
javaClass()
Returns the Java Class that is used to represent this type of object. |
Methods inherited from class com.mckoi.database.TType |
---|
asEncodedString, asEncodedString, asSQLString, binaryType, booleanType, castObjectToTType, dateType, decodeString, decodeTypes, fromClass, getSQLType, getWidestType, javaObjectType, numericType, stringType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TStringType(int sql_type, int max_size, java.util.Locale locale, int strength, int decomposition)
Note that a string type may be constructed with a NULL locale which means strings are compared lexicographically.
public TStringType(int sql_type, int max_size, java.lang.String locale_str, int strength, int decomposition)
Note that a string type may be constructed with a NULL locale which means strings are compared lexicographically. The string locale is formated as [2 char language][2 char country][rest is variant]. For example, US english would be 'enUS', French would be 'fr' and Germany would be 'deDE'.
public TStringType(int sql_type, int max_size, java.lang.String locale_str)
Method Detail |
---|
public int getMaximumSize()
public int getStrength()
public int getDecomposition()
public java.util.Locale getLocale()
public java.lang.String getLocaleString()
Note that a string type may be constructed with a NULL locale which means strings are compared lexicographically. The string locale is formated as [2 char language][2 char country][rest is variant]. For example, US english would be 'enUS', French would be 'fr' and Germany would be 'deDE'.
public boolean comparableTypes(TType type)
comparableTypes
in class TType
public int compareObs(java.lang.Object ob1, java.lang.Object ob2)
TType
compareObs
in class TType
public int calculateApproximateMemoryUse(java.lang.Object ob)
TType
calculateApproximateMemoryUse
in class TType
public java.lang.Class javaClass()
TType
javaClass
in class TType
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |