Setting The Enclosing Class Instance Using Reflection

Hi,
I'm implementing some customized deep clone mechanism.
When I have an instance of an inner class (or anonymous inner class), I need to create a clone, that refer to a clone of the enclosing class (and not the original inner class).
Any ideas if there's a way to implement this?
for example
class A implements IMyClonable
   class B implements IMyClonable
        public void cloneMe() {};
   public void cloneMe() {};
}when cloning B instance b to bClone, the enclosing A instance of bClone, should be a clone of the enclosing A instance if b.
Thanks,
Roee

s_roee wrote:
Hi,
I'm implementing some customized deep clone mechanism.
When I have an instance of an inner class (or anonymous inner class), I need to create a clone, that refer to a clone of the enclosing class (and not the original inner class).
Any ideas if there's a way to implement this?
for example
class A implements IMyClonable
class B implements IMyClonable
public void cloneMe() {};
public void cloneMe() {};
}when cloning B instance b to bClone, the enclosing A instance of bClone, should be a clone of the enclosing A instance if b.B.clone() retains the enclosing A instance.
You could;
write your A clone method
define a copy constructor in B
define a method in A that returns a copy of a B instance using the above B copy constructor
have the B clone method create a clone of A and call the above copy method on this cloned instance of A.

Similar Messages

  • How to set the full screen mode using setClip method

    hi all,
    how to set the full screen mode using setClip in that softkeys should not be used insteat on that need to create a own softkeys using commands.
    thanks & regards
    Bala.

    In CS5 there are changes made to how the screen mode is reported. In CS3-CS5 the screen mode has a corresponding number. So for instance if the ScreenMode is set to "Preview Off" and you ask indesign CS3 or CS4 to display the screen mode, it will report "1936552047", while in CS5 it will report "PREVIEW_OFF".
    try executing this simple command in respectively CS3, CS4 and CS5 and you will see what I am talking about:
    alert(app.activeWindow.screenMode);
    there is no difference if you do:
    alert(app.activeDocument.layoutWindows[0].screenMode);
    The CS5 solution is rather awkward to work with, unless I am missing something? PREVIEW_OFF is not a string, nor is it a number.
    Example -  doing:
    myScreenMode=app.activeDocument.layoutWindows[0].screenMode;
    and then trying to reset screenMode by something like:
    app.activeDocument.layoutWindows[0].screenMode= myScreenMode
    does not work in CS5 of course. It will throw an error. Neither will this line work:
    app.activeDocument.layoutWindows[0].screenMode=ScreenModeOptions.myScreenMode;
    Any way of working around this?

  • I already set the Main-Class:class parameter but still error... Help pls...

    I have an experimental project that starts with a main class called "mainConsole"
    I packed it using the NetBeans IDE 3.3.2 jar packager and also set the Main-Class: mainConsole parameter
    I still receive the error below when trying to execute the jar file.
    java.lang.NoClassDefFoundError: mainConsole
    Exception in thread "main"
    Can someone help me?
    Thanks in advance.

    Help me pleeeease!!

  • Setting the traffic class in ServerSocket

    Hi all,
    in a ServerSocket I want to mark the dscp fields of the packets which are flowing through the client. I set the traffic class field as follows:
    Socket inSock = serverSocket.accept();
    inSock.setTrafficClass(64);
    but this has a problem that the first packet sent by the inSock cannot be marked. This occurs because the first packet is sent in the accept() method, but I set the traffic class after this packet is sent. Then do you know any solution to set the tos as the default (set before the first packet) option for all sockets accepted by a ServerSocket.
    I have some very workaround solutions such as implementing the SocketImpl and etc.But I want a KISS (Keep it simple stupid).
    Thanks.

    Yes thanks for your offer it would be good approach. but this arouses a new problem that my ServerSocket are created by a factory and I need to find a transparent solution in which for all ServerSocketFactory objects my solution works well. Let's see the example.
    MyChannel(ServerSocketFactory f) {
    ServerSocket serverSock = f.createServerSocket(param1, param2, ....);
    Socket inSock = serverSock.accep();
    In this case how can I morph the serverSock instance to my MySpecialServerSocket object for example.
    Indeed I need only overriding accept method, and I need this to do for an instance not an object.
    Do you know any way to do it?
    For example we can do a thing as follows:
    MyObject ob = new MyObject() {
    public overridenMethod() {
    };

  • How do I set the HELP menu to use Indesign's local HELP files on the hard drive and not the web?

    How do I set the HELP menu to use Indesign's local HELP files on the hard drive and not the web?
    CS 5.0 launches the internet browser.  > TO SLOW I DONT WANT THIS.
    CS 3.0 uses the local help files > I WANT THIS FOR 5.0.

    You're not speaking to the right forum for your request. Help is a Suite-wide feature and here is the forum where the Help application is discussed, and where the proper Adobe people hang out:
    Community Help Application

  • Is there any way to set the SCCM system to use local time instead of UTC?

    We have ConfigMgr 2012 in our environment. We are in EST.
    Is there any way to set the SCCM system to use local time instead of UTC?
    When we try to deploy packages, if you don’t specify the time, it reverts to UTC which for us is off by 5 hours.

    Which times are you talking about? Deployment start times or deadlines? Those could be set to UTC *or* client local time.
    Torsten Meringer | http://www.mssccmfaq.de

  • SetCurrentRow does not set the right class on the new row selected

    This has to do with using setCurrentRow and having
    spry:select used on the active row to enable selection
    highlighting.
    When setting the current row programmatically by invoking
    setCurrentRow, the row get seccessfully set, but the class is not
    set to reflect that current row
    Any idea why the class of the selected row is not changing
    when I am calling setCurrentRow (works great when there is a mouse
    click)?

    Hi,
    The spry:select is a shortcut attribute that only works
    onclick.
    Check out:
    http://labs.adobe.com/technologies/spry/samples/data_region/SetCurrentRowByValueSample.htm l
    and
    http://labs.adobe.com/technologies/spry/samples/data_region/SetCurrentRowSample.html
    Thanks,
    Don

  • Class A is Loading Class B Using Reflection

    Hi,
    I am facing the below problem.
    Class A is loading Class B By Using Reflection package.
    Class B is one jar (Eg: B.jar) ,Class A is one Jar (Eg: A.jar)
    Class B internally using Class A variables and methods. When ever loading the class B from Class A it is
    giving the exception is NoClassDefFoundError of Class A.
    We are loading the Class B from Class A only, Why Class A reference is not available in Class B
    Please help me on this
    Thanks
    T. Shankar Reddy

    ShankarReddyT wrote:
    Hi,
    I am facing the below problem.
    Class A is loading Class B By Using Reflection package.
    Class B is one jar (Eg: B.jar) ,Class A is one Jar (Eg: A.jar)
    Class B internally using Class A variables and methods. Myself I don't consider circular references a great idea.
    Presumably you are not using reflection solely because it is circular.
    When ever loading the class B from Class A it is
    giving the exception is NoClassDefFoundError of Class A.
    We are loading the Class B from Class A only, Why Class A reference is not available in Class B
    Several possibilities.
    1. Because you are attempting to load B in the static block of A. In that case the class A has not yet been loaded. And the VM will not try to reload A once it is in the process of loading. Which is pretty smart of the VM.
    2. Because there is a custom class loader involved.
    You might want to post the stack trace of the exception.

  • How to set the User rights to use DAQ/IMAQ in WinXP as general(=limited) user

    When I install Software, written in LabVIEW (build an executable/installer), as administrator it works fine. But when I switch over to a user account with limited rights (we are talking about WinXP) it will not run and gives error messages. It happend to me at two almost the same computers, one with a DAQ-board, and one with an IMAQ-board. (At the computer with IMAQ1411 -> I also checked MAX -> errors/no access.) What to do?
    Attachments:
    DAQ_example.JPG ‏9 KB
    IMAQ_example.JPG ‏15 KB

    Hello,
    I investigated the issue further. To work around this problem you should add write permissions to the C:\Program Files\National Instruments folder. Be sure that all subfolders and files are awarded write permission. This should solve your problems. eventually you could break it up to one file which must be set to write permission but by setting the whole folder to write permission you solve this problem for many other drivers to so you would not run into this everytime you use different hardware.
    Best regards,
    RikP
    Application Engineering
    National Instruments
    Rik Prins, CLD
    Applications Engineering Specialist Northern Europe, National Instruments
    Please tip your answer providers with kudos.
    Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system,
    or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject
    to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense

  • Can i create more than one attributes for the custom class created using java API

    Hello everyone,
    I have been creating class and its attributes programatically using java APIs, I want to know that is there any way to create multipal attributs for the same class in just one call of API with all the options for each attributes,
    thanks

    You can create a new class and define all of the Attributes at the time the class is created - this is the preferred way of creating classes. Use the addAttributeDefinition() method on ClassObjectDefinition. If you need to add attributes to existing classes, you can only add them one at a time (using the addAttribute() method on ClassObject).
    (dave)

  • Hi, with mix16 pro app, can anyone tell me when you set different audio levels for different tracks, does the app remember the level set the next time you use it?  Or does it default to the original setting when you power down after a show?  Thanks!

    Hi
    I use backing tracks for some songs with a live band and we are having some issues with levels.  Some are higher than others etc.  I use i pad to run the tracks.  I am looking for an app that where I can control the levels better.  Ideally, an app where I can set the level of each track to a desired level and leave it at that level for good.  Mix16 Pro  seems to do that but I wonder does it save the setting as I do not want to set the levels every time I use it.
    Thanks

    Hi
    I use backing tracks for some songs with a live band and we are having some issues with levels.  Some are higher than others etc.  I use i pad to run the tracks.  I am looking for an app that where I can control the levels better.  Ideally, an app where I can set the level of each track to a desired level and leave it at that level for good.  Mix16 Pro  seems to do that but I wonder does it save the setting as I do not want to set the levels every time I use it.
    Thanks

  • How to set the Model Class for a newly created Model Node ?

    Hello All,
      I am trying to map a Model node from SourceA to DestinationB.
      To do so, I created a model node for Destination B in the interface controller (set the isInputElement to true). However why I try to map the node, I get an error saying that "Both context nodes have to be bound to a model class". Upon a closer look, I realised that the model node that I created in DestinationB has no entries under the properties.
      Does anyone knows/advise how I can add the model class entry to the model node that I have created as I am not able to do so. Or otherwise, is there a way to map a model node to another model node across different components ? Thank you very much.
    from
    Kwok Wei
    from
    Kwok Wei

    Hello Pascal
      The instructioons that you gave are for mapping the model between the view controller and the component controller within the same component is that right ?
      I am tryng to map a model node in the component controller of SourceA to another model node that belongs to another Component. I do believe that in this case I will need to create a model node in the interface controller of DestinationB and map that to the component controller of SourceA. However, by creating my own model node, how do I change the property modelClass in the context ?
      Thanks !
    from
    Kwok Wei

  • Setting the doc.type to use for t.code ABUMN (transfer asset ...)

    Hi All,
    Could anyone show me where to set, in customizing, the doc.type to use for t.code ABUMN (transfer asset within company code)?
    Thanks
    Umberto Gandalf

    AO71                   Document type for posting deprec.
    AO72                   Specify posting procedure
    AO73                   Define Transaction Type
    AO73_INV               Define Transaction Type
    AO74                   Define Transaction Type
    AO75                   Define Transaction Type
    AO76                   Define Transaction Type
    AO77                   Define Transaction Type
    AO78                   Define Transaction Type
    AO79                   Define Transaction Type
    AO80                   Define Transaction Type
    spro- FA - AA - transactions - transfers
    Rgds.

  • Setting the "CSS Class" field not taking effect

    Hello. I defined my custom.xss as follows:
    <?xml version="1.0"?>
    <!-- $Header: custom.xss 115.2 2003/08/13 07:48:42 nigoel noship $ -->
    <styleSheetDocument xmlns="http://bali.us.oracle.com/cabo/ocelot">
    <import href="oa.xss"/>
    <styleSheet>
    <!-- Please start your customizations here -->
    <style selector=".Red">
    <includeStyle name="DefaultFontFamily"/>
    <property name="background-color">red</property>
    </style>
    <!-- Please end your customizations here -->
    </styleSheet>
    </styleSheetDocument>
    I can see my new tag defined in the generated CSS file. However, when I take my messageStyleText element and put 'Red' in the CSS Class field it does not change the background color. Am I doing something wrong?
    Thanks! Graeme.

    On Fri, 23 Mar 2007 09:53:58 +0000 (UTC), "dulcettones"
    <[email protected]> wrote:
    >Hello, I'm redoing my site from the beginning, this time
    using 'relative'
    >positioning due to browser inadequacies. Because I'm new
    to CSS I'm trying to
    >get my head around it as I go along.
    Not sure that's right - I'm sure Murray will help there
    > The first thing I'm doing is laying out my navigation
    bar at the top of the
    >page.
    > These are the CSS styles:
    > #navlist
    > #navlist ul
    > #navlist li
    > #navlist a
    > According to my book the changes to font should be done
    in #navlist ul.
    >However nothing happens when I enter the settings.
    > BUT...the changes do take effect if I use the other ones
    (#navlist / #navlist
    >li / #navlist a)
    > Can anyone help?
    >
    needs applying to the li
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN"
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>Untitled Document</title>
    <style>
    .navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    .navigation li {
    display: inline;
    font-family:"Times New Roman", Times, serif;
    font-size: 1.1em; font-style:normal; font-weight:600;
    width: 125px;}
    .navigation li a:link, .navigation li a:visited {
    padding: 2px 5px 2px 0.5em;
    background-color: #009933; /* Main backround colour */
    color: #FFFFFF; /* normal font colour */
    text-decoration: none;
    width: 125px;
    .navigation li a:hover {
    background-color: #EBF4EA; /* Main hover colour */
    color: #006600; /* hover text colour dark green */
    </style>
    </head>
    <body>
    <div class="navigation">
    <ul >
    <li><a href="x">Home</a></li>
    <li> <a href="x">One</a></li>
    <li><a href="x">Two</a></li>
    <li> <a href="x">Three</a></li>
    <li> <a href="x">Four </a></li>
    </ul>
    </div>
    </body>
    </html>
    ~Malcolm N....
    ~

  • How to set the rows of dataTable using loadBundle tag?

    Hi,
    Can i set the rows property of a <h:dataTable> using the value from a <f:loadBundle> tag?
    I tried the following code
    <f:loadBundle basename="com.message.NumberOfRows" var="numRows"/>
    I have NumberOfRows.properties file with the following entry
    rows=5
    The dataTable code
    <h:dataTable value="#{mastData.list}" rows="#{numRows.rows}" align="center" var="mastBean">
    </h:dataTable>
    This code is generating ClassCast Exception.
    Please comment on this issue.
    Thanks,
    Renju

    Hi,
    Exactly Reymond, See Renju you already using mastData bean for datatable. In that create a bean method something like rows & create a getter/setter method returning int. In getter method try this code as
    ResourceBundle bundle = ResourceBundle.getBundle("ur resource bundle");
    rows = Integer.parseInt(bundle.getString("rows_to_display"));
    return rows.
    Hope you can now get some clear idea i guess
    Regards,
    A.

Maybe you are looking for