Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #30980

Re: super object reference

From Philipp Kraus <philipp.kraus@flashpixx.de>
Newsgroups comp.lang.java.programmer
Subject Re: super object reference
Date 2015-02-01 12:40 +0100
Organization Clausthal University of Technology
Message-ID <mal3bb$20i5$1@ariadne.rz.tu-clausthal.de> (permalink)
References <maj5b2$1fos$1@ariadne.rz.tu-clausthal.de> <mcmurtrie-08783E.22470031012015@news.sonic.net>

Show all headers | View raw


On 2015-02-01 06:47:00 +0000, Kevin McMurtrie said:

> In article <maj5b2$1fos$1@ariadne.rz.tu-clausthal.de>,
>  Philipp Kraus <philipp.kraus@flashpixx.de> wrote:
> 
>> Hello,
>> 
>> I have got this class structure:
>> 
>> clas parent
>> {
>> int value = 5;
>> }
>> 
>> class child extends parent
>> {
>> 
>> public doit()
>> {
>> Object x = this.super; **
>> }
>> 
>> }
>> 
>> I would like to get at ** a reference to the super object of my class,
>> I need a reference to the full object not to particular methods and
>> properties.
>> How can I do this?
>> 
>> Thanks a lot
>> 
>> Phil
> 
> 
> You have two classes but only one instance object.  There is no parent
> instance.
> 
> For proper design, a child class must not contradict the declared API of
> the parent class.  There's refactoring needed if it does.  For example,
> LinkedHashMap does not behave in any way that contradicts the declared
> API of HashMap.
> 
> Maybe you're thinking of inner/outer classes?  An outer class is
> OuterClassName.this.

I see this is a conceptional design error at my code. I use my variable x
within a deeper framewok call and this call runs 
x.getclass.getDecalredFields(), but
this returns in the example case nothing, ebcause my child class does 
not have any fields.

I have got only the x reference but I need all fields of the object, 
also the fields of the child & parent
class and fields of the parent-parent class... I would like to create a 
field list from my object x over all
fields that are exists within the objects. IMHO I must run from my 
object class up to the java.object and collect all fields.
How can I do this?

Phil

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

super object reference Philipp Kraus <philipp.kraus@flashpixx.de> - 2015-01-31 19:02 +0100
  Re: super object reference Jeff Higgins <jeff@invalid.invalid> - 2015-01-31 13:14 -0500
  Re: super object reference Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2015-01-31 22:47 -0800
    Re: super object reference Philipp Kraus <philipp.kraus@flashpixx.de> - 2015-02-01 12:40 +0100
      Re: super object reference Arne Vajhøj <arne@vajhoej.dk> - 2015-02-01 09:13 -0500
        Re: super object reference Arne Vajhøj <arne@vajhoej.dk> - 2015-02-01 09:21 -0500
          Re: super object reference Philipp Kraus <philipp.kraus@flashpixx.de> - 2015-02-01 23:44 +0100
      Re: super object reference Jeff Higgins <jeff@invalid.invalid> - 2015-02-01 09:23 -0500
        Re: super object reference Arne Vajhøj <arne@vajhoej.dk> - 2015-02-01 09:30 -0500
      Re: super object reference Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2015-02-02 19:46 -0800
  Re: super object reference Roedy Green <see_website@mindprod.com.invalid> - 2015-02-05 04:37 -0800

csiph-web