Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
java.util.List
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  19 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
ben fenster  
View profile  
 More options Nov 23 2009, 6:29 am
From: ben fenster <fenster....@gmail.com>
Date: Mon, 23 Nov 2009 03:29:10 -0800 (PST)
Local: Mon, Nov 23 2009 6:29 am
Subject: java.util.List
why cant i make a sub class for java.util.List
every time i do i get compile errors

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lothar Kimmeringer  
View profile  
 More options Nov 23 2009, 7:10 am
From: Lothar Kimmeringer <j...@kimmeringer.de>
Date: Mon, 23 Nov 2009 13:10:43 +0100
Local: Mon, Nov 23 2009 7:10 am
Subject: Re: java.util.List
ben fenster schrieb:

> why cant i make a sub class for java.util.List
> every time i do i get compile errors

Reading the error-message should help but independent
from that, the the answer is: It's an interface, baby.

Regards, Lothar


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ben fenster  
View profile  
 More options Nov 23 2009, 7:15 am
From: ben fenster <fenster....@gmail.com>
Date: Mon, 23 Nov 2009 04:15:39 -0800 (PST)
Local: Mon, Nov 23 2009 7:15 am
Subject: Re: java.util.List
i know !!!
but when i try to implement it  and the compile it  i get a general
error saying  my main module cant be loaded
so baby ! show me any class you create that inherites from List and of
course compile it !

On 23 נובמבר, 14:10, Lothar Kimmeringer <j...@kimmeringer.de> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lothar Kimmeringer  
View profile  
 More options Nov 23 2009, 7:49 am
From: Lothar Kimmeringer <j...@kimmeringer.de>
Date: Mon, 23 Nov 2009 13:49:44 +0100
Local: Mon, Nov 23 2009 7:49 am
Subject: Re: java.util.List
ben fenster schrieb:

> i know !!!

So why do you try to create a subclass of an interface?

> but when i try to implement it

Implement != subclass.

>  and the compile it  i get a general
> error saying  my main module cant be loaded

You try to compile it for deployment or are we talking about
the hosted mode? if the latter, what's the error-message
showing up in the details-pane if you click on the main-entry

> so baby ! show me any class you create that inherites from List and of
> course compile it !

I come to the impression that you think that I'm some kind
of support-guy you have the right to use for free. That's
not the case, so please work on your way of asking questions:

 - Don't use exclamation and question marks excessively
 - Give as much information as possible to be able to
   reproduce or at least understand your problem
 - Don't forget: It's you, who want to be helped, so ask
   in a way motivating as much people as possible to
   help you.

I never needed to create a new implementation of java.util.List
but alway use ArrayList for the client side of the application.
Most likely java.util.List is not part of the client JRE that
is converted to Javascript leading to the error (but that's just
a guess, the error-message in the details-pane should clearify
that).

Regards, Lothar


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ben fenster  
View profile  
 More options Nov 23 2009, 8:16 am
From: ben fenster <fenster....@gmail.com>
Date: Mon, 23 Nov 2009 05:16:19 -0800 (PST)
Local: Mon, Nov 23 2009 8:16 am
Subject: Re: java.util.List
i dont think anyone is working for me i just found what seems to be a
very big bug in gwt since for some reason its not possible to
implement the list interface and i belive it is a potential problem
for alot of people other then me

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

public class SmartQueue<T> implements List<T>{

        protected ArrayList<T> m_items;
        protected int m_Limit=-1;
        /**
         * constructor
         * @param lim = limit of queue to set
         */
        public SmartQueue()
        {

        }
        public SmartQueue(int lim)
        {
                m_Limit=lim;
        }

        /**
         * Enqueue a member into head of queue
         * @param val-val to insert
         */
        public T Enqueue(T val)
        {
                m_items.add(0, val);
                return (m_Limit>0 && m_items.size()>m_Limit) ? Dequeue() : null;
        }
        /**
         * Enqueue a member into a chosen pos at the queue
         * @param val-val to insert
         */
        public T Enqueue(T val,int at)
        {
                m_items.add(at, val);
                return (m_Limit>0 && m_items.size()>m_Limit) ? Dequeue() : null;
        }

