public final class TStringType extends TType
ARRAY_TYPE, BINARY_TYPE, BOOLEAN_TYPE, DATE_TYPE, NULL_TYPE, NUMERIC_TYPE, QUERY_PLAN_TYPE, STRING_TYPE
Constructor and Description |
---|
TStringType(int sql_type,
int max_size,
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,
String locale_str)
Constructor without strength and decomposition that sets to default
levels.
|
TStringType(int sql_type,
int max_size,
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.
|
Modifier and Type | Method and Description |
---|---|
int |
calculateApproximateMemoryUse(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(Object ob1,
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.
|
Locale |
getLocale()
Returns the locale of the string.
|
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.
|
Class |
javaClass()
Returns the Java Class that is used to represent this type of object.
|
asEncodedString, asEncodedString, asSQLString, binaryType, booleanType, castObjectToTType, dateType, decodeString, decodeTypes, fromClass, getSQLType, getWidestType, javaObjectType, numericType, stringType
public TStringType(int sql_type, int max_size, 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, 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, String locale_str)
public int getMaximumSize()
public int getStrength()
public int getDecomposition()
public Locale getLocale()
public 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(Object ob1, Object ob2)
TType
compareObs
in class TType
public int calculateApproximateMemoryUse(Object ob)
TType
calculateApproximateMemoryUse
in class TType
Copyright © 2015. All rights reserved.