Class Reference
- java.lang.Object
-
- com.yahoo.tensor.evaluation.Name
-
- com.yahoo.searchlib.rankingexpression.Reference
-
- All Implemented Interfaces:
Comparable<Reference>
public class Reference extends com.yahoo.tensor.evaluation.Name implements Comparable<Reference>
A reference to a feature, function, or value in ranking expressions- Author:
- bratseth
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Arguments
arguments()
int
compareTo(Reference o)
boolean
equals(Object o)
static Reference
fromIdentifier(String identifier)
int
hashCode()
boolean
isIdentifier()
Returns true if this was created by fromIdentifier.boolean
isSimple()
A simple feature reference is a reference with a single identifier argument (and an optional output).String
output()
static Optional<Reference>
simple(String feature)
Returns the given simple feature as a reference, or empty if it is not a valid simple feature string on the form name(argument).static Reference
simple(String name, String argumentValue)
Creates a reference to a simple feature consisting of a name and a single argumentOptional<String>
simpleArgument()
If the arguments of this contains a single argument which is an identifier, it is returned.String
toString()
StringBuilder
toString(StringBuilder b, SerializationContext context, Deque<String> path, CompositeNode parent)
Reference
withArguments(Arguments arguments)
Reference
withOutput(String output)
-
-
-
Method Detail
-
arguments
public Arguments arguments()
-
output
public String output()
-
simple
public static Reference simple(String name, String argumentValue)
Creates a reference to a simple feature consisting of a name and a single argument
-
simple
public static Optional<Reference> simple(String feature)
Returns the given simple feature as a reference, or empty if it is not a valid simple feature string on the form name(argument).
-
isIdentifier
public boolean isIdentifier()
Returns true if this was created by fromIdentifier. Identifiers have no arguments or outputs.
-
isSimple
public boolean isSimple()
A simple feature reference is a reference with a single identifier argument (and an optional output).
-
simpleArgument
public Optional<String> simpleArgument()
If the arguments of this contains a single argument which is an identifier, it is returned. Otherwise null is returned.
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classcom.yahoo.tensor.evaluation.Name
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classcom.yahoo.tensor.evaluation.Name
-
toString
public String toString()
- Overrides:
toString
in classcom.yahoo.tensor.evaluation.Name
-
toString
public StringBuilder toString(StringBuilder b, SerializationContext context, Deque<String> path, CompositeNode parent)
-
compareTo
public int compareTo(Reference o)
- Specified by:
compareTo
in interfaceComparable<Reference>
-
-