        /**
         * Enqueue a member into head of queue
         * @param val-val to insert
         */
        public Collection<T> Enqueue(Collection<? extends T>  coll)
        {
                m_items.addAll(0, coll);
                if(m_Limit>0 && m_items.size()>m_Limit)
                {
                        return Dequeue(m_items.size() - m_Limit);
                }
                return null;
        }
        /**
         * Enqueue a member into head of queue
         * @param val-val to insert
         */
        public Collection<T> Enqueue(Collection<? extends T>  coll,int at)
        {
                m_items.addAll(at, coll);
                if(m_Limit>0 && m_items.size()>m_Limit)
                {
                        return Dequeue(m_items.size() - m_Limit);
                }
                return null;
        }

        /**
         * Dequeue a member from tail end of queue
         * @return T - the member of the queue that was removed
         */
        public T Dequeue()
        {
                int end  = m_items.size()-1;
                T res = m_items.get(end);
                m_items.remove(end);
                return res;
        }
        /**
         * Dequeue a member list from tail end of queue
         * @return T - the member of the queue that was removed
         */
        public Collection<T> Dequeue(int count)
        {
                Collection<T>res = new ArrayList<T>();
                for (int i = m_items.size()-count; i < m_items.size(); i++) {
                        res.add(get(i));
                        m_items.remove(i);
                }
                return res;
        }

        /**
         * get the maximum capacity of the queue
         * @return maximum capacity of the queue
         */
        public int GetLimit()
        {
                return m_Limit;
        }
        /**
         * sets maximum capacity of the queue
         * @param lim-the limit of the queue to set
         */
        public void SetLimit(int lim)
        {
                m_Limit=lim;
        }

        public void SetItemPosition(int from,int to)
        {
                if(from >0 && from < m_items.size()&& to >0 && to < m_items.size())
                {
                        Collections.swap(m_items, from, to);
                }
        }
        private  Collection<T> GetAndRemoveOverLimit()
        {
                if(m_Limit>0 && m_items.size()>m_Limit)
                {
                        return Dequeue(m_items.size() - m_Limit);
                }
                return null;
        }
        private  void RemoveOverLimit()
        {
                if(m_Limit>0 && m_items.size()>m_Limit)
                {
                        Dequeue(m_items.size() - m_Limit);
                }
        }
        @Override
        public boolean add(T e) {
                boolean res = m_items.add(e);
                RemoveOverLimit();
                return res;
        }
        @Override
        public void add(int index, T element) {
                RemoveOverLimit();
                m_items.add(index,element);
        }
        @Override
        public boolean addAll(Collection<? extends T> c) {
                boolean res =addAll(c);
                RemoveOverLimit();
                return res;
        }
        @Override
        public boolean addAll(int index, Collection<? extends T> c) {
                boolean res =addAll(index,c);
                RemoveOverLimit();
                return res;
        }
        @Override
        public void clear() {
                m_items.clear();

        }
        @Override
        public boolean contains(Object o) {

                return m_items.contains(o);
        }
        @Override
        public boolean containsAll(Collection<?> c) {
                // TODO Auto-generated method stub
                return m_items.containsAll(c);
        }
        @Override
        public T get(int index) {
                // TODO Auto-generated method stub
                return m_items.get(index);
        }
        @Override
        public int indexOf(Object o) {
                // TODO Auto-generated method stub
                return m_items.indexOf(o);
        }
        @Override
        public boolean isEmpty() {
                // TODO Auto-generated method stub
                return m_items.isEmpty();
        }
        @Override
        public Iterator<T> iterator() {

                return m_items.iterator();
        }
        @Override
        public int lastIndexOf(Object o) {

                return m_items.lastIndexOf(o);
        }
        @Override
        public ListIterator<T> listIterator() {
                // TODO Auto-generated method stub
                return m_items.listIterator();
        }
        @Override
        public ListIterator<T> listIterator(int index) {
                // TODO Auto-generated method stub
                return m_items.listIterator(index);
        }
        @Override
        public boolean remove(Object o) {
                return m_items.remove(o);
        }
        @Override
        public T remove(int index) {
                // TODO Auto-generated method stub
                return m_items.get(index);
        }
        @Override
        public boolean removeAll(Collection<?> c) {
                // TODO Auto-generated method stub
                return m_items.removeAll(c);
        }
        @Override
        public boolean retainAll(Collection<?> c) {
                // TODO Auto-generated method stub
                return m_items.retainAll(c);
        }
        @Override
        public T set(int index, T element) {
                // TODO Auto-generated method stub
                return m_items.set(index, element);
        }
        @Override
        public int size() {
                // TODO Auto-generated method stub
                return m_items.size();
        }
        @Override
        public List<T> subList(int fromIndex, int toIndex) {

                return m_items.subList(fromIndex, toIndex);
        }
        @Override
        public Object[] toArray() {
                return m_items.toArray();
        }
        @Override
        public <T> T[] toArray(T[] a) {
                // TODO Auto-generated method stub
                return m_items.toArray(a);
        }

}

