Class Itemset

    • 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​(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,
                                                      VectorFieldTypeInformation<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,
                                                     VectorFieldTypeInformation<BitVector> meta)
        Only append the items to a string buffer.
        Parameters:
        buf - Buffer
        meta - Relation metadata (for labels)
        Returns:
        String buffer for chaining.