Class Occurence


  • public class Occurence
    extends java.lang.Object
    This class represent a set of occurences in a sequence, as defined in the TRuleGrowth algorithm. Note that unlike the RuleGrowth algorithms, all occurences in a sequence are kept instead of just the first and last one. This is the main difference between the two implementations of "Occurence".
    Author:
    Philippe Fournier-Viger
    See Also:
    AlgoTRuleGrowth, Sequence, SequenceDatabase
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.List<java.lang.Short> occurences
      a list of occurences (position in this sequence)
      int sequenceID
      the sequenceID (a.k.a transaction id)
    • Constructor Summary

      Constructors 
      Constructor Description
      Occurence​(int sequenceID)
      Contructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(short occurence)
      Add an occurence.
      boolean equals​(java.lang.Object obj)
      Check if a given Occurence is the same as this one (used to store occurence in Collections).
      short getFirst()
      Get the first occurence in this sequence.
      short getLast()
      Get the last occurence in this sequence.
      int hashCode()
      Get the hashcode.
      • Methods inherited from class java.lang.Object

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

      • sequenceID

        public int sequenceID
        the sequenceID (a.k.a transaction id)
      • occurences

        public java.util.List<java.lang.Short> occurences
        a list of occurences (position in this sequence)
    • Constructor Detail

      • Occurence

        public Occurence​(int sequenceID)
        Contructor
        Parameters:
        sequenceID - a sequence ID
    • Method Detail

      • add

        public void add​(short occurence)
        Add an occurence.
        Parameters:
        occurence - the position of an itemset
      • getFirst

        public short getFirst()
        Get the first occurence in this sequence.
        Returns:
        the position of an itemset
      • getLast

        public short getLast()
        Get the last occurence in this sequence.
        Returns:
        the position of an itemset
      • equals

        public boolean equals​(java.lang.Object obj)
        Check if a given Occurence is the same as this one (used to store occurence in Collections).
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - another Occurence
        Returns:
        true if they both have the same sequence ID.
      • hashCode

        public int hashCode()
        Get the hashcode.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        an hashcode