RTI Connext Java API  Version 6.1.1

A superclass for all type-safe enumerated types. More...

Inheritance diagram for Enum:
Copyable CdrPaddingKind DataReaderInstanceRemovalKind DataWriterResourceLimitsInstanceReplacementKind DestinationOrderQosPolicyKind DestinationOrderQosPolicyScopeKind DiscoveryPluginPromiscuityKind DomainParticipantResourceLimitsIgnoredEntityReplacementKind DurabilityQosPolicyKind HistoryQosPolicyKind LivelinessQosPolicyKind OwnershipQosPolicyKind PresentationQosPolicyAccessScopeKind PublishModeQosPolicyKind QosPolicyId_t ReliabilityQosPolicyAcknowledgmentModeKind ReliabilityQosPolicyKind RemoteParticipantPurgeKind ServiceQosPolicyKind ThreadSettingsCpuRotationKind TransportMulticastQosPolicyKind TypeConsistencyKind WireProtocolQosPolicyAutoKind FlowControllerSchedulingPolicy SampleLostStatusKind SampleRejectedStatusKind TopicQuerySelectionKind PrintFormatKind ExtensibilityKind TCKind LogCategory LogLevel LogPrintFormat LogVerbosity HeapMonitoringSnapshotContentFormat HeapMonitoringSnapshotOutputFormat

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...
 

Protected Member Functions

 Enum (String name, int ordinal)
 The constructor. More...
 
final Object clone () throws CloneNotSupportedException
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Enum()

Enum ( String  name,
int  ordinal 
)
protected

The constructor.

Parameters
ordinalThe value of the ordinal field of the new enumerated constant.
nameThe value of the name field of the new enumerated constant.
See also
com.rti.dds.util.Enum.ordinal
com.rti.dds.util.Enum.name

References Enum.name(), and Enum.ordinal().

Referenced by Enum.toString().

Member Function Documentation

◆ ordinal()

◆ copy_from()

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 Enums are immutable there cannot be a true copy made but this method will return a reference to the same enumerate as anotherInstanceOfEnum.

Returns
returns src
See also
com.rti.dds.infrastructure.Copyable::copy_from(java.lang.Object)

Implements Copyable.

◆ name()

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(), and Enum.toString().

◆ toString()

final String toString ( )

The string value of this enum constant.

See also
com.rti.dds.util.Enum.name
Returns
the name of this enum constant

References Enum.Enum(), Enum.name(), and Enum.ordinal().

Referenced by TypeCode.print_complete_IDL().

◆ clone()

final Object clone ( ) throws CloneNotSupportedException
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.

Returns
One of the existing instance of the enumeration (to replace the instance created by the Java deserialization process).
Exceptions
ObjectStreamException