Class Itemset

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int support
      Support for this itemset.
    • Constructor Summary

      Constructors 
      Constructor Description
      Itemset()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      java.lang.StringBuilder appendItemsTo​(java.lang.StringBuilder buf, elki.data.type.VectorFieldTypeInformation<elki.data.BitVector> meta)
      Only append the items to a string buffer.
      java.lang.StringBuilder appendTo​(java.lang.StringBuilder buf, elki.data.type.VectorFieldTypeInformation<elki.data.BitVector> meta)
      Append items and support to a string buffer.
      protected static int compareLexicographical​(Itemset a, Itemset o)
      Robust compare using the iterators, lexicographical only!
      int compareTo​(Itemset o)  
      boolean containedIn​(elki.data.SparseNumberVector bv)
      Test whether the itemset is contained in a bit vector.
      boolean equals​(java.lang.Object obj)  
      int getSupport()
      Get item support.
      int hashCode()
      Deprecated.
      Itemsets MUST NOT BE USED IN HASH MAPS.
      int increaseSupport()
      Increase the support of the itemset.
      abstract int iter()
      Get an iterator over items, usually the position within an array.
      abstract int iterAdvance​(int iter)
      Advance the iterator to the next position.
      abstract int iterDim​(int iter)
      Item at the iterator position.
      abstract boolean iterValid​(int iter)
      Check if the iterator position is valid.
      abstract int length()
      Itemset length.
      static long[] toBitset​(Itemset i, long[] bits)
      Get the items.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • support

        int support
        Support for this itemset.
    • Constructor Detail

      • Itemset

        public Itemset()
    • Method Detail

      • increaseSupport

        public int increaseSupport()
        Increase the support of the itemset.
        Returns:
        New support.
      • getSupport

        public int getSupport()
        Get item support.
        Returns:
        Support
      • containedIn

        public boolean containedIn​(elki.data.SparseNumberVector bv)
        Test whether the itemset is contained in a bit vector.
        Parameters:
        bv - Bit vector
        Returns:
        true when the itemset is contained in this vector.
      • length

        public abstract int length()
        Itemset length.
        Returns:
        Itemset length
      • toBitset

        public static long[] toBitset​(Itemset i,
                                      long[] bits)
        Get the items.
        Parameters:
        i - Itemset
        bits - Output bitset (must be zeros)
        Returns:
        Output bitset
      • iter

        public abstract int iter()
        Get an iterator over items, usually the position within an array. Intended usage:
         
         for (int iter = v.iter(); v.iterValid(iter); iter = v.iterAdvance(iter)) {
           final int item = v.iterItem(iter);
           // Do something.
         }
         
         
        Returns:
        Iterator
      • iterAdvance

        public abstract int iterAdvance​(int iter)
        Advance the iterator to the next position.
        Parameters:
        iter - Iterator
        Returns:
        New iterator position
      • iterValid

        public abstract boolean iterValid​(int iter)
        Check if the iterator position is valid.
        Parameters:
        iter - Iterator
        Returns:
        true if the position is valid.
      • iterDim

        public abstract int iterDim​(int iter)
        Item at the iterator position.
        Parameters:
        iter - Iterator
        Returns:
        Current item
      • compareTo

        public int compareTo​(Itemset o)
        Specified by:
        compareTo in interface java.lang.Comparable<Itemset>
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        @Deprecated
        public int hashCode()
        Deprecated.
        Itemsets MUST NOT BE USED IN HASH MAPS.
        Overrides:
        hashCode in class java.lang.Object
      • compareLexicographical

        protected static int compareLexicographical​(Itemset a,
                                                    Itemset o)
        Robust compare using the iterators, lexicographical only! Note: This does NOT take length into account.
        Parameters:
        o - Other itemset.
        Returns:
        Comparison result.
      • toString

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

        public final java.lang.StringBuilder appendTo​(java.lang.StringBuilder buf,
                                                      elki.data.type.VectorFieldTypeInformation<elki.data.BitVector> meta)
        Append items and support to a string buffer.
        Parameters:
        buf - Buffer
        meta - Relation metadata (for labels)
        Returns:
        String buffer for chaining.
      • appendItemsTo

        public java.lang.StringBuilder appendItemsTo​(java.lang.StringBuilder buf,
                                                     elki.data.type.VectorFieldTypeInformation<elki.data.BitVector> meta)
        Only append the items to a string buffer.
        Parameters:
        buf - Buffer
        meta - Relation metadata (for labels)
        Returns:
        String buffer for chaining.