Witam,
szukałem w googlarce i nie znalazłem nic co mogłoby mi pomoc. Więc zapytam tutaj czy jest możliwe zrobienie tablicy składającej się z ArrayBlockingQueue??
Mam taki kodzik:
public class CPN {
public int ilosc_dystrybutorow;
int pojemnosc_kolejki=3;
public boolean [] dysrtybutor;
Samochod auto;
public BlockingQueue<Integer> [] kolejka ;
public CPN (int ilosc_dystrybutorow)
{
this.ilosc_dystrybutorow=ilosc_dystrybutorow;
this.kolejka= new ArrayBlockingQueue<Integer>(3);
this.dysrtybutor = new boolean [ilosc_dystrybutorow];
for(int i=0; i<this.dysrtybutor.length;i++)
{
this.dysrtybutor[i]=true;
kolejka[i]= new ArrayBlockingQueue<Integer>(3);
}
}
Co mnie zastanawia że jak zrobię tak:
BlockingQueue<Integer> kolejka = new ArrayBlockingQueue<Integer>(pojemnosc);
to jest cacy a jak dodam nawias kwadratowy to się burzy :-(
BlockingQueue<Integer> kolejka []= new ArrayBlockingQueue<Integer>(pojemnosc);