•      Sign In
• Create Account

### #ActualTheChubu

Posted 16 December 2012 - 04:36 PM

I don't quite understand the question.

fillList adds a single ticket you pass to it?

What it would be the outer class and the inner class? Ticket and concert? Ticket doesn't needs to pass to concert anything (i think).

Anyway, you have two options. Either you create your ticket object somewhere with the correct data, and pass it to fillList so it can add it.

getDataAddTicket ()
{
ask the user the data.
Ticket tmpTicket = new Ticket(data);
this.fillList(tmpTicket);
}

fillList (Ticket tmpTicket) //There you're passing a reference to a Ticket.
{
this.tickets.add(tmpTicket);
}

Or fillList is called without parameters, but you fetch the data inside that method and create the ticket right there.
fillList ()
{
get all data.
Ticket tmpTicket = new Ticket(data);
this.tickets.add(tmpTicket);
}

so when i'm calling the fillList() method in the test class what would i use as parameters? the parameters used in the Ticket constructor? kinda confused

That depends. If you don't have the ticket data at that time, you'd need to create a ticket with the default constructor and set its data up inside fillList. If you do have the data, you could use the appropiate ticket's constructor.
From test:
//If you don't have the data at that time you pass a new ticket with con[index] as the enclosing object.
//Then you ask for the data inside fillList method.
con[index].fillList(con[index].new Ticket());

//If you have the data at that time and you can provide it to ticket's constructor,
//that way fillList only has to add the ticket to the list
//without asking for more information.
con[index].fillList(con[index].new Ticket(tmpDouble, tmpBool));

There! I hope I got it right

### #10TheChubu

Posted 16 December 2012 - 04:35 PM

I don't quite understand the question.

fillList adds a single ticket you pass to it?

What it would be the outer class and the inner class? Ticket and concert? Ticket doesn't needs to pass to concert anything (i think).

Anyway, you have two options. Either you create your ticket object somewhere with the correct data, and pass it to fillList so it can add it.

getDataAddTicket ()
{
ask the user the data.
Ticket tmpTicket = new Ticket(data);
this.fillList(tmpTicket);
}

fillList (Ticket tmpTicket) //There you're passing a reference to a Ticket.
{
this.tickets.add(tmpTicket);
}

Or fillList is called without parameters, but you fetch the data inside that method and create the ticket right there.
fillList ()
{
get all data.
Ticket tmpTicket = new Ticket(data);
this.tickets.add(tmpTicket);
}

so when i'm calling the fillList() method in the test class what would i use as parameters? the parameters used in the Ticket constructor? kinda confused

That depends. If you don't have the ticket data at that time, you'd need to create a ticket with the default constructor and set its data up inside fillList. If you do have the data, you could use the appropiate ticket's constructor.
From test:
con[index].fillList(con[index].new Ticket()); //If you don't have the data at that time you pass a new ticket with con[index] as the enclosing object. Then you ask for the data //inside fillList method.
con[index].fillList(con[index].new Ticket(tmpDouble, tmpBool)); //If you have the data at that time and you can provide it to ticket's constructor, that way fillList only has to //add the ticket to the list without asking for more information.


### #9TheChubu

Posted 16 December 2012 - 04:22 PM

I don't quite understand the question.

fillList adds a single ticket you pass to it?

What it would be the outer class and the inner class? Ticket and concert? Ticket doesn't needs to pass to concert anything (i think).

Anyway, you have two options. Either you create your ticket object somewhere with the correct data, and pass it to fillList so it can add it.

getDataAddTicket ()
{
ask the user the data.
Ticket tmpTicket = new Ticket(data);
this.fillList(tmpTicket);
}

fillList (Ticket tmpTicket) //There you're passing a reference to a Ticket.
{
this.tickets.add(tmpTicket);
}

Or fillList is called without parameters, but you fetch the data inside that method and create the ticket right there.
fillList ()
{
get all data.
Ticket tmpTicket = new Ticket(data);
this.tickets.add(tmpTicket);
}

### #8TheChubu

Posted 16 December 2012 - 04:22 PM

I don't quite understand the question.

fillList adds a single ticket you pass to it?

What it would be the outer class and the inner class? Ticket and concert? Ticket doesn't needs to to pass to concert anything (i think).

Anyway, you have two options. Either you create your ticket object somewhere with the correct data, and pass it to fillList so it can add it.

getDataAddTicket ()
{
ask the user the data.
Ticket tmpTicket = new Ticket(data);
this.fillList(tmpTicket);
}

fillList (Ticket tmpTicket) //There you're passing a reference to a Ticket.
{
this.tickets.add(tmpTicket);
}

Or fillList is called without parameters, but you fetch the data inside that method and create the ticket right there.
fillList ()
{
get all data.
Ticket tmpTicket = new Ticket(data);
this.tickets.add(tmpTicket);
}

### #7TheChubu

Posted 16 December 2012 - 04:19 PM

I don't quite understand the question.

fillList adds a single ticket you pass to it?

What it would be the outer class and the inner class? Ticket and concert? Ticket doesn't needs to to pass to concert anything (i think).

Anyway, you have two options. Either you create your ticket object somewhere with the correct data, and pass it to fillList so it can add it.

getDataAddTicket ()
{
ask the user the data.
Ticket tmpTicket = new Ticket(data);
this.fillList(tmpTicket);
}

fillList (Ticket tmpTicket) //There you're passing a reference to a Ticket.
{
this.tickets.add(tmpTicket);
}

Or fillList is called without parameters, but you fetch the data inside that method and create the ticket right there.
fillList ()
{
get all data.
Ticket tmpTicket = new Ticket(data);
}

### #6TheChubu

Posted 16 December 2012 - 04:18 PM

I don't quite understand the question.

fillList adds a single ticket you pass to it?

What it would be the outer class and the inner class? Ticket and concert? Ticket doesn't needs to to pass to concert anything.

Anyway, you have two options. Either you create your ticket object somewhere with the correct data, and pass it to fillList so it can add it.

getDataAddTicket ()
{
ask the user the data.
Ticket tmpTicket = new Ticket(data);
this.fillList(tmpTicket);
}

fillList (Ticket tmpTicket) //There you're passing a reference to a Ticket.
{
this.tickets.add(tmpTicket);
}

Or fillList is called without parameters, but you fetch the data inside that method and create the ticket right there.
fillList ()
{
get all data.
Ticket tmpTicket = new Ticket(data);
}

PARTNERS