Class RelevancyFeatureVector

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class RelevancyFeatureVector
    extends java.lang.Object
    implements java.lang.Cloneable, java.io.Serializable
    Experimental Relevancy API.

    NOTE: Features are sorted by name.

    See Also:
    Serialized Form
    • Constructor Detail

      • RelevancyFeatureVector

        public RelevancyFeatureVector()
      • RelevancyFeatureVector

        public RelevancyFeatureVector​(int initialCapacity)
    • Method Detail

      • clear

        public void clear()
        Remove all features from this feature vector.
      • getFeatureName

        public java.lang.String getFeatureName​(int index)
      • getFeatureValue

        public float getFeatureValue​(int index)
      • addFeatureValue

        public float addFeatureValue​(java.lang.String name,
                                     float amount)
        Adds amount to the feature at index.

        If feature does not yet exist, it will be initialized with amount.

      • size

        public int size()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • writeExternal

        public void writeExternal​(java.io.DataOutput out)
                           throws java.io.IOException
        Throws:
        java.io.IOException