On 23 נובמבר, 14:49, Lothar Kimmeringer <j...@kimmeringer.de> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ben fenster  
View profile  
 More options Nov 23 2009, 8:17 am
From: ben fenster <fenster....@gmail.com>
Date: Mon, 23 Nov 2009 05:17:49 -0800 (PST)
Local: Mon, Nov 23 2009 8:17 am
Subject: Re: java.util.List
by the way the error is
[ERROR] Failure to load module 'vzooo'

On 23 נובמבר, 14:49, Lothar Kimmeringer <j...@kimmeringer.de> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul MERLIN  
View profile  
 More options Nov 23 2009, 8:50 am
From: Paul MERLIN <eskato...@gmail.com>
Date: Mon, 23 Nov 2009 14:50:47 +0100
Local: Mon, Nov 23 2009 8:50 am
Subject: Re: java.util.List
Le lundi 23 novembre 2009 12:29:10, ben fenster a écrit :

> why cant i make a sub class for java.util.List
> every time i do i get compile errors

Documentation is clear :

  "Google Web Toolkit includes a library that emulates a subset of the Java runtime library. The list
    below shows the set of JRE packages, types and methods that GWT can translate automatically.
   Note that in some cases, only a subset of methods is supported for a given type."

    http://code.google.com/intl/fr/webtoolkit/doc/1.6/RefJreEmulation.html

java.util.List is in the emulated list but you'd better check if all methods are supported

I tried to write an empty implementation (no time to waste) of List<String>, and GWTCompiler seems to be happy with it,
so I'd suspect an error in your code (using something else that is not supported by gwt jre emulation).

By the way, you're asking insistingly without giving any valuable information for us to help you ... IMHO that's
impolite.

/Paul


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nathan Wells  
View profile  
 More options Nov 23 2009, 8:53 am
From: Nathan Wells <nwwe...@gmail.com>
Date: Mon, 23 Nov 2009 05:53:21 -0800 (PST)
Local: Mon, Nov 23 2009 8:53 am
Subject: Re: java.util.List
1) Is your class in a "client" package? by that, I mean does the
parent package have a *.gwt.xml file, and does it declare the
SmartQueue package as a source package?

If you haven't already, you might want to read this:

http://code.google.com/webtoolkit/doc/1.6/DevGuideCodingBasics.html

along with the rest of the Developer Guide. and probably the FAQ...
and the Reference Guide... and watch a few Google I/O videos.

On Nov 23, 6:17 am, ben fenster <fenster....@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ben fenster  
View profile  
 More options Nov 23 2009, 9:02 am
From: ben fenster <fenster....@gmail.com>
Date: Mon, 23 Nov 2009 06:02:14 -0800 (PST)
Local: Mon, Nov 23 2009 9:02 am
Subject: Re: java.util.List
yes its in a client package and i also tried to create an empty
implementation of INTEGER and it didnt work
did you try to run the module with the  empty List<String> in hosted
mode

On 23 נובמבר, 15:53, Nathan Wells <nwwe...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ben fenster  
View profile  
 More options Nov 23 2009, 9:05 am
