Class CustomerFinder

java.lang.Object
trial.gaurav.customer.CustomerFinder
All Implemented Interfaces:
Comparator

public class CustomerFinder extends Object implements Comparator
The `CustomerFinder` class represents a comparator to find a customer with a specific ID in a linked list of customers. It implements the `Comparator` interface to define the find() method.
  • Field Details

    • customerRecords

      private LinkedList<Customer> customerRecords
    • customerId

      private int customerId
  • Constructor Details

    • CustomerFinder

      public CustomerFinder(LinkedList<Customer> cRecords, int id)
      Constructs a new `CustomerFinder` object with the given customer records and customer ID to find.
      Parameters:
      cRecords - The linked list containing the customer records to search.
      id - The customer ID to find.
  • Method Details

    • find

      public boolean find()
      Finds a customer with the specified ID in the linked list of customers.
      Specified by:
      find in interface Comparator
      Returns:
      True if the customer with the specified ID is found, otherwise false.