Class 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 Detail

      • fromIdentifier

        public static Reference fromIdentifier​(String identifier)
      • 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 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