Class VSpaceImpl

java.lang.Object
org.aksw.jenax.constraint.impl.VSpaceImpl
All Implemented Interfaces:
Cloneable, Constrainable, VSpace

public class VSpaceImpl extends Object implements VSpace
An implementation of value space backed by NodeRanges. The parameters of the methods stateIntersection(VSpace) and stateUnion(VSpace) only accept instances of VSpaceImpl. Any other type yields a ClassCastException.
Author:
raven
  • Field Details

  • Constructor Details

    • VSpaceImpl

      protected VSpaceImpl(NodeRanges nodeRanges)
  • Method Details

    • getDomain

      public Domain<?,?> getDomain()
      Specified by:
      getDomain in interface VSpace
    • create

      public static VSpaceImpl create(NodeRanges nodeRanges)
    • getNodeRanges

      public NodeRanges getNodeRanges()
    • clone

      public VSpaceImpl clone()
      Specified by:
      clone in interface Constrainable
      Specified by:
      clone in interface VSpace
      Overrides:
      clone in class Object
    • isLimitedTo

      public boolean isLimitedTo(Object dimensionKey)
      Description copied from interface: VSpace
      Whether the value space only has ranges in the dimension with the given key (e.g. numeric, iRI, text, ...)
      Specified by:
      isLimitedTo in interface VSpace
    • stateIntersection

      public VSpaceImpl stateIntersection(VSpace valueSpace)
      Specified by:
      stateIntersection in interface Constrainable
      Specified by:
      stateIntersection in interface VSpace
    • stateUnion

      public VSpaceImpl stateUnion(VSpace valueSpace)
      Specified by:
      stateUnion in interface Constrainable
      Specified by:
      stateUnion in interface VSpace
    • isConflicting

      public boolean isConflicting()
      Specified by:
      isConflicting in interface Constrainable
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • forDimension

      public VSpace forDimension(Object dimensionKey)
      TODO The factory-aspect of creating a new ValueSpace with an open dimension should go to ValueSpaceSchema
      Specified by:
      forDimension in interface VSpace
    • mapDimensionToNewVSpace

      public <X extends Comparable<X>> VSpace mapDimensionToNewVSpace(Object fromDimKey, Class<X> itemType, Object toDimKey, Function<com.google.common.collect.Range<X>,com.google.common.collect.Range<X>> mapper)
      Description copied from interface: VSpace
      Create a new value space by mapping the values from a given dimension Issue: We don't know if the mapping is surjective - i.e. if the src range is unconstrained, the tgt range in that dimension may yet be constrained.
      Specified by:
      mapDimensionToNewVSpace in interface VSpace
    • relateTo

      public org.aksw.commons.algebra.allen.AllenRelation relateTo(VSpace that)
      Description copied from interface: VSpace
      Return a relation for how this space relates to another. In particular, it allows for testing whether e.g. the values of this space appear all before the values in another one with respect to the domain. The returned relation is the bitwise OR of the Allen relation of each dimension.
      Specified by:
      relateTo in interface VSpace
    • span

      public static com.google.common.collect.Range<org.aksw.commons.util.range.Cmp<Map.Entry<?,org.aksw.commons.util.range.Cmp<ComparableNodeValue>>>> span(VSpace vspace)