Record Class SpatialTemporalMapping<S,E,ST>

java.lang.Object
java.lang.Record
rgu.transport.algorithms.search.SpatialTemporalMapping<S,E,ST>
Type Parameters:
S - the spatial representation
E - the edge representation
ST - the spatial-temporal representation
Record Components:
toSpatial - converts to spatial representation, not null
toSpatialTemporal - converts to spatial-temporal representation, not null

public record SpatialTemporalMapping<S,E,ST>(Function<ST,S> toSpatial, BiFunction<S,E,ST> toSpatialTemporal) extends Record
A mapping between spatial and spatial-temporal representation.
Author:
Lee A. Christie
  • Constructor Details

    • SpatialTemporalMapping

      public SpatialTemporalMapping(Function<ST,S> toSpatial, BiFunction<S,E,ST> toSpatialTemporal)
      Canonical constructor with null-checks.
      Parameters:
      toSpatial - converts to spatial representation, not null
      toSpatialTemporal - converts to spatial-temporal representation, not null
  • Method Details

    • identity

      public static <V,E> SpatialTemporalMapping<V,E,V> identity()
      Identity function for when the temporal information is not needed.
      Type Parameters:
      V - the vertex representation
      E - the edge representation
      Returns:
      an identity mapping
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • toSpatial

      public Function<ST,S> toSpatial()
      Returns the value of the toSpatial record component.
      Returns:
      the value of the toSpatial record component
    • toSpatialTemporal

      public BiFunction<S,E,ST> toSpatialTemporal()
      Returns the value of the toSpatialTemporal record component.
      Returns:
      the value of the toSpatialTemporal record component