JavaScript is disabled on your browser.
JavaFX 2.2
javafx.util

Class Pair<K,V>



  • public class Pair<K,V>
    extends java.lang.Object

    A convenience class to represent name-value pairs.

    • Constructor Summary

      Constructors
      Constructor and Description
      Pair (K key, V value)
      Creates a new pair
    • Method Summary

      Methods
      Modifier and Type Method and Description
      boolean equals (java.lang.Object o)
      Test this Pair for equality with another Object.
      K getKey ()
      Gets the key for this pair.
      V getValue ()
      Gets the value for this pair.
      int hashCode ()
      Generate a hash code for this Pair.
      java.lang.String toString ()
      String representation of this Pair.
      • Methods inherited from class java.lang.Object

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

      • Pair

        public Pair(K key,
         V value)
        Creates a new pair
        Parameters:
        key - The key for this pair
        value - The value to use for this pair
    • Method Detail

      • getKey

        public K getKey()
        Gets the key for this pair.
        Returns:
        key for this pair
      • getValue

        public V getValue()
        Gets the value for this pair.
        Returns:
        value for this pair
      • toString

        public java.lang.String toString()

        String representation of this Pair.

        The default name/value delimiter '=' is always used.

        Overrides:
        toString in class java.lang.Object
        Returns:
        String representation of this Pair
      • hashCode

        public int hashCode()

        Generate a hash code for this Pair.

        The hash code is calculated using both the name and the value of the Pair.

        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hash code for this Pair
      • equals

        public boolean equals(java.lang.Object o)

        Test this Pair for equality with another Object.

        If the Object to be tested is not a Pair or is null, then this method returns false.

        Two Pairs are considered equal if and only if both the names and values are equal.

        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - the Object to test for equality with this Pair
        Returns:
        true if the given Object is equal to this Pair else false
JavaFX 2.2

Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.

AltStyle によって変換されたページ (->オリジナル) /