Class Pair<P,​Q>

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    AbstractRTree.PairDebug

    public class Pair<P,​Q>
    extends java.lang.Object
    implements java.io.Serializable
    A simple utility class for holding a pair of elements.
    Since:
    release specific (what release of product did this appear in)
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Pair​(Pair<? extends P,​? extends Q> orig)
      Creates an entry representing the same mapping as the specified entry.
      Pair​(P p, Q q)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)
      Compares the specified object with this entry for equality.
      P getP()  
      Q getQ()  
      int hashCode()  
      void setP​(P p)  
      void setQ​(Q q)  
      java.lang.String toString()
      Returns a String representation of this map entry.
      • Methods inherited from class java.lang.Object

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

      • Pair

        public Pair​(P p,
                    Q q)
      • Pair

        public Pair​(Pair<? extends P,​? extends Q> orig)
        Creates an entry representing the same mapping as the specified entry.
        Parameters:
        orig - the entry to copy
    • Method Detail

      • setP

        public void setP​(P p)
      • getP

        public P getP()
      • setQ

        public void setQ​(Q q)
      • getQ

        public Q getQ()
      • equals

        public boolean equals​(java.lang.Object o)
        Compares the specified object with this entry for equality. Returns true if the given object is also a Pair and the two entries represent the same Pair.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - object to be compared for equality with this map entry
        Returns:
        true if the specified object is equal to this map entry
        See Also:
        hashCode()
      • hashCode

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

        public java.lang.String toString()
        Returns a String representation of this map entry. This implementation returns the string representation of this entry's key followed by the equals character ("=") followed by the string representation of this entry's value.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a String representation of this map entry