Class DenseItemset

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

    public class DenseItemset
    extends Itemset
    APRIORI itemset, dense representation.
    Since:
    0.7.0
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) long[] items
      Items, as a bitmask.
      (package private) int length
      Itemset length.
    • Constructor Summary

      Constructors 
      Constructor Description
      DenseItemset​(long[] items, int length)
      Constructor.
    • Method Summary

      All Methods Instance 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.
      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 hashCode()
      Deprecated.
      Itemsets MUST NOT BE USED IN HASH MAPS.
      int iter()
      Get an iterator over items, usually the position within an array.
      int iterAdvance​(int iter)
      Advance the iterator to the next position.
      int iterDim​(int iter)
      Item at the iterator position.
      boolean iterValid​(int iter)
      Check if the iterator position is valid.
      int length()
      Itemset length.
      • Methods inherited from class java.lang.Object

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

      • items

        long[] items
        Items, as a bitmask.
      • length

        int length
        Itemset length.
    • Constructor Detail

      • DenseItemset

        public DenseItemset​(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​(elki.data.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,
                                                     elki.data.type.VectorFieldTypeInformation<elki.data.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.