Ok, So the problem I am having is with the LineUps class in the getTime method.

What I am trying to do in the getTime method is to get the overall time of the whole Queue list.

The Queue's are really LinkLists of type Person.
In Person, there are two arguments, name and time(int)

Iterator<Person> qTotal = q.iterator();
    int temp= 0;
    
    while(qTotal.hasNext()){
        /*personObj has two arguments(name,time)
         * is it possible to extract one of those arguments and add it to get
         * total Time of Queue?
         */
        qTotal.next();}

At this point, the qTotal.next() is looking at the objects in the q2 (because the first time the getTime(q1) will be equal to (q2) so it goes to else. (look below)

if (getTime(q1) < getTime(q2)){
            q1.add(p);    
        
        }
        else
            q2.add(p);
    }

qTotal.next() - looks at the object inside the LinkedList.
I'm wondering if there's a way to read an argument of type Person?

Here's the code just to understand what's going on.

import java.util.*;

public class LineUpApplication {

    
    
    public static void main(String[] args){
        
        Scanner input= new Scanner(System.in);
        String option="";
        int custTime=0;
        
        //Updates the Queue's status at first
        
        LineUps.update();
        
        do{
            
            System.out.print("Who's next(name), [n]o one, [q]uit: ");
    
            option = input.nextLine();
    
            
        if(option == "n"){
            LineUps.update();
        }
        else{
            
            //if User inputs a name, it will be referenced by "option"
            System.out.print("How many minutes will " + option + " take?");
            //custTime on how long it takes to serve him
            custTime = input.nextInt();
            
            //Passes argument to person class and referenced in personObj
            Person personObj= new Person(option,custTime);
            
            //creates new LineUps object to pass Person Obj 
            new LineUps(personObj) ;
            //clears Stream
            input.nextLine();
            
        }
            
            
        }while(option != "q");
        
    }

    
}
import java.util.*;

public class LineUps{
    private static Queue<Person> q1 = new LinkedList<Person>();
    private static Queue<Person> q2 = new LinkedList<Person>();
    private int qTotalTime = 0;
    
    //receives personObj and sends to addPerson Method
    public LineUps(Person s)
    {
        addPerson(s);
    }
    
    public int getTime( Queue<Person> q){
    Iterator<Person> qTotal = q.iterator();
    int temp= 0;
    
    while(qTotal.hasNext()){
        /*personObj has two arguments(name,time)
         * is it possible to extract one of those arguments and add it to get
         * total Time of Queue?
         */
        qTotal.next();}
    
    
    
    return temp;
        
        
    }
    
    //Compares if getTime of q1<q2 is so, add in q1
    public void addPerson(Person p){
        
        if (getTime(q1) < getTime(q2)){
            q1.add(p);    
        
        }
        else
            q2.add(p);
    }
    
    public String toString(){
        
        return String.format("Queue 1\n   Total time: %s\n   Currently serving:%s",q1 ,q2);
    }
    
    public static void update(){
        
    }


}
import java.util.*;

public class Person {
    private String name= "";
    private int time = 0;
    
    public Person(String n, int t)
    {
        this.name=n;
        this.time=t;
    }
    
    public String getName(){
        return this.name;
    }
    
    public void reduceTime(int time)
    {
        this.time--;
    }
}

Given a Person object you can get its values by using its accessor methods getName() and getTime() - although the second still needs to be written.
You will also probably find the for/each loop format easier to work with: eg

int time = 0;
for (Person p : q) {
   String name =  p.getName();
   time += p.getTime(); // or whatever
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.