Class Binding

  • All Implemented Interfaces:
    java.lang.Comparable<Binding>

    public class Binding
    extends java.lang.Object
    implements java.lang.Comparable<Binding>
    An immutable binding of a set of dimensions to values. This binding is minimal in that it only includes dimensions which actually have values.
    Author:
    bratseth
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(Binding other)
      Implements a partial ordering where more specific bindings come before less specific ones, taking both the number of bindings and their positions into account (earlier dimensions take precedence over later ones).
      static Binding createFrom​(DimensionBinding dimensionBinding)  
      boolean equals​(java.lang.Object o)
      Returns whether the given binding has exactly the same values as this
      boolean generalizes​(Binding other)
      Returns whether this binding is a proper generalization of the given binding: Meaning it contains a proper subset of the given bindings.
      int hashCode()  
      boolean isNull()
      Returns true only if this binding is null (contains no values for its dimensions (if any)
      boolean matches​(java.util.Map<java.lang.String,​java.lang.String> context)
      Returns true if all the dimension values in this have the same values in the given context.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • nullBinding

        public static final Binding nullBinding
    • Method Detail

      • generalizes

        public boolean generalizes​(Binding other)
        Returns whether this binding is a proper generalization of the given binding: Meaning it contains a proper subset of the given bindings.
      • isNull

        public boolean isNull()
        Returns true only if this binding is null (contains no values for its dimensions (if any)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Returns whether the given binding has exactly the same values as this
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • matches

        public boolean matches​(java.util.Map<java.lang.String,​java.lang.String> context)
        Returns true if all the dimension values in this have the same values in the given context.
      • compareTo

        public int compareTo​(Binding other)
        Implements a partial ordering where more specific bindings come before less specific ones, taking both the number of bindings and their positions into account (earlier dimensions take precedence over later ones).

        The order is not well defined for bindings in different dimensional spaces.

        Specified by:
        compareTo in interface java.lang.Comparable<Binding>