Package com.yahoo.search.query.profile
Class DimensionValues
java.lang.Object
com.yahoo.search.query.profile.DimensionValues
- All Implemented Interfaces:
Comparable<DimensionValues>
An immutable set of dimension values.
Note that this may contain more or fewer values than needed given a set of dimensions.
Any missing values are treated as null.
- Author:
- bratseth
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(DimensionValues other) Implements the sort order of this which is based on specificity where dimensions to the left are more significant: -1 is returned if this is more specific than other, 1 is returned if other is more specific than this, 0 is returned if none is more specific than the other.static DimensionValues
createFrom
(String[] values) boolean
get
(int index) Returns the string at the given index, or null if it has no value at this indexString[]
Returns a copy of the values in this in an arrayint
hashCode()
boolean
isEmpty()
boolean
Helper method which uses compareTo to return whether this is most specificboolean
matches
(DimensionValues givenValues) Returns true if this is has the same value every place it has a value as the given values.int
size()
Returns the number of values in this (some of which may be null)toString()
-
Field Details
-
empty
-
-
Method Details
-
createFrom
-
matches
Returns true if this is has the same value every place it has a value as the given values. -
compareTo
Implements the sort order of this which is based on specificity where dimensions to the left are more significant: -1 is returned if this is more specific than other, 1 is returned if other is more specific than this, 0 is returned if none is more specific than the other.Note: This ordering is not consistent with equals - it returns 0 when the same dimensions are set, regardless of what they are set to.
- Specified by:
compareTo
in interfaceComparable<DimensionValues>
-
isMoreSpecificThan
Helper method which uses compareTo to return whether this is most specific -
equals
-
hashCode
public int hashCode() -
toString
-
isEmpty
public boolean isEmpty() -
asContext
-
get
Returns the string at the given index, or null if it has no value at this index -
size
public int size()Returns the number of values in this (some of which may be null) -
getValues
Returns a copy of the values in this in an array
-