RTI Connext Java API Version 7.3.0
|
A superclass for all type-safe enumerated types. More...
Public Member Functions | |
final int | ordinal () |
The integral value of this enumerated constant. More... | |
Object | copy_from (Object src) |
final String | name () |
The name of this enum constant, as declared in the enum declaration. More... | |
final String | toString () |
The string value of this enum constant. More... | |
Object | copy_from (Object src) |
Copy value of a data type from source. More... | |
Protected Member Functions | |
Enum (String name, int ordinal) | |
The constructor. More... | |
final Object | clone () throws CloneNotSupportedException |
A superclass for all type-safe enumerated types.
This class is not part of the DDS specification per se. It has been introduced to facilitate the implementation of the numerous enumerated types in the specification and is based on the Java enumeration JSR. See http://www.jcp.org/aboutJava/communityprocess/jsr/tiger/enum.html.
|
protected |
The constructor.
ordinal | The value of the ordinal field of the new enumerated constant. |
name | The value of the name field of the new enumerated constant. |
References Enum.name(), and Enum.ordinal().
final int ordinal | ( | ) |
The integral value of this enumerated constant.
For example, in an IDL definition like this:
...the value of Foo.BAR.ordinal()
will be 2. If the assignment ("<code>= 2</code>") is omitted, the ordinal value will be 0.
Referenced by TypeCodeFactory.create_enum_tc(), Enum.Enum(), DynamicData.from_string(), Logger.get_print_format_by_log_level(), Logger.get_verbosity_by_category(), Logger.set_print_format(), Logger.set_print_format_by_log_level(), Logger.set_verbosity(), Logger.set_verbosity_by_category(), and DynamicData.to_string().
Object copy_from | ( | Object | src | ) |
This is the implementation of the Copyable
interface. While this implementation is not strictly a copy it can have the same effect. In order to use it properly, assign the result of the operation to the member that is the target of the copy. So, for example: myEnumField = myEnumField.copy_from(anotherInstanceOfEnum); Since Enum
s are immutable there cannot be a true copy made but this method will return a reference to the same enumerate as anotherInstanceOfEnum
.
src
Implements Copyable.
final String name | ( | ) |
The name of this enum constant, as declared in the enum declaration.
Most programmers should use the com.rti.dds.util.Enum.toString method rather than accessing this field.
Referenced by Enum.Enum().
final String toString | ( | ) |
The string value of this enum constant.
|
protected |
This method resolves the serialized data to an instance of this class. It is required functionality for all concrete subclasses but we've decided to keep it commented out for now as it will force customers to regenerate their Java code (if their IDL contains enumerations). We (RTI) should uncomment this method to check that all subclasses have implemented this method so we can avoid CORE-3759 and CORE-5292 from happening again.
ObjectStreamException |