Hellow
I created a class Packet as followed
public class Packet
{
private long arrivalTime = 0;
private boolean classType = true;
public Packet(long arrivalTime, boolean classType)
{
this.arrivalTime = arrivalTime;
this.classType = classType;
}
In a program I have two methods;
public ArrayList<Packet> simulateArrProces (long loopCount)
{
//DO STUFF
}
public void enqueue(Packet...packets)
{
//DO STUFF
}
The objective is to use the ArrayList returned by the simulateArrProces method as an input for the enqueue method. I thought I could simply give the ArrayList of the first method, but this doesn't seem to work. I tried the following
Arrival arr = new Arrival(arrivalProces);
Queue que = new QueueFCFS();
List l = arr.simulateArrProces(0);
que.enqueue(l.toArray());
It is clear that I should tranform the returned ArrayList of simulateArrProces to something, but I don't find what to. I think this is due to the fact that I chose to use ' Packet ... packet ' , but I did not exactly get what this expression meant.
In short; two questions 1. How to transform the ArrayList returned by simulateArrProces to something I can use in the enqueue method. 2. What is the exact meaning of Packet... packets