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
  • Field Details

  • Constructor Details

  • Method Details

    • arguments

      public Arguments arguments()
    • output

      public String output()
    • 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.
    • withArguments

      public Reference withArguments(Arguments arguments)
    • withOutput

      public Reference withOutput(String output)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class com.yahoo.tensor.evaluation.Name
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class com.yahoo.tensor.evaluation.Name
    • toString

      public String toString()
      Overrides:
      toString in class com.yahoo.tensor.evaluation.Name
    • wrapInRankingExpression

      public static String wrapInRankingExpression(String name)
    • isSimpleRankingExpressionWrapper

      public boolean isSimpleRankingExpressionWrapper()
    • toString

      public StringBuilder toString(StringBuilder b, SerializationContext context, Deque<String> path, CompositeNode parent)
    • compareTo

      public int compareTo(Reference o)
      Specified by:
      compareTo in interface Comparable<Reference>
    • fromIdentifier

      public static Reference fromIdentifier(String identifier)
      Creates a reference from a simple identifier.
    • 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) or name(argument).outputname