public class rowid extends BaseDataType
BaseDataType.Type, BaseDataType.WrapperHandler| Modifier and Type | Field and Description |
|---|---|
private static java.util.regex.Pattern |
RowIdPattern
Rowid valid string representation regex pattern.
|
private java.lang.Long |
value
Stores the integral row identifier, unique within a database
|
| Constructor and Description |
|---|
rowid()
Default constructor, creates an instance that represents the unknown
value.
|
rowid(BaseDataType value)
This is a special c'tor which should be used only when converting the
value returned by a function or method with polymorphic return type into the
expected type (i.e.
|
rowid(character val)
Constructs an instance given a character encoding (hex string in the
format 0xhhhhhhhhhhhhhhhh, where each h is an lower-case, hexadecimal
digit, limited to maximum 16 digits because that actual internal
implementation uses a java 64-bit Long).
|
rowid(java.lang.Long value)
Constructs an instance given a 64-bit integer value.
|
rowid(rowid value)
Constructs an instance based upon an existing instance.
|
rowid(java.lang.String val)
Constructs an instance given a character encoding (hex string in the
format 0xhhhhhhhhhhhhhhhh, where each h is an lower-case, hexadecimal
digit, limited to maximum 16 digits because that actual internal
implementation uses a java 64-bit Long).
|
| Modifier and Type | Method and Description |
|---|---|
void |
assign(BaseDataType value)
Sets the data of this instance based on the given instance.
|
void |
assign(rowid value)
Sets the data of this instance based on the given instance.
|
void |
assign(Text value)
Sets the data of this instance based on the given instance.
|
void |
assign(Undoable value)
Sets the state (data and unknown value) of this instance based on the
state of the passed instance.
|
int |
compareTo(java.lang.Object obj)
Compares this instance with the specified instance and returns a -1
if this instance is less than the specified, 0 if the two instances
are equal and 1 if this instance is greater than the specified
instance.
|
java.lang.String |
defaultFormatString()
Return the default display format string for this type.
|
rowid |
duplicate()
Does the same as standard
clone() method but returns an
instance of BaseDataType and doesn't throw the
CloneNotSupportedException. |
boolean |
equals(java.lang.Object o)
An equality test which handles the most common cases with the least
amount of overhead.
|
int |
formatLength(java.lang.String fmt)
Calculate the length of a formatted value (the text form of the value)
using this format string.
|
int |
getSize()
Obtain the length (in bytes) of this BDT will use when serialized.
|
BaseDataType.Type |
getType()
Get the type
|
java.lang.Long |
getValue()
Returns the value of this instance as an
Long. |
int |
hashCode()
Hash code implementation which is consistent with
BaseDataType.equals(java.lang.Object). |
BaseDataType |
instantiateDefault()
Creates a new instance of the same type that represents the default initialized value.
|
BaseDataType |
instantiateUnknown()
Creates a new instance of the same type that represents the
unknown value. |
protected boolean |
isIncompatibleTypesOnConversion(BaseDataType value)
Returns true if dynamic data type conversion should not be attempted,
it can also throws in case of incompatible types for a POLY conversion.
|
boolean |
isUnknown()
Determines if this instance represents the
unknown value. |
static java.lang.Long |
parseRowidString(java.lang.String value)
Worker method that parses and validates a
java.lang.String
according to rowid Progress data type constraints:
must start with "0x" prefix
must only contain lower-case hexadecimal digits
the number of digits must be more than 2 and even
the parsed value must fit into a 64-bit unsigned integer (this is the FWD limitation,
Progress accepts any number of digits.)
|
void |
readExternal(java.io.ObjectInput in)
Replacement for the default object reading method.
|
void |
setUnknown()
Sets this instance to represent the unknown value.
|
java.lang.String |
toString()
Creates a string representation of the instance data as a hex string
with a leading "0x" prefix.
|
java.lang.String |
toString(java.lang.String fmt)
Creates a string representation of the instance data as a hex string
with a leading "0x" prefix.
|
java.lang.String |
toStringExport()
Creates a string representation of the instance data using the 'export'
format.
|
java.lang.String |
toStringMessage()
Creates a string representation of the instance data in a form that is
compatible with the
MESSAGE language statement. |
void |
writeExternal(java.io.ObjectOutput out)
Replacement for the default object writing method.
|
assign, assign, calcFormatLength, createProxy, createProxy, deepCopy, elementsOfType, fallback, fromTypeName, generateDefault, generateUnknown, getAssigner, getTypeName, incompatibleTypesOnConversion, initialize, initializeDefaultExtent, instantiateDefaultExtent, invalidInitializer, isAllKnown, isAllKnown, isAssignDirect, isProxy, isUnknownValue, maximum, minimum, notUnknownValue, sameType, val, variablechanged, checkUndoable, checkUndoable, checkUndoable, getTransLevel, isGlobal, isUndoable, markUndoable, popBlock, rollback, setGlobalprivate java.lang.Long value
private static final java.util.regex.Pattern RowIdPattern
public rowid()
public rowid(BaseDataType value)
assign(BaseDataType)).value - The value to be used for this instance.public rowid(rowid value)
value - The instance to copy.public rowid(java.lang.Long value)
value - 64-bit integer value; should be unique across all records in a
database. May be null to indicate unknown value.public rowid(character val)
val - A hex string in the format 0xhhhhhhhhhhhhhhhh.
Any other string will, including null will
indicate the unknown value.public rowid(java.lang.String val)
val - A hex string in the format 0xhhhhhhhhhhhhhhhh.
Any other string will, including null will
indicate the unknown value.public static java.lang.Long parseRowidString(java.lang.String value)
java.lang.String
according to rowid Progress data type constraints:
value - A hex string matching the conditions above.
Any other string, including null, will
indicate the unknown value.Long representing the internal value for a
rowid or null if parsing fails.public BaseDataType instantiateUnknown()
unknown value.instantiateUnknown in class BaseDataTypeunknown value.public BaseDataType instantiateDefault()
instantiateDefault in class BaseDataTypepublic rowid duplicate()
clone() method but returns an
instance of BaseDataType and doesn't throw the
CloneNotSupportedException.duplicate in class BaseDataTypepublic BaseDataType.Type getType()
getType in class BaseDataTypepublic boolean equals(java.lang.Object o)
This implementation is consistent with hashCode().
equals in class BaseDataTypeo - The instance to compare against.true if the objects compare equivalently; false if they do not,
or if the parameter is not a BaseDataType instance.BaseDataType.equals(java.lang.Object)public int hashCode()
BaseDataType.equals(java.lang.Object).hashCode in class BaseDataTypepublic java.lang.Long getValue()
Long.
If this instance represents the unknown value, a
null will be returned.
Long or null if
this is unknown.public boolean isUnknown()
unknown value.isUnknown in class BaseDataTypetrue if this instance is set to the
unknown value.public void setUnknown()
Any existing value is discarded.
setUnknown in class BaseDataTypepublic void assign(BaseDataType value)
If the value is not of type rowid, the following automatic type
conversion will occur:
This type support only rowid and unknown types (including unknown literal).
This variant is meant to handle the cases of built-in functions and methods in the 4GL which have polymorphic return types (e.g. DYNAMIC-FUNCTION()). This should NOT be used for non-polymorphic assignments.
assign in class BaseDataTypevalue - The instance from which to copy state.java.lang.ClassCastException - if value is not an instance of this class.public void assign(rowid value)
value - The instance from which to copy state.public void assign(Text value)
value - The instance from which to copy state.public void assign(Undoable value)
value - The instance from which to copy state.public int compareTo(java.lang.Object obj)
Comparable
interface.
The rowids' internal, 64-bit integer values are compared.
obj - The instance to compare against.unknown.public java.lang.String toString()
If the instance represents the unknown value, a '?' will be
returned.
toString in class java.lang.Objectpublic java.lang.String toString(java.lang.String fmt)
If the instance represents the unknown value, a '?' will be
returned.
toString in class BaseDataTypefmt - The Progress 4GL format string or null if the
default format is to be used. This parameter is not validated and
is ignored.public java.lang.String toStringMessage()
MESSAGE language statement. If the
instance represents the unknown value, a '?' will be
returned.toStringMessage in class BaseDataTypepublic java.lang.String toStringExport()
unknown value, a
'?' will be returned.toStringExport in class BaseDataTypepublic java.lang.String defaultFormatString()
null, because there is no formatted
representation of a rowid: it must be converted to a string first using
the Progress STRING() function.defaultFormatString in class BaseDataTypenull.public int formatLength(java.lang.String fmt)
formatLength in class BaseDataTypefmt - The format string.public int getSize()
getSize in class BaseDataTypepublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
in - The input source from which fields will be restored.java.io.IOException - in case of I/O errors.java.lang.ClassNotFoundException - if payload can't be instantiated.java.io.NotSerializableException - always.public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
out - The output destination to which fields will be saved.java.io.IOException - in case of I/O errors.java.io.NotSerializableException - always.protected boolean isIncompatibleTypesOnConversion(BaseDataType value)
BaseDataTypeisIncompatibleTypesOnConversion in class BaseDataType