public class LevelOrderPair extends Object implements Comparable<LevelOrderPair>
Modifier and Type | Field and Description |
---|---|
int |
level
The level of this pair.
|
int |
order
The order of this pair.
|
Constructor and Description |
---|
LevelOrderPair(int level,
int order)
Initializes this pair with a level and an order.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(LevelOrderPair otherLevelOrderPair)
Compares this object with the specified object, comparing first the order and the level of the objects.
|
boolean |
equals(Object otherLevelOrderPair)
Indicates whether the given pair is equal to this one, i.e.
|
int |
hashCode()
Returns a hash code value for this pair given its level and order, to be used in hashmaps.
|
String |
toString()
Returns a string representation of this pair.
|
public final int level
public final int order
public LevelOrderPair(int level, int order)
level
- the level of the pair.order
- the order of the pair.public int hashCode()
public boolean equals(Object otherLevelOrderPair)
public String toString()
public int compareTo(LevelOrderPair otherLevelOrderPair)
compareTo
in interface Comparable<LevelOrderPair>
otherLevelOrderPair
- the given object to be compared to this one.Copyright © 2017. All rights reserved.