Class OneItemset

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

    public class OneItemset
    extends Itemset
    Frequent itemset with one element.
    Since:
    0.7.0
    Author:
    Erich Schubert
    • Field Detail

      • item

        int item
        Trivial item.
    • Constructor Detail

      • OneItemset

        public OneItemset​(int item)
        Constructor of 1-itemset.
        Parameters:
        item - Item
      • OneItemset

        public OneItemset​(int item,
                          int support)
        Constructor with initial support.
        Parameters:
        item - Item
        support - Support
    • 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.