What is Wrong! Re: Implementing FcFs queue with J2SE 5.0
- From: "Veikka" <veikka@xxxxxxxxxx>
- Date: Fri, 30 Dec 2005 22:29:48 +0200
I found a following snippet in Web but it gives warnings.
This should the PriorityQueue I need but there is something wrong....
PriorityQueue <Priority> priorityQueue = new PriorityQueue(10,
new Comparator<Priority>()
{
public int compare(Priority a, Priority b)
{
System.out.println("Comparing Populations");
int populationA = a.getPopulation();
int populationB = b.getPopulation();
if (populationB > populationA)
return 1;
else if (populationB < populationA)
return -1;
else
return 0;
}
}
);
}
"Veikka" <veikka@xxxxxxxxxx> wrote in message
news:dp3rsp$gti$1@xxxxxxxxxxxxxxxxxxxxx
> Hello,
>
> J2SE 5.0 has a lot's of new classes considering multithreading.
> What is the best class to implement queue in FirstComesFirstServed model?
>
> Any sample code arapund?
>
> Cheers!
>
>
.
- Follow-Ups:
- References:
- Implementing FcFs queue with J2SE 5.0
- From: Veikka
- Implementing FcFs queue with J2SE 5.0
- Prev by Date: Re: is Java dynamically or statically typed language or both?
- Next by Date: firework applet with function for lightening the scenery?
- Previous by thread: QRe: Implementing FcFs queue with J2SE 5.0
- Next by thread: Re: What is Wrong! Re: Implementing FcFs queue with J2SE 5.0
- Index(es):