public class RankableObjectWithFields extends Object implements Rankable, Serializable
Constructor and Description |
---|
RankableObjectWithFields(Object obj,
long count,
Object... otherFields) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Rankable other) |
Rankable |
copy()
Note: We do not defensively copy the wrapped object and any accompanying fields.
|
boolean |
equals(Object o) |
static RankableObjectWithFields |
from(Tuple tuple)
Construct a new instance based on the provided
Tuple . |
long |
getCount() |
List<Object> |
getFields()
Get fields.
|
Object |
getObject() |
int |
hashCode() |
String |
toString() |
public static RankableObjectWithFields from(Tuple tuple)
Tuple
.
This method expects the object to be ranked in the first field (index 0) of the provided tuple, and the number of
occurrences of the object (its count) in the second field (index 1). Any further fields in the tuple will be
extracted and tracked, too. These fields can be accessed via getFields()
.tuple
- public List<Object> getFields()
public int compareTo(Rankable other)
compareTo
in interface Comparable<Rankable>
Copyright © 2023 The Apache Software Foundation. All rights reserved.