Class Bicycle

  • Direct Known Subclasses:
    ElectricalBicycle, MechanicalBicycle

    public abstract class Bicycle
    extends java.lang.Object
    The (abstract) Bicycle class : It defines a bicycle on the application
    • Constructor Summary

      Constructors 
      Constructor Description
      Bicycle()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)
      equals method for the Bicycle class
      int getId()
      getter for id
      static int getNumberOfBicycles()
      getter for numberOfBicycles
      int hashCode()
      hashCode method for the Bicycle class
      java.lang.String toString()
      the toString method for the Bicycle class with some representation for the class
      • Methods inherited from class java.lang.Object

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

      • Bicycle

        public Bicycle()
    • Method Detail

      • getId

        public int getId()
        getter for id
        Returns:
        id
      • getNumberOfBicycles

        public static int getNumberOfBicycles()
        getter for numberOfBicycles
        Returns:
        numberOfBicycles
      • toString

        public java.lang.String toString()
        the toString method for the Bicycle class with some representation for the class
        Overrides:
        toString in class java.lang.Object
        Returns:
        a message that represents the class
      • equals

        public boolean equals​(java.lang.Object o)
        equals method for the Bicycle class
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - an object
        Returns:
        true, if the two objects are "equal"; false, otherwise
      • hashCode

        public int hashCode()
        hashCode method for the Bicycle class
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hash(id)