Class StringValue


  • public class StringValue
    extends Value
    A string value.
    Author:
    bratseth
    • Constructor Detail

      • StringValue

        public StringValue​(String value)
    • Method Detail

      • frozen

        public static StringValue frozen​(String value)
        Create a string value which is frozen at the outset.
      • type

        public com.yahoo.tensor.TensorType type()
        Description copied from class: Value
        Returns the type of this value
        Specified by:
        type in class Value
      • asDouble

        public double asDouble()
        Returns the hashcode of this, to enable strings to be encoded (with reasonable safely) as doubles for optimization
        Specified by:
        asDouble in class Value
      • asTensor

        public com.yahoo.tensor.Tensor asTensor()
        Description copied from class: Value
        Returns this as a tensor value
        Specified by:
        asTensor in class Value
      • hasDouble

        public boolean hasDouble()
        Description copied from class: Value
        Returns true if this value can return itself as a double, i.e asDoubleValue will return a value and not throw
        Specified by:
        hasDouble in class Value
      • asBoolean

        public boolean asBoolean()
        Description copied from class: Value
        Returns this value as a boolean.
        Specified by:
        asBoolean in class Value
      • compare

        public Value compare​(TruthOperator operator,
                             Value value)
        Description copied from class: Value
        Perform the comparison specified by the operator between this value and the given value
        Specified by:
        compare in class Value
      • function

        public Value function​(Function function,
                              Value value)
        Description copied from class: Value
        Perform the given binary function on this value and the given value
        Specified by:
        function in class Value
      • asMutable

        public Value asMutable()
        Description copied from class: Value
        Returns this is mutable, or a mutable copy otherwise
        Specified by:
        asMutable in class Value
      • equals

        public boolean equals​(Object other)
        Specified by:
        equals in class Value
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in class Value
      • asString

        public String asString()
        Returns the value of this as a string