Class SmallDenseItemset

  • All Implemented Interfaces:
    java.lang.Comparable<Itemset>

    public class SmallDenseItemset
    extends Itemset
    Frequent itemset, dense representation for up to 64 items.
    Since:
    0.7.0
    Author:
    Erich Schubert
    • Field Detail

      • items

        long items
        Items, as a bitmask.
      • length

        int length
        Itemset length.
    • Constructor Detail

      • SmallDenseItemset

        public SmallDenseItemset​(long items,
                                 int length)
        Constructor.
        Parameters:
        items - Items
        length - Length (Cardinality of itemset)
    • Method Detail

      • length

        public int length()
        Description copied from class: Itemset
        Itemset length.
        Specified by:
        length in class Itemset
        Returns:
        Itemset length
      • containedIn

        public boolean containedIn​(SparseNumberVector bv)
        Description copied from class: Itemset
        Test whether the itemset is contained in a bit vector.
        Overrides:
        containedIn in class Itemset
        Parameters:
        bv - Bit vector
        Returns:
        true when the itemset is contained in this vector.
      • iter

        public int iter()
        Description copied from class: Itemset
        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.
         }
         
         
        Specified by:
        iter in class Itemset
        Returns:
        Iterator
      • iterValid

        public boolean iterValid​(int iter)
        Description copied from class: Itemset
        Check if the iterator position is valid.
        Specified by:
        iterValid in class Itemset
        Parameters:
        iter - Iterator
        Returns:
        true if the position is valid.
      • iterAdvance

        public int iterAdvance​(int iter)
        Description copied from class: Itemset
        Advance the iterator to the next position.
        Specified by:
        iterAdvance in class Itemset
        Parameters:
        iter - Iterator
        Returns:
        New iterator position
      • iterDim

        public int iterDim​(int iter)
        Description copied from class: Itemset
        Item at the iterator position.
        Specified by:
        iterDim in class Itemset
        Parameters:
        iter - Iterator
        Returns:
        Current item
      • equals

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

        @Deprecated
        public int hashCode()
        Deprecated.
        Itemsets MUST NOT BE USED IN HASH MAPS.
        Overrides:
        hashCode in class Itemset
      • compareTo

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

        public java.lang.StringBuilder appendItemsTo​(java.lang.StringBuilder buf,
                                                     VectorFieldTypeInformation<BitVector> meta)
        Description copied from class: Itemset
        Only append the items to a string buffer.
        Overrides:
        appendItemsTo in class Itemset
        Parameters:
        buf - Buffer
        meta - Relation metadata (for labels)
        Returns:
        String buffer for chaining.