public interface Mapping
List
) in that the set
of keys (domain values) is not necessarily stored with or even known to a
Mapping. Enumeration of or iteration through the domain values is thus not in
general possible.
This is a base interface for specific mappings. For efficiency, the derived
mappings should define their own methods to actually perform the associated
mapping function. These methods can thus be specialized, for example, to return
the desired return type (rather than an Object). Also, derived Mappings
may choose, again for efficiency reasons, to forego any error-checking
in the methods that implement their mapping functions (i.e, they may
assume that the arguments are in the corresponding domains). In such cases,
the inDomain(Object)
method can be used when it is desired
to make sure that that a candidate argument is in the domain.
Modifier and Type | Method and Description |
---|---|
boolean |
inDomain(java.lang.Object object)
Returns true if a given object is in the domain of the mapping.
|
java.lang.Object |
toObject(java.lang.Object object)
Return the object associated with the given object in the mapping.
|
boolean inDomain(java.lang.Object object)
object
- The given object.java.lang.Object toObject(java.lang.Object object)
object
- The given object.