Class SparseSketch

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class SparseSketch
    extends Sketch<SparseSketch>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int classId  
    • Constructor Summary

      Constructors 
      Constructor Description
      SparseSketch()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void aggregate​(int hash)
      Aggregates the hash value.
      void aggregate​(java.lang.Iterable<java.lang.Integer> hashValues)
      Aggregates the hash values.
      java.util.HashSet<java.lang.Integer> data()  
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      void merge​(SparseSketch other)
      Merge content of other into 'this'.
      protected void onDeserialize​(com.yahoo.vespa.objects.Deserializer buf)  
      protected int onGetClassId()  
      protected void onSerialize​(com.yahoo.vespa.objects.Serializer buf)
      Serializes the Sketch.
      int size()  
      java.lang.String toString()  
      • Methods inherited from class com.yahoo.vespa.objects.Identifiable

        clone, create, createFromId, deserialize, deserializeOptional, deserializeWithId, equals, getClassId, getUtf8, 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
    • Field Detail

      • classId

        public static final int classId
    • Constructor Detail

      • SparseSketch

        public SparseSketch()
    • Method Detail

      • merge

        public void merge​(SparseSketch other)
        Description copied from class: Sketch
        Merge content of other into 'this'.
        Specified by:
        merge in class Sketch<SparseSketch>
        Parameters:
        other - Other sketch
      • aggregate

        public void aggregate​(java.lang.Iterable<java.lang.Integer> hashValues)
        Aggregates the hash values.
        Specified by:
        aggregate in class Sketch<SparseSketch>
        Parameters:
        hashValues - Provides an iterator for the hash values
      • aggregate

        public void aggregate​(int hash)
        Aggregates the hash value.
        Specified by:
        aggregate in class Sketch<SparseSketch>
        Parameters:
        hash - Hash value.
      • onSerialize

        protected void onSerialize​(com.yahoo.vespa.objects.Serializer buf)
        Serializes the Sketch. Serialization format ================== Number of elements: 4 bytes Elements: N * 4 bytes
        Overrides:
        onSerialize in class com.yahoo.vespa.objects.Identifiable
        Parameters:
        buf - Serializer
      • onDeserialize

        protected void onDeserialize​(com.yahoo.vespa.objects.Deserializer buf)
        Overrides:
        onDeserialize in class com.yahoo.vespa.objects.Identifiable
      • onGetClassId

        protected int onGetClassId()
        Overrides:
        onGetClassId in class com.yahoo.vespa.objects.Identifiable
      • data

        public java.util.HashSet<java.lang.Integer> data()
      • size

        public int size()
      • equals

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

        public int hashCode()
        Overrides:
        hashCode in class com.yahoo.vespa.objects.Identifiable
      • toString

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