public class CodedEnumAdapter extends AbstractLegacyAdapter<CodedEnum,CodedEnum>
CodedEnum and
CodedEnum
Delegation is maintained by two WeakHashTables. See AbstractLegacyAdapter
Functionally, the delegation is handled in the nested classes - one for wrapping from ome.scifio.common.enumeration.CodedEnum to loci.common.enumeration.CodedEnum, and one for the reverse direction.
| Modifier and Type | Class and Description |
|---|---|
static class |
CodedEnumAdapter.LegacyWrapper
This class can be used to wrap loci.common.enumeration.CodedEnum
objects and be passed to API expecting an ome.scifio.enumeration.CodedEnum
object.
|
static class |
CodedEnumAdapter.ModernWrapper
This class can be used to wrap ome.scifio.enumeration.CodedEnum
objects and be passed to API expecting a loci.common.enumeration.CodedEnum
object.
|
| Constructor and Description |
|---|
CodedEnumAdapter() |
| Modifier and Type | Method and Description |
|---|---|
protected CodedEnum |
wrapToLegacy(CodedEnum modern)
Used Wraps the given modern object to a new instance of its legacy equivalent.
|
protected CodedEnum |
wrapToModern(CodedEnum legacy)
Wraps the given legacy object to a new instance of its modern equivalent.
|
clear, getLegacy, getModernprotected CodedEnum wrapToLegacy(CodedEnum modern)
AbstractLegacyAdapterThis is a "stupid" operation that always wraps to a new instance.
This method must be defined at the concrete implementation level as it requires knowledge of a specific class that extends L but is capable of wrapping M. Doing so reduces code/logic repetition by maintaining a single getLegacy implementation.
wrapToLegacy in class AbstractLegacyAdapter<CodedEnum,CodedEnum>modern - - An instance of the modern class.protected CodedEnum wrapToModern(CodedEnum legacy)
AbstractLegacyAdapterThis is a "stupid" operation that always wraps to a new instance.
This method must be defined at the concrete implementation level as it requires knowledge of a specific class that extends M but is capable of wrapping L. Doing so reduces code/logic repetition by maintaining a single getModern implementation.
wrapToModern in class AbstractLegacyAdapter<CodedEnum,CodedEnum>legacy - - An instance of the legacy class.Copyright © 2014 Open Microscopy Environment