T
- the type of all objects to map to Subdivision
facespublic interface SubdivisionMap<T>
Subdivision
to arbitrary objects.
Provides an application-specific mapping of all Subdivision.faces()
of a planar
Subdivision
to arbitrary objects. The use of an interface allows clients to
implement the most efficient mapping for their concrete Subdivision
structure
and object type.
Since the Subdivision
has no knowledge of any SubdivisionMap
instances
that reference it, clients must manually update any such instances whenever the underlying
Subdivision
changes.
Modifier and Type | Method and Description |
---|---|
T |
fromFace(SubdivisionFace face)
Converts the specified
SubdivisionFace into the associated T instance. |
Subdivision |
source()
Gets the
Subdivision that contains all mapped Subdivision.faces() . |
java.lang.Object |
target()
Gets the
Object that defines all mapped T instances. |
SubdivisionFace |
toFace(T value)
Converts the specified T instance into the associated
SubdivisionFace . |
Subdivision source()
Subdivision
that contains all mapped Subdivision.faces()
.
Never null
. Multiple SubdivisionMap
implementations may refer to the
same source()
, mapping its Subdivision.faces()
to different objects.Subdivision
that contains all Subdivision.faces()
accepted
and returned by fromFace(org.kynosarges.tektosyne.subdivision.SubdivisionFace)
and toFace(T)
, respectivelyjava.lang.Object target()
Object
that defines all mapped T instances.
May be null
if providing a container for all associated T instances
is impossible or inconvenient.Object
that defines all T instances returned and accepted
by fromFace(org.kynosarges.tektosyne.subdivision.SubdivisionFace)
and toFace(T)
, respectivelyT fromFace(SubdivisionFace face)
SubdivisionFace
into the associated T instance.face
- the SubdivisionFace
to convertface
java.lang.IllegalArgumentException
- if source()
does not contain face
java.lang.NullPointerException
- if face
is null
SubdivisionFace toFace(T value)
SubdivisionFace
.value
- the T instance to convertSubdivisionFace
associated with value
java.lang.IllegalArgumentException
- if value
does not map to any
SubdivisionFace
within source()