Interface Mapping<D,R>

Type Parameters:
D - domain type.
R - range type.
All Superinterfaces:
Function<D,R>
All Known Subinterfaces:
MutableMapping<D,R>
All Known Implementing Classes:
ArrayMapping, MapMapping, NodeIDGrowingMapping, NodeIDStaticMapping, StateIDGrowingMapping, StateIDStaticMapping
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Mapping<D,R> extends Function<D,R>
An interface for mapping objects of a certain domain type to objects of a certain range type.

A mapping is very much like a Map, but the perspective is a different one: Whereas a map is a (particularly finite) key/value collection, a mapping is more like a function: it does not support retrieval of all keys or values, because it does not require them to be stored at all. Instead, they can be calculated on the fly upon an invocation of get(Object).

  • Method Summary

    Modifier and Type
    Method
    Description
    default R
    apply(D elem)
     
    get(D elem)
    Get the range object elem maps to.

    Methods inherited from interface java.util.function.Function

    andThen, compose
  • Method Details

    • apply

      default R apply(D elem)
      Specified by:
      apply in interface Function<D,R>
    • get

      R get(D elem)
      Get the range object elem maps to. Implementations may decide how to deal with unmapped values (default values, exceptions, etc.)
      Parameters:
      elem - object from the domain.
      Returns:
      the object from the range corresponding to elem.