Article View: pl.comp.lang.java
Article #153936Re: Jak to ugryźć jedną metodą -Java/Delphi
From: splatch
Date: Mon, 10 Feb 2014 08:41
Date: Mon, 10 Feb 2014 08:41
78 lines
2643 bytes
2643 bytes
W GWT instanceof może być z powodzeniem emulowany ponieważ JS ma operator typeof.
W dniu piątek, 6 grudnia 2013 19:21:29 UTC+1 użytkownik J-23 napisał:
> W dniu 06.12.2013 18:06, Piotr Rezmer pisze:
>
> > J-23 pisze:
>
> >
>
> >> Piszę w GWT tam nie ma czegoś takiego jak *instanceof*. Gdyby był nie
>
> >> było by problemu :)
>
> >
>
> > A jak to się ma do informacji w wątku:
>
> > https://groups.google.com/forum/#!topic/google-web-toolkit/YQdrrkxOAuA
>
> >
>
> >
>
> Sprawdzałem to wcześniej ale to nie działa. (Może coś ja knocę, już sam
>
> nie wiem)
>
>
>
> Why not just use the native instanceof?
>
>
>
> Button b = new Button();
>
> if (b instanceof Widget) {
>
> /* the code should drop in here */
>
> }
>
>
>
>
>
>
>
>
>
> ale dałem najprostszy kod jaki się dało i nic...
>
>
>
> public boolean add(Widget widget) {
>
> if (widget instanceof Widget) {
>
> System.out.println("WIDGET");
>
> return super.add(widget);
>
> } else {
>
> super.add(widget);
>
> }
>
> return false;
>
> }
>
>
>
> powinien być napis "WIDGET" jesli się zgadza a nie ma
>
>
>
> Pozdrawiam
Technical Details
Message-ID:
<92080223-2266-4da3-b225-d6a479e78bd2@googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin1!goblin.stu.neva.ru!news.glorb.com!uq10no13386153igb.0!news-out.google.com!y18ni6168qap.1!nntp.google.com!f11no15552189qae.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mailReferences:
<l7svf1$tkd$1@mx1.internetia.pl> <l7t07n$ri9$1@node2.news.atman.pl> <l7t5ed$gf9$1@mx1.internetia.pl>Show Full Headers
Complete Article Headers
X-Received: by 10.50.154.73 with SMTP id vm9mr5922911igb.2.1392021670555; Mon, 10 Feb 2014 00:41:10 -0800 (PST) X-Received: by 10.140.42.87 with SMTP id b81mr27273qga.18.1392021670523; Mon, 10 Feb 2014 00:41:10 -0800 (PST) Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin1!goblin.stu.neva.ru!news.glorb.com!uq10no13386153igb.0!news-out.google.com!y18ni6168qap.1!nntp.google.com!f11no15552189qae.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: pl.comp.lang.java Date: Mon, 10 Feb 2014 00:41:10 -0800 (PST) In-Reply-To: <l7t5ed$gf9$1@mx1.internetia.pl> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=89.74.132.12; posting-account=o8vKyAoAAADK_CJyGB7rMI6MyiNxO_fH NNTP-Posting-Host: 89.74.132.12 References: <l7svf1$tkd$1@mx1.internetia.pl> <l7t07n$ri9$1@node2.news.atman.pl> <l7t5ed$gf9$1@mx1.internetia.pl> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <92080223-2266-4da3-b225-d6a479e78bd2@googlegroups.com> Subject: Re: Jak to ugryźć jedną metodą -Java/Delphi From: splatch <lukasz.dywicki@gmail.com> Injection-Date: Mon, 10 Feb 2014 08:41:10 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit