Class SummaryField

  • All Implemented Interfaces:
    com.yahoo.document.fieldset.FieldSet, TypedKey, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable

    public class SummaryField
    extends com.yahoo.document.Field
    implements java.lang.Cloneable, TypedKey
    A summary field
    Author:
    bratseth
    See Also:
    Serialized Form
    • Constructor Detail

      • SummaryField

        public SummaryField​(java.lang.String name,
                            com.yahoo.document.DataType type)
        Creates a summary field with NONE as transform
      • SummaryField

        public SummaryField​(com.yahoo.document.Field field)
        Creates a summary field with NONE as transform
      • SummaryField

        public SummaryField​(com.yahoo.document.Field field,
                            SummaryTransform transform)
      • SummaryField

        public SummaryField​(java.lang.String name,
                            com.yahoo.document.DataType type,
                            SummaryTransform transform)
    • Method Detail

      • setImplicit

        public void setImplicit​(boolean implicit)
      • isImplicit

        public boolean isImplicit()
      • getSourceField

        public java.lang.String getSourceField()
        Returns the first source field of this, or null if the source field is not present
      • addSource

        public void addSource​(java.lang.String name)
      • getSourceCount

        public int getSourceCount()
      • getSources

        public java.util.Set<SummaryField.Source> getSources()
        Returns a modifiable set of the sources of this
      • getSingleSource

        public java.lang.String getSingleSource()
        Returns the first source name of this, or the field name if no source has been set
      • addDestination

        public void addDestination​(java.lang.String name)
      • addDestinations

        public final void addDestinations​(java.lang.Iterable<java.lang.String> names)
      • getDestinations

        public java.util.Set<java.lang.String> getDestinations()
        Returns an modifiable view of the destination set owned by this
      • mergeWith

        public SummaryField mergeWith​(SummaryField merge)
        Returns a summary field which merges the settings in the given field into this field
        Parameters:
        merge - the field to merge with this, if null, the merged field is this field
        Throws:
        java.lang.RuntimeException - if the two fields can not be merged
      • hasSource

        public boolean hasSource​(java.lang.String name)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class com.yahoo.document.Field
      • toLocateString

        public java.lang.String toLocateString()
        Returns a string which aids locating this field in the source search definition
      • clone

        public SummaryField clone()
        Specified by:
        clone in interface com.yahoo.document.fieldset.FieldSet
        Overrides:
        clone in class com.yahoo.document.Field
      • addProperty

        public void addProperty​(java.lang.String name,
                                java.lang.String value)
        Adds a property to this summary field