Class Item<T extends java.lang.Comparable>

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

    public class Item<T extends java.lang.Comparable>
    extends java.lang.Object
    implements java.lang.Comparable<Item>
    Implementation of an item. This implementation is generic in order to be able to manage any kind of item (string, integer, ...) Copyright Antonio Gomariz PeƱalver 2013 This file is part of the SPMF DATA MINING SOFTWARE (http://www.philippe-fournier-viger.com/spmf). SPMF is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. SPMF is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SPMF. If not, see .
    Author:
    agomariz
    • Constructor Summary

      Constructors 
      Constructor Description
      Item​(T id)
      General constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(Item i)  
      boolean equals​(java.lang.Object object)
      Check if this item is equal to another (if their identifier also are).
      T getId()
      It gets the content of the item.
      int hashCode()  
      java.lang.String toString()
      Get the string representation of this item
      • Methods inherited from class java.lang.Object

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

      • Item

        public Item​(T id)
        General constructor.
        Parameters:
        id - Content of the item.
    • Method Detail

      • getId

        public T getId()
        It gets the content of the item.
        Returns:
        the content (T)
      • toString

        public java.lang.String toString()
        Get the string representation of this item
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string representation
      • equals

        public boolean equals​(java.lang.Object object)
        Check if this item is equal to another (if their identifier also are).
        Overrides:
        equals in class java.lang.Object
        Parameters:
        object - another item
        Returns:
        true if the same, otherwise false
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • compareTo

        public int compareTo​(Item i)
        Specified by:
        compareTo in interface java.lang.Comparable<T extends java.lang.Comparable>