public final class LongDoublePair extends Object implements org.joda.beans.ImmutableBean, Tuple, Comparable<LongDoublePair>, Serializable
long 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 |
LongDoublePair.Meta
The meta-bean for
LongDoublePair. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(LongDoublePair 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) |
long |
getFirst()
Gets the first element in this pair.
|
double |
getSecond()
Gets the second element in this pair.
|
int |
hashCode() |
static LongDoublePair.Meta |
meta()
The meta-bean for
LongDoublePair. |
LongDoublePair.Meta |
metaBean() |
static LongDoublePair |
of(long first,
double second)
Obtains an instance from a
long and a double. |
static LongDoublePair |
ofPair(Pair<Long,Double> pair)
Obtains an instance from a
Pair. |
static LongDoublePair |
parse(String pairStr)
Parses a
LongDoublePair from the standard string format. |
int |
size()
Gets the number of elements held by this pair.
|
Pair<Long,Double> |
toPair()
Converts this pair to an object-based
Pair. |
String |
toString()
Gets the pair using a standard string format.
|
public static LongDoublePair of(long first, double second)
long and a double.first - the first elementsecond - the second elementpublic static LongDoublePair ofPair(Pair<Long,Double> pair)
Pair.pair - the pair to convertpublic static LongDoublePair parse(String pairStr)
LongDoublePair 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<Long,Double> toPair()
Pair.public int compareTo(LongDoublePair other)
This compares the first elements, then the second elements.
compareTo in interface Comparable<LongDoublePair>other - the other pairpublic String toString()
The standard format is '[$first, $second]'. Spaces around the values are trimmed.
public static LongDoublePair.Meta meta()
LongDoublePair.public LongDoublePair.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic long 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.