Re: Why doesn't ArrayDeque implement the List interface?
- From: "Giovanni Azua" <bravegag@xxxxxxxxxxx>
- Date: Tue, 10 Mar 2009 16:35:19 +0100
"Mike Schilling" <mscottschilling@xxxxxxxxxxx> wrote
No, the get method would be trivial to implement:No, I was not refering to this access method but to a binary search method.
public T get(int i)
{
if ( i < 0 || i >= size)
throw new IllegalIndexException();
return members[(firstIndex + i) % size];
}
Even more trivial would be just to myDeque.getArray() and get the i-th
element.
regards,
Giovanni
.
- Follow-Ups:
- Re: Why doesn't ArrayDeque implement the List interface?
- From: Daniel Pitts
- Re: Why doesn't ArrayDeque implement the List interface?
- From: Patricia Shanahan
- Re: Why doesn't ArrayDeque implement the List interface?
- From: Mike Schilling
- Re: Why doesn't ArrayDeque implement the List interface?
- References:
- Why doesn't ArrayDeque implement the List interface?
- From: Joe Gottman
- Re: Why doesn't ArrayDeque implement the List interface?
- From: Giovanni Azua
- Re: Why doesn't ArrayDeque implement the List interface?
- From: Mike Schilling
- Re: Why doesn't ArrayDeque implement the List interface?
- From: Giovanni Azua
- Re: Why doesn't ArrayDeque implement the List interface?
- From: Joe Gottman
- Re: Why doesn't ArrayDeque implement the List interface?
- From: Giovanni Azua
- Re: Why doesn't ArrayDeque implement the List interface?
- From: Mike Schilling
- Why doesn't ArrayDeque implement the List interface?
- Prev by Date: Re: ONE ARRAYLIST IN MANY CLASSES QUESTION
- Next by Date: Re: ONE ARRAYLIST IN MANY CLASSES QUESTION
- Previous by thread: Re: Why doesn't ArrayDeque implement the List interface?
- Next by thread: Re: Why doesn't ArrayDeque implement the List interface?
- Index(es):