public final class IntDoublePair extends Object implements org.joda.beans.ImmutableBean, Tuple, Comparable<IntDoublePair>, Serializable
int and double.
This class is similar to Pair but is based on two primitive elements.
This class is immutable and thread-safe.
| Modifier and Type | Class and Description |
|---|---|
static class |
IntDoublePair.Meta
The meta-bean for
IntDoublePair. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(IntDoublePair other)
Compares the pair based on the first element followed by the second element.
|
ImmutableList<Object> |
elements()
Gets the elements from this pair as a list.
|
boolean |
equals(Object obj) |
int |
getFirst()
Gets the first element in this pair.
|
double |
getSecond()
Gets the second element in this pair.
|
int |
hashCode() |
static IntDoublePair.Meta |
meta()
The meta-bean for
IntDoublePair. |
IntDoublePair.Meta |
metaBean() |
static IntDoublePair |
of(int first,
double second)
Obtains an instance from an
int and a double. |
static IntDoublePair |
ofPair(Pair<Integer,Double> pair)
Obtains an instance from a
Pair. |
static IntDoublePair |
parse(String pairStr)
Parses an
IntDoublePair from the standard string format. |
int |
size()
Gets the number of elements held by this pair.
|
Pair<Integer,Double> |
toPair()
Converts this pair to an object-based
Pair. |
String |
toString()
Gets the pair using a standard string format.
|
public static IntDoublePair of(int first, double second)
int and a double.first - the first elementsecond - the second elementpublic static IntDoublePair ofPair(Pair<Integer,Double> pair)
Pair.pair - the pair to convertpublic static IntDoublePair parse(String pairStr)
IntDoublePair from the standard string format.
The standard format is '[$first, $second]'. Spaces around the values are trimmed.
pairStr - the text to parseIllegalArgumentException - if the pair cannot be parsedpublic int size()
public ImmutableList<Object> elements()
The list returns each element in the pair in order.
public Pair<Integer,Double> toPair()
Pair.public int compareTo(IntDoublePair other)
This compares the first elements, then the second elements.
compareTo in interface Comparable<IntDoublePair>other - the other pairpublic String toString()
The standard format is '[$first, $second]'. Spaces around the values are trimmed.
public static IntDoublePair.Meta meta()
IntDoublePair.public IntDoublePair.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic int getFirst()
public double getSecond()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.