From: ben fenster <fenster....@gmail.com>
Date: Mon, 23 Nov 2009 06:05:18 -0800 (PST)
Local: Mon, Nov 23 2009 9:05 am
Subject: Re: java.util.List
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

On 23 נובמבר, 15:50, Paul MERLIN <eskato...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul MERLIN  
View profile  
 More options Nov 23 2009, 9:06 am
From: Paul MERLIN <eskato...@gmail.com>
Date: Mon, 23 Nov 2009 15:06:06 +0100
Local: Mon, Nov 23 2009 9:06 am
Subject: Re: java.util.List
Le lundi 23 novembre 2009 15:02:14, ben fenster a écrit :
> did you try to run the module with the  empty List<String> in hosted
> mode

Nope.
Did you try to get a more valuable error message ?

/Paul


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul MERLIN  
View profile  
 More options Nov 23 2009, 9:07 am
From: Paul MERLIN <eskato...@gmail.com>
Date: Mon, 23 Nov 2009 15:07:41 +0100
Local: Mon, Nov 23 2009 9:07 am
Subject: Re: java.util.List
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> { ... }

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ben fenster  
View profile  
 More options Nov 23 2009, 9:44 am
From: ben fenster <fenster....@gmail.com>
Date: Mon, 23 Nov 2009 06:44:20 -0800 (PST)
Local: Mon, Nov 23 2009 9:44 am
Subject: Re: java.util.List

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:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason Morris  
View profile  
 More options Nov 23 2009, 9:52 am
From: Jason Morris <lem...@gmail.com>
Date: Mon, 23 Nov 2009 16:52:14 +0200
Local: Mon, Nov 23 2009 9:52 am
Subject: 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


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ben fenster  
View profile  
 More options Nov 23 2009, 10:02 am
From: ben fenster <fenster....@gmail.com>
Date: Mon, 23 Nov 2009 07:02:24 -0800 (PST)
Local: Mon, Nov 23 2009 10:02 am
Subject: Re: java.util.List
no i am using gwt 1.7
i cant understand the error because i do  implement the method
moreover the method was auto filled by eclipse

On 23 נובמבר, 16:52, Jason Morris <lem...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ben fenster  
View profile  
 More options Nov 23 2009, 10:11 am
From: ben fenster <fenster....@gmail.com>
Date: Mon, 23 Nov 2009 07:11:32 -0800 (PST)
Local: Mon, Nov 23 2009 10:11 am
Subject: Re: java.util.List
thanks i removed the override and it worked can you please tell me why
 did act like that since the eclipse filled out the implementation
acording to the interface and if the method is not suppored  how did
it got into the imlementation in the first place

On 23 נובמבר, 16:52, Jason Morris <lem...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ben fenster  
View profile  
 More options Nov 23 2009, 11:25 am
From: ben fenster <fenster....@gmail.com>
Date: Mon, 23 Nov 2009 08:25:51 -0800 (PST)
Local: Mon, Nov 23 2009 11:25 am
Subject: Re: java.util.List
thanks i removed the override and it worked can you please tell me why
 did act like that since the eclipse filled out the implementation
acording to the interface and if the method is not suppored  how did
it got into the imlementation in the first place

On 23 נובמבר, 16:52, Jason Morris <lem...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason Morris  
View profile  
 More options Nov 24 2009, 12:43 am
From: Jason Morris <lem...@gmail.com>
Date: Tue, 24 Nov 2009 07:43:49 +0200
Local: Tues, Nov 24 2009 12:43 am
Subject: Re: java.util.List
Eclipse fills in methods based on the JDK installed, not the GWT emulated JRE. GWT's implementation
of the JRE sits in the package com.google.gwt.emul.java, not java.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ben fenster  
View profile  
 More options Nov 24 2009, 3:32 am
From: ben fenster <fenster....@gmail.com>
Date: Tue, 24 Nov 2009 00:32:13 -0800 (PST)
Local: Tues, Nov 24 2009 3:32 am
Subject: Re: java.util.List
10x u saved me :)

On 24 נובמבר, 07:43, Jason Morris <lem...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google