F
- Type of the first element of the pair.S
- Type of the second element of the pair.public class Pair<F,S>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected F |
first
First element of the pair.
|
protected S |
second
Second element of the pair.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Pair<S,F> other)
Checks if this pair has the same elements as the one given.
|
boolean |
containsSomeElementOf(Pair<S,F> other)
Checks if this pair has at least one element equals to one of the pair given.
|
boolean |
equals(Pair<S,F> other)
Checks if this pair is equals to the other given.
|
F |
first()
Get first element of the pair.
|
F |
getFirst()
Get first element of the pair.
|
S |
getSecond()
Get second element of the pair.
|
Pair<S,F> |
invert()
Invert the pair.
|
S |
second()
Get second element of the pair.
|
void |
set(F f,
S s)
Set elements of the pair.
|
java.lang.String |
toString()
Show par as String.
|
protected F first
protected S second
public F first()
public S second()
public F getFirst()
public S getSecond()
public java.lang.String toString()
toString
in class java.lang.Object
public void set(F f, S s)
f
- New first element of the pair.s
- New second element of the pair.public Pair<S,F> invert()
public boolean equals(Pair<S,F> other)
other
- other pair to compare with.public boolean contains(Pair<S,F> other)
other
- other pair to compare with.public boolean containsSomeElementOf(Pair<S,F> other)
other
- other pair to compare with.