Difficulties cloning  element data member

Hi,
I have a DataObject class that has a DOM Element as a data member (metadata). This class has a clone method that is meant to do the usual clone shenanigans but it is behaving strangely.
When I create a new DataObject, the data members of the calling DataObject are reset, as if it was calling the constructor on its self. Does this have anything to do with the use of the Element (maybe cloning it and not removing it from a Document) or have I forgot how to implement cloneable properly?
The first output shows the data members of the calling object prior to creating the cloned object. The second shows after and the third shows after setting the cloned object's members. I have a sneaking suspicion that I am just setting the calling object's members again.
Here's the code for the method and the output:
  public Object clone(){
    DataObject myDO;
    Element newMeta = (Element)metadata.cloneNode(true); //copy metadata
    byte[] pCopy = new byte[physicaldata.length];
    System.arraycopy(physicaldata, 0, pCopy, 0, physicaldata.length); //copy physical data
    System.out.println("this mdata exists 1: " + this.metadataExists());
    System.out.println("this pdata exists 1: " + this.physicaldataExists());
    myDO = new DataObject();
    System.out.println("this mdata exists 2: " + this.metadataExists());
    System.out.println("this pdata exists 2: " + this.physicaldataExists());
    try{
      myDO.setMetadata(newMeta);
    }catch(DataObjectException d){
      System.out.println("Metadata could not be set");
    myDO.setPhysicaldata(pCopy);
    System.out.println("this mdata exists 3: " + this.metadataExists());
    System.out.println("this pdata exists 3: " + this.physicaldataExists());
    return myDO;
System.out
this mdata exists 1: true
this pdata exists 1: true
this mdata exists 2: false
this pdata exists 2: false
this mdata exists 3: true
this pdata exists 3: true
Any ideas would be appreciated. Cheers.
Brent.

I have a feeling that naming my data members as static may have something to do with this.
If so, I will later invite people to shoot me in the head.

Similar Messages

  • $System.logoff data member

    I need to use this data member to command the logoff of current user after a defined time.
    In the lookout 6.5 help this member is defined writeable, but in the object explorer there are no ways to access this one for set logoff condition.
    Is a mistake in the help file or there is a way to access it?
    Greetings
    Mario Fanelli
    EL.P.R.IND. srl
    [email protected]
    Solved!
    Go to Solution.

    The problem is the $System group. We decided to add them to the $system, but all data members in $System is only writable and cannot have the "Edit Connection". What you can do is to right click on it and drag onto the panel to create a pushbutton or switch. Or you can create a pushbutton and add the $System.logoff to its remote source.
    The original purpose of this datamember is for touch panel user who maybe feel difficult to click on small menu. If you want to programmatically control the logoff data member, you can create a pushbutton and connect remote source to logoff, and then connect a timer to the pushbutton by the "Edit Connection".
    Ryan Shi
    National Instruments

  • Xml data convert into only element data

    Hello everybody,
    I create a form which use the web service. My output is come in xml form like..
    <NewDataSet>
    <Table>
    <PRIVATE_MARKA_BATCH_NO>0622</PRIVATE_MARKA_BATCH_NO>
    </Table>
    <Table>
    <PRIVATE_MARKA_BATCH_NO>DOOR CABINET</PRIVATE_MARKA_BATCH_NO>
    </Table>
    </NewDataSet>
    I want only element data like 0622, DOOR CABINET. Is it possible to remove the xml heading?? Please help..
    Forms [32 Bit] Version 10.1.2.0.2 (Production)
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

    any link which help me working on xml data.Please refer these OTN links...
    >
    If you have questions related to using XML with Oracle database 9.1 and earlier please use the XML forums at http://forums.oracle.com/forums/category.jspa?categoryID=51.
    >
    1] https://forums.oracle.com/forums/category.jspa?categoryID=51
    >
    This forum provides you with an opportunity to discuss issues related to XML DB. Oracle XML DB is feature of Oracle Database 9i Release 2 and later. The minimum supported release for XML DB functionality is patch release 9.2.0.3.0.
    >
    2] XML DB
    Hope this Helps,
    Ranit B.
    Edited by: ranit B on Dec 3, 2012 6:03 PM

  • Change Mrp Element Data of Production Order in MD04

    Dear guru ,
    In the mrp element data of the stock/requirement list for the production order I see the
    Production order number , the order type , and the system add /RE if production order is released or
    /PD if production  order is partial delivered. No other information about others production order status.
    How can I change mrp element data using Customizing or ABAP in order to recognize in MD04 if production order is confirmed or partial confirmed ?
    Thanks.

    Dear Cris ,
    I am not sure if CNF/PCNF will show up in the MRP Element data in MD04.I have checked PO which are also CNF/PCNF and i looked the same order in md04.It is not showing .U may need some ABAP help .
    But if you really intersted to see the list PO status together , then go to COOIS and give plant , order type .It will give you all the order under that plant irrespective of material and also Status.U ave lot of option to filter the PO status under Status Profile or System status ok.
    Hope this will fullfill your requirement
    Reward point if useful
    Regars
    Jia

  • Can I sort an ArrayList basd on a data member?

    Hello everyone.
    Currently my program stores a lot of objects in an ArrayList.
    Each of these objects has the following data members:
    public class ClassEntity
         //RODM ID VERSION
         private String idClassName;
         private String idFieldName;
         //ENGLISH VERSION
         private String englishClassName;
         private String englishFieldName;
         private String fieldType;
    }I have the following data structure:
    List<ClassEntity> classEntityList = new ArrayList<ClassEntity>();Now is there a way to order the Objects inside the ArrayList so they are in alphabetical order based on the englishFieldName data member?
    I currently iterate through the List and write it to a file and the List is out of order so the writing to file is out of order.
    I saw collections has a .sort() method, but I'm not sure how I would tell the .sort() to sort based on englishFieldName. In C++ I would overload the < operator I'm still new to data structures in Java though.
    Thanks!

    Implement the Comparable Interface in your class, as my example in this posting shows:
    http://forum.java.sun.com/thread.jspa?forumID=31&threadID=598401

  • Xml-fragment Issue retrieving Nested element data

    Hi,
    I've problem retrieving the nested element data from the xml. Using XmlBeans I am getting null when retriving the inner element. I printed the nested element xmlobject it has Xml-Fragment wrapped. I tired using below code it doesn't throw any error but the data is lost
    AAAA TempObj=AAAA.getBXXX().getCXXX(0);
    //remove xml fragment
    XmlOptions xmlOpt = new XmlOptions();
    xmlOpt.setSaveOuter();
    XmlCursor c= TempObj.newCursor();
    c.toFirstChild();
    Myclass myclassObj= Myclass.Factory.parse(c.getObject().xmlText(xmlOpt));
    log.debug("Records: "+myclassObj .getXXArray().length);
    Output:
    length should give aleast 1 or more but I am getting 0. That means the xmltext didn't parse properly.
    Can anybody suggest what could be the problem.
    Thanks in advance.
    -Sri

    no answer

  • Purpose of Prefix and Suffix in Logical Data Member?

    Hi,
    What is the purpose of the prefix and suffix fieldin a logical member?
    For instance, I have the word "Off" entered in the On field and the word "On" entered in the Off field.
    The  "Invert Logical Signal" is unchecked.  So is this the same as having the "Invert Logical Signal" checked if you enter the words Off and On as above?
    Thx.

    Hi Zog626;
    The prefix and suffix tags perform NO functions on the data member. You could put in the words, "Yippy" and "Skippy" and nothing will happen.
    Personally I use them to help remind me what the engineering units is for that particular vartiable. For example, I will put in GPM if it is Gallons Per Minute,
    or °F if it is a farenheit temperature.

  • Getting a value of a data member that is in a subclass only

    Hi
    i have one superclass called membership and it has the data members name, password, readingPoints.
    i have two subclasses of the membership class called silver and gold.
    the gold subclass has an extra data member called statusPoints.
    i have no idea how to retrieve the statusPoints in my main program.
    in my main program, i created a few gold and silver members and put them into an array.
    this is how i have been trying to retrieve just the statusPoints.
    System.out.println (members[0].statusPoints);
    System.out.println (members[0].GoldMembership.statusPoints);
    System.out.println (members[0].(GoldMembership).statusPoints);
    none of them work =(. i have no idea how to specifically call that subclass from my main program to get that statusPoint value.
    i hope some one knows the answer to my problem
    thanks in advance! =)

    xiarcel: i've heard of the term casting before but i
    don't think i've ever used it, or i have used it but
    not know that i have :p(GoldMembership)members[0]
    That is casting (well, onversion of it. Another would have been
    Membership[] members ...
    members[0] = new GoldMembership()...)
    warnerja: ohh! ill make a note of that, in my gold
    subclass case, is it even possible to even get that
    value without casting it into a string using a getter
    method?Well, the idea is probably you are doing something outside of the class that might be best handled inside the class. For instance, if you are calculating a price of something that depends on readingPoints, then creating an abstract Membership method:
    public abstract double calculateMemberPrice(double origPrice);
    In which most Memberships will calculate the price based solely on readingPoints
    // example in SilverMembership
    public double calculateMemberPrice(double origPrice)
      double price = origPrice - (origprice * (readingPoints/1000));
      return price;
    }but for which GoldMembership would calculate using both statusPoints and readingPoints:
    public double calculateMemberPrice(double origPrice)
      double price = origPrice - (origprice * ((readingPoints+statusPoint)/1000));
      return price;
    }Then the you don't need to cast, you can just do
    members[0].getMemberPrice(double originalPrice);
    I hope that makes half a sense.
    >
    my main program has a members array where it stores
    gold and silver members, but yeah i just made position
    0 gold to try to get the statusPoint out of it =).
    stevejluke: indeed i was =)
    im so happy its working now, and its all thanks to you
    guys!! its so great to have a place like this where i
    can get help so fast! me and my gf were trying to
    figure it out for hours and hours with no luck!
    thanks again guys/girls =) you're the best!! :p

  • FAQ: I'm an Elements Plus member. How can I claim my complimentary one-year subscription to Revel?

    Q: I’m an Elements Plus member. How can I claim my complimentary one-year subscription to Revel Premium?
    A: We will create your Revel Premium account for you.
    Simply go to Adoberevel.com to download the free Revel app to your iPhone, iPad, or Mac.
    Sign in with your Adobe ID and password, and go to the Settings menu to see that your account has been credited with a one-year subscription.

    Hello Vinyl_lives,
    Vinyl records are certainly making a comeback these days, especially ones that are limited editions or releases. I know Phish’s record wasn’t any different, as it was quite a popular record. We did have a limited amount of the Nectar Deluxe Vinyl Edition, so I’m sure you were ecstatic to place a pre-order for it and reserve yourself a copy.  I can imagine that your excitement soon turned into disappointment though when you found your order was automatically canceled after being on backorder for so long, and I’m sorry for any frustration you endured while trying to sort out your order.
    While rare, we sometimes receive a higher than anticipated demand for an item than what we have inventory for. Should this happen, an item’s availability status should change from “available now” to “backorder”. These backordered purchases remain active for 14 days on most products, but if the item is still on backorder after that aforementioned time, we will automatically cancel the order on file. This is what happened with your Nectar Deluxe Vinyl Edition order, and I apologize for any confusion this may have caused. For further information on this, please view our Conditions of Use that may be found here.
    I understand this process has left you without a copy of the vinyl you wish to own. While I cannot guarantee you a copy, you may place a new order for the record online. Please know that this item is still listed as backordered though, and any new order may be canceled once again depending if inventory becomes available or not.
    Respectfully,
    Alex|Social Media Specialist | Best Buy® Corporate
     Private Message

  • Is it possible to get the element data type of a Queue from itself?

    Hi everyone,
    i have a Q that has a cluster as element data type.
    now when i want to enqueue
    i'll use bundle-by-name
    and for that i'd have to have my data-type present
    (long cable from whereever (possibly from where i obtained the Q).
    my question is,
    whether there is a method/property-node/something that allows me to
    wire the Queue Refnum into it and receive the element-data-type,
    so i can then input into the top of bundle-by-name?
    (i really dont want to have that cable all over the place)
    the reason i ask here is that
    the help for the outgoing Queue Refnum from the Obtain Queue method,
    shows the element-data-type and so i hope there might be a solution.
    thx for your time
    and cheers
    j
    Solved!
    Go to Solution.

    If I understand your question correctly, the answer is "Yes, it's very easy ..."
    The answer is "Preview Queue".  Here I create a Queue of some mysterious type (it's a cluster having a Thing and a Center, but you don't know that yet).  I take the Queue reference from whereever I can find it and pass it into Preview Queue Element.  I take the output and use it to define my cluster in Bundle by Name.
    Two caveats.  This copies the first element of the Queue into the cluster, so you probably need to be sure to define all of the elements of your cluster.  But what if the Queue is empty (as mine is, above, as I just Obtained it) -- well, that's why 0 is wired into the TimeOut input, since I do not want to wait "forever" (-1) for the empty Queue to have an element!  Turns out that even in this case, you still get the correct Cluster elements!
    Neat, huh?
    Bob Schor

  • How can I syncronize Lightroom and Photoshop Elements data?

    How can I syncronize Lightroom and Photoshop Elements data?

    Hi Palsaran,
    As i understood, your requirement is to POST data from UI to backend.
    The above code you given is not correct if you want to use model based implementation.
    In UI5 you don't need to do an explicit Ajax call, for which we can use Models like OData, JSON etc.
    For your JSON example, you can use like,
    var oModel = new sap.ui.model.json.JSONModel();
    var oData = "YOUR JSON DATA";
    oModel.setData(oData)
    oModel.loadData(yourURL/Entityset,"POST");
    For ref, you can use the below link
    JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.ui.model.json.JSONModel
    Thanks
    Naveenraj

  • Compare the elements data of the 2 context nodes using internal table

    Hi,
    How can i compare the elements data of the 2 context nodes using internal table?
    Regards,
    Ronita

    hi ronita,
    just get the nodes data into internal tables and just compare them......
    node1->get_static_attributes_table(importing table = ITAB_node1)
    node2->get_static_attributes_table(importing table = ITAB_node2)
    now u have the data of ur 2 context nodes in 2 different internal tables ..
    just compare them like
    if  ITAB_node1[ ] = ITAB_node2[ ].
    write: / 'itab1 is equal to itab2'..
    endif.
    and u can use as many as comparision operators between these 2 tables to compare them....
    regards....
    srini,,,,

  • Clear UI elements data

    Hi Guys,
    How to clear UI elements  data once binding is done.
    Thanks in advance.
    Nandana

    you can call invalidate() method on the node that is bound to UI elements
    Thanks
    Bala Duvvuri

  • Is there an alarm data member for when an alarm reseets?

    I created a spreadsheet to track alarms, but I can only show when the alarm activates.  I need the ability to show when an alarm becomes active, when the alarm is acknowledged, and when the alarm resets.  I have tried the alarm unacked data member, but that only shows how many alarms have not been acknowledged, it is not per alarm message.
    MWarner

    Try WorkTime. https://itunes.apple.com/us/app/worktime-work-schedule-shift/id594764457?mt=8 You'll need to get the premium paid version for the alarms/reminders.

  • SecondaryKey on a Object data member.

    Hallo developer.
    Using je 3.1 with DPL
    Linux box with JDK 1.5_06
    We got a problem.
    We are indexing our data model beans and we got this problem.
    We have a SecondaryKey decorated as folows:
    <pre>
    @SecondaryKey(relate=Relationship.MANY_TO_ONE)
         private Object snTP;
    </pre>
    Where the SnTP Object ha a PrimaryKey that is a String, as needed by je to handle the reference between the objects.
    We had to declare the data member snTP as Object and not as String since we got this requirement.
    We encounter this exception
    <pre>
    java.lang.IllegalArgumentException: Key class is not a simple type or a composite key class (composite keys must include @KeyField annotations): java.lang.Object
         at com.sleepycat.persist.impl.PersistKeyBinding.<init>(PersistKeyBinding.java:42)
         at com.sleepycat.persist.impl.Store.getKeyBinding(Store.java:863)
         at com.sleepycat.persist.impl.Store.openSecondaryIndex(Store.java:483)
         at com.sleepycat.persist.impl.Store.getPrimaryIndex(Store.java:320)
         at com.sleepycat.persist.EntityStore.getPrimaryIndex(EntityStore.java:246)
         at com.tilab.wants.dataModelManager.berkeley.IndexManager.<init>(IndexManager.java:31)
         at com.tilab.wants.dataModelManager.berkeley.BerkeleyDataModelManager.init(BerkeleyDataModelManager.java:62)
         at com.tilab.wants.dataModelManager.DataModelManagerFactory.create(DataModelManagerFactory.java:71)
         at com.tilab.wants.dataModelManager.berkeley.BerkeleyDataModelManagerTest.setUp(BerkeleyDataModelManagerTest.java:35)
         at junit.framework.TestCase.runBare(TestCase.java:125)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
         at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    </pre>
    Any idea to resolve the problem?
    Kind regards
    Massimo

    Hi Massimo,
    The type and format of keys is fixed in DPL, and DPL creates a binding for each key in advance. For example, if the key type is String, a String binding is created. DPL must therefore know in advance what the type of a key field is. So you will need to declare this key field as String, not Object. The types allowed for key field declarations are described here:
    http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/persist/model/PrimaryKey.html
    Mark

Maybe you are looking for