Class MapWithTypeCache

All Implemented Interfaces:
Callable, FunctionItem, GroundedValue, Item, Sequence
Direct Known Subclasses:
AbstractFixedMap, DeltaMap, ExtensibleMap

public abstract class MapWithTypeCache extends MapItem
  • Field Details

  • Constructor Details

    • MapWithTypeCache

      public MapWithTypeCache()
  • Method Details

    • setKnownType

      protected void setKnownType(PlainType keyType, SequenceType valueType)
    • conforms

      public boolean conforms(PlainType keyType, SequenceType valueType)
      Ask whether the map conforms to a given map type. This implementation caches the given type to avoid a complete scan of the map entries in cases where the type has already been established; this also involves passing on available type information when new maps are created using put() and remove() (which is done in subclasses).
      Overrides:
      conforms in class MapItem
      Parameters:
      keyType - the required keyType
      valueType - the required valueType
      Returns:
      true if the map conforms to the required type