|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Mapping
A mapping from some domain of values into some range.
Mappings are different from Maps (see 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.
Red (ssb) |
Red (ssb) |
Method Summary | |
---|---|
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. |
Method Detail |
---|
boolean inDomain(java.lang.Object object)
object
- The given object.
java.lang.Object toObject(java.lang.Object object)
object
- The given object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |