Package OOPJ_MP

Class Node<Type>

java.lang.Object
OOPJ_MP.Node<Type>
Type Parameters:
Type - This class is dynamic so you can Store any type of data in this class . and you have to provide that class type in this parameter Type

public class Node<Type> extends Object
This is a Node class that Used to Add data into OOPJ_MP.LinkedList class it is like Container that carry your any type of data
Since:
2024
Author:
Mohit Makwana
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    This is Default constructor
    Node(Type value)
    This constructor use to make a node with given Value Note : the Value should be as type that you specify
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    This method returns the reference of next Node
    This method gives the value that you store in this Node
    boolean
    This method returns true if current Node has next Node reference
    void
    setValue(Type value)
    This method Set value to current Node so you can change the value of the Node at any time
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Node

      public Node(Type value)
      This constructor use to make a node with given Value Note : the Value should be as type that you specify
      Parameters:
      value - Value that you want to store in the Node
    • Node

      public Node()
      This is Default constructor
  • Method Details

    • hasNext

      public boolean hasNext()
      This method returns true if current Node has next Node reference
      Returns:
      true if Node have reference of Next Node
    • getNext

      public Node getNext()
      This method returns the reference of next Node
      Returns:
      Node that is next to current Node
    • getValue

      public Type getValue()
      This method gives the value that you store in this Node
      Returns:
      Value that stores in this Node
    • setValue

      public void setValue(Type value)
      This method Set value to current Node so you can change the value of the Node at any time
      Parameters:
      value - This is the value that you want to store in this Node
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object