Class CoContraDimensionPairs


  • public final class CoContraDimensionPairs
    extends java.lang.Object
    Provides utility methods related to CoContraDimensionPairs and collections of them.
    • Method Detail

      • rightDimensionsIn

        public static java.util.Set<java.lang.Class<?>> rightDimensionsIn​(java.lang.Iterable<CoContraDimensionPair> pairs)
      • leftDimensionsIn

        public static java.util.Set<java.lang.Class<?>> leftDimensionsIn​(java.lang.Iterable<CoContraDimensionPair> pairs)
      • allDimensionsIn

        public static java.util.Set<java.lang.Class<?>> allDimensionsIn​(java.lang.Iterable<CoContraDimensionPair> pairs)
        Collects all the dimensions that are contained in at least one of the given pairs, as either left or right dimension.
        Parameters:
        pairs - the pairs from which to retrieve the dimensions
        Returns:
        all the dimensions which are involved in at least one of the sets
      • coContraPairsOf

        public static java.util.List<CoContraDimensionPair> coContraPairsOf​(Shape left,
                                                                            Shape right)
        Searches in the two given shapes for dimensions that form pairs of co- and contravariant dimensions. This means that the dimension is either covariant in the left shape and contravariant in the right or the other way around.
        Parameters:
        left - the left shape of an operation that involves co- contravariant coordinates
        right - the right shape of an operation that involves co- and contravariant coordinates
        Returns:
        a (unfiltered) list of pairs of coordinates, that have have co- and contravariant matches in both shapes.
      • chooseOnePerContravariantPart

        public static java.util.List<CoContraDimensionPair> chooseOnePerContravariantPart​(java.util.List<CoContraDimensionPair> allPairs)
        Filters the list of pairs in such a way, that only one per contravariant type remains.
        Parameters:
        allPairs - the pairs to filter
        Returns:
        a list containing only those, which in the end shall be used