Class BigDecimalMapKey

java.lang.Object
net.sf.saxon.ma.map.BigDecimalMapKey
All Implemented Interfaces:
AtomicMatchKey

public class BigDecimalMapKey extends Object implements AtomicMatchKey
A BigDecimalMapKey is the AtomicMatchKey used for any numeric value that is not (a) numerically equal to some 32-bit integer, or (b) one of the special values NaN, +INF, or -INF. It encapsulates a BigDecimal, which must be scaled to ensure that the equals() and hashcode methods follow the XPath-defined equality rules.
  • Constructor Details

    • BigDecimalMapKey

      public BigDecimalMapKey(BigDecimal key)
  • Method Details

    • asAtomic

      public AtomicValue asAtomic()
      Get an atomic value that encapsulates this match key. Needed to support the collation-key() function.
      Specified by:
      asAtomic in interface AtomicMatchKey
      Returns:
      an atomic value that encapsulates this match key. NB: this is NOT (necessarily) the atomic value from which the AtomicMatchKey was derived.
    • equals

      public boolean equals(Object obj)
      Indicates whether some other object is "equal to" this one. The algorithm for allocating map keys is designed to ensure that a numeric value that is numerically equal to some 32-bit integer is always represented by an instance of Int32MapKey, and therefore the keys can be directly compared using an integer comparison.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Returns a hash code value for the object.
      Overrides:
      hashCode in class Object