Spec-Zone .ru
спецификации, руководства, описания, API
|
public class Pair<K,V>
extends java.lang.Object
A convenience class to represent name-value pairs.
Constructor and Description |
---|
Pair(K key,
V value)
Creates a new pair
|
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 . |
public K getKey()
public V getValue()
public java.lang.String toString()
String
representation of this
Pair
.
The default name/value delimiter '=' is always used.
toString
in class java.lang.Object
String
representation of this Pair
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
.
hashCode
in class java.lang.Object
Pair
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 Pair
s are considered equal if and only if
both the names and values are equal.
equals
in class java.lang.Object
o
- the Object
to test for
equality with this Pair
true
if the given Object
is
equal to this Pair
else false
Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. Use is subject to