Top Description Fields Constructors Methods
javafx.util

public Class Pair<K, V>

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Type Parameters
<K>
the key (name) type
<V>
the value type
Imports
java.io.Serializable, javafx.beans.NamedArg

A convenience class to represent name-value pairs.
Since
JavaFX 2.0

Field Summary

Modifier and TypeField and Description
private K
key

Key of this Pair.

private V
value

Value of this this Pair.

Constructor Summary

AccessConstructor and Description
public
Pair(K
The key for this pair
key
,
V
The value to use for this pair
value
)

Creates a new pair

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the given Object is equal to this Pair else false
equals
(Object
the Object to test for equality with this Pair
o
)

Overrides java.lang.Object.equals.

Test this Pair for equality with another Object.

public K

Returns:

key for this pair
getKey
()

Gets the key for this pair.

public V

Returns:

value for this pair
getValue
()

Gets the value for this pair.

public int

Returns:

hash code for this Pair
hashCode
()

Overrides java.lang.Object.hashCode.

Generate a hash code for this Pair.

public String

Returns:

String representation of this Pair
toString
()

Overrides java.lang.Object.toString.

String representation of this Pair.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

keyback to summary
private K key

Key of this Pair.

valueback to summary
private V value

Value of this this Pair.

Constructor Detail

Pairback to summary
public Pair(K key, V value)

Creates a new pair

Parameters
key:K

The key for this pair

value:V

The value to use for this pair

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

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.

Parameters
o:Object

the Object to test for equality with this Pair

Returns:boolean

true if the given Object is equal to this Pair else false

Annotations
@Override
getKeyback to summary
public K getKey()

Gets the key for this pair.

Returns:K

key for this pair

getValueback to summary
public V getValue()

Gets the value for this pair.

Returns:V

value for this pair

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Generate a hash code for this Pair.

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

Returns:int

hash code for this Pair

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

String representation of this Pair.

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

Returns:String

String representation of this Pair

Annotations
@Override