Class TensorFieldValue

  • All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Comparable<FieldValue>

    public class TensorFieldValue
    extends FieldValue
    Field value class that wraps a tensor.
    Author:
    geirst
    • Constructor Summary

      Constructors 
      Constructor Description
      TensorFieldValue​(com.yahoo.tensor.Tensor tensor)
      Create a tensor field value containing the given tensor
      TensorFieldValue​(com.yahoo.tensor.TensorType type)
      Create an empty tensor field value
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void assign​(java.lang.Object o)
      Assign this non-fieldvalue value to this field value.
      void assignTensor​(java.util.Optional<com.yahoo.tensor.Tensor> tensor)  
      void clear()  
      void deserialize​(Field field, FieldReader reader)
      Read a field value from the specified reader
      boolean equals​(java.lang.Object o)  
      TensorDataType getDataType()  
      java.util.Optional<com.yahoo.tensor.Tensor> getTensor()  
      java.lang.Object getWrappedValue()
      Used to retrieve wrapped type for simple types, such that you can use get methods to retrieve ints and floats directly instead of Int/Float field values.
      void printXml​(XmlStream xml)  
      void serialize​(Field field, FieldWriter writer)
      Write out field value to the specified writer
      java.lang.String toString()  
      • Methods inherited from class com.yahoo.vespa.objects.Identifiable

        create, createFromId, deserialize, deserializeOptional, deserializeWithId, equals, getClassId, getUtf8, hashCode, onGetClassId, putUtf8, registerClass, serialize, serializeOptional, serializeWithId, visitMembers
      • Methods inherited from class com.yahoo.vespa.objects.Selectable

        select, select, selectMembers
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TensorFieldValue

        public TensorFieldValue​(com.yahoo.tensor.TensorType type)
        Create an empty tensor field value
      • TensorFieldValue

        public TensorFieldValue​(com.yahoo.tensor.Tensor tensor)
        Create a tensor field value containing the given tensor
    • Method Detail

      • getTensor

        public java.util.Optional<com.yahoo.tensor.Tensor> getTensor()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class com.yahoo.vespa.objects.Identifiable
      • assign

        public void assign​(java.lang.Object o)
        Description copied from class: FieldValue
        Assign this non-fieldvalue value to this field value. This is used to be able to assign ints to Integer field values and List to Array field values and such.

        Override to accept the specific types that should be legal.

        Specified by:
        assign in class FieldValue
      • assignTensor

        public void assignTensor​(java.util.Optional<com.yahoo.tensor.Tensor> tensor)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class com.yahoo.vespa.objects.Identifiable
      • getWrappedValue

        public java.lang.Object getWrappedValue()
        Description copied from class: FieldValue
        Used to retrieve wrapped type for simple types, such that you can use get methods to retrieve ints and floats directly instead of Int/Float field values. Complex types that can't be specified by simple java types just return themself.
        Overrides:
        getWrappedValue in class FieldValue