Re: java.util.List
Hi ben,
If you are using a version of GWT < 2.0 this error appears because the standard GWT List interface
doesn't have the subList method. You can either remove the @Override annotation from that method, or
extend AbstractList instead of implementing List directly (generally considered a better option
anyways).
You could also upgrade to GWT 2.0-rc, which has the subList method included in the interface definition.
Hope that helps.
//Jason
ben fenster wrote:
> import java.util.Collection;
> import java.util.Iterator;
> import java.util.List;
> import java.util.ListIterator;
>
> public class bla implements List<String> {
>
> @Override
> public boolean add(String e) {
> // TODO Auto-generated method stub
> return false;
> }
>
> @Override
> public void add(int index, String element) {
> // TODO Auto-generated method stub
>
> }
>
> @Override
> public boolean addAll(Collection<? extends String> c) {
> // TODO Auto-generated method stub
> return false;
> }
>
> @Override
> public boolean addAll(int index, Collection<? extends String> c) {
> // TODO Auto-generated method stub
> return false;
> }
>
> @Override
> public void clear() {
> // TODO Auto-generated method stub
>
> }
>
> @Override
> public boolean contains(Object o) {
> // TODO Auto-generated method stub
> return false;
> }
>
> @Override
> public boolean containsAll(Collection<?> c) {
> // TODO Auto-generated method stub
> return false;
> }
>
> @Override
> public String get(int index) {
> // TODO Auto-generated method stub
> return null;
> }
>
> @Override
> public int indexOf(Object o) {
> // TODO Auto-generated method stub
> return 0;
> }
>
> @Override
> public boolean isEmpty() {
> // TODO Auto-generated method stub
> return false;
> }
>
> @Override
> public Iterator<String> iterator() {
> // TODO Auto-generated method stub
> return null;
> }
>
> @Override
> public int lastIndexOf(Object o) {
> // TODO Auto-generated method stub
> return 0;
> }
>
> @Override
> public ListIterator<String> listIterator() {
> // TODO Auto-generated method stub
> return null;
> }
>
> @Override
> public ListIterator<String> listIterator(int index) {
> // TODO Auto-generated method stub
> return null;
> }
>
> @Override
> public boolean remove(Object o) {
> // TODO Auto-generated method stub
> return false;
> }
>
> @Override
> public String remove(int index) {
> // TODO Auto-generated method stub
> return null;
> }
>
> @Override
> public boolean removeAll(Collection<?> c) {
> // TODO Auto-generated method stub
> return false;
> }
>
> @Override
> public boolean retainAll(Collection<?> c) {
> // TODO Auto-generated method stub
> return false;
> }
>
> @Override
> public String set(int index, String element) {
> // TODO Auto-generated method stub
> return null;
> }
>
> @Override
> public int size() {
> // TODO Auto-generated method stub
> return 0;
> }
>
> @Override
> public List<String> subList(int fromIndex, int toIndex) {
>
> return null;
> }
>
> @Override
> public Object[] toArray() {
> // TODO Auto-generated method stub
> return null;
> }
>
> @Override
> public <T> T[] toArray(T[] a) {
> // TODO Auto-generated method stub
> return null;
> }
>
> }
>
>
> i am did the exact same thing and got
>
> [ERROR] Line 131: The method subList(int, int) of type bla must
> override or implement a supertype method
>
>
>
> On 23 נובמבר, 16:07, Paul MERLIN <eskato...@gmail.com> wrote:
>> Le lundi 23 novembre 2009 15:05:18, ben fenster a écrit :
>>
>>> im sorry but i was under some presure i have a close deadline and
>>> thats pretty much the only problem idid you create an anonymous class
>>> or a class that implements the list
>> public class Test implements List<String> { ... }
>
> --
>
> You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=.
>
>
>
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home