How to iterate to a previous node with a treemap

I have am using a treemap with the comparable interface. an iterator can be used to go to the 'next' node. How do i go to the 'previous' node?

[url http://forum.java.sun.com/thread.jsp?forum=31&thread=567262]Crosspost

Similar Messages

  • XSLT For-Each Issue, how to traverse back to previous node

    How to get the SupplierName(Primary) from the below payload
    *+<ItemSupplier>+*
    +<SupplierParty>+
    +<SupplierName>SUPPLIER NAME 1</SupplierName>+
    +</SupplierParty>+
    +<ItemSupplierLocation>+
    +<Status>1</Status>+
    +<PriorityCode>N</PriorityCode>+
    +</ItemSupplierLocation>+
    +<ItemSupplierLocation>+
    +<Status>2</Status>+
    +<PriorityCode>N</PriorityCode>+
    +</ItemSupplierLocation>+
    *+</ItemSupplier>+*
    *+<ItemSupplier>+*
    +<SupplierParty>+
    *+<SupplierName>SUPPLIER NAME 2</SupplierName>+*
    +</SupplierParty>+
    +<ItemSupplierLocation>+
    +<Status>1</Status>+
    +<PriorityCode>N</PriorityCode>+
    +</ItemSupplierLocation>+
    +<ItemSupplierLocation>+
    +<Status>1</Status>+
    +<PriorityCode>Y</PriorityCode>+
    +</ItemSupplierLocation>+
    *+</ItemSupplier>+*
    The condition i need to run is as below, but as the control will be inside the <ItemSupplierLocation> how do i go back to previous node and get the value of supplier name.
    +<ItemSupplier> can be n number+
    <xsl:for-each select="ItemSupplier/ItemSupplierLocation">
    <xsl:choose>
    <xsl:when test='PriorityCode="Y" and Status="1"'>
    <Supplier>
    <xsl:value-of select="ItemSupplier/SupplierName"/>
    </Supplier>
    </xsl:when>
    </xsl:choose>
    </xsl:for-each>
    Thanks,
    Vijay

    Fixed the issue with the below code
    <xsl:for-each select="ItemSupplier/ItemSupplierLocation">
    <xsl:choose>
    <xsl:when test='PriorityCode="Y" and Status="1"'>
    <Supplier>
    <xsl:value-of select="../SupplierParty/SupplierName"/>
    </Supplier>
    </xsl:when>
    </xsl:choose>
    </xsl:for-each>
    Thanks,
    Vijay

  • How to search for a text node with a particular value in an xml document with labview

    supposing i have the following xml document:
    <head>
    <book>
    <bookname>zio</bookname>
    <author>dan</author>
    </book>
    <book>
    <bookname>the spear warrior</bookname>
    <author>britney</author>
    </book>
    <book>
    <bookname>the beard</bookname>
    <author>derrick</author>
    </book>
    </head>
    i want to search for the author of the book "the beard" using for example the V.I Get first match  of labview to access the the node with value "the beard" and then use Get next sibling  V.I  and Get node text content to get get the author of this book..so my question is how do i write the xpath expression for Get first match so as to access the node with bookname "the beard" instantyly?  am trying to minimise the use of loops because they increase the time duration,..thank you (NB:i dont want to use Get all Matched V.I because it obliges me to use a loop in order to access the name derrick and this increases the time duration for my v.i)
    Solved!
    Go to Solution.

    Since it's all text, why not use a real quick Match Pattern (or Regular Expression, but you don't need that much power here), see attached.
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ
    Attachments:
    Two-stage match demo.vi ‏8 KB

  • HT201441 How do you contact the previous owner with a partial email?

    How do you send an email to an unknown previous owner with only a partial email visible on an iCloud locked device? Is there a way to get the entire email address so the old owner can be contacted? There has to be a way to contact the previous owner.
    -bsides

    No, there is no way to get the complete email address. Turn the device in to the police.

  • How to unpack an installer previously compiled with Inno Setup?

    Hi,
    I want to know how can I unpack a previously compiled installer (exe file) made with Inno Setup to extract and recover some DLL files into the installer. I found a tool called InnoExtractor
    that supposedly
    does this, but I don't know how is work. Any help is appreciate. This tool can by downloaded from here:
    http://www.softpedia.com/get/Compression-tools/InnoExtractor.shtml
    Regards and I'll wait your support. Thanks in advance.

    Hello GonKong,
    I am afraid that this is not the proper forum for this issue, since it is related to the tool which belongs to third-party.
    I would recommend you consider connecting with the publisher of Inno Setup or InnoExtractor to get supports.
    Regards.
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to deactivate or remove previous id with window 8

    I buy a laptop week ago. It has window 8 I started with one of my e-mail id. Then due to some problems I exchange it. Now I have another new laptop I like to add my that id with this laptop. But they id already in use. How can I add this to
    my this laptop.
    one more problem they merged my Skype id with that id now I unable to use my Skype id too. how can I use different id's with same id.

    Hi,
    Could you remove that account from the old laptop?
    Please follow this:
    Go to the Control Panel in Desktop ,select "User Accounts", select "Manage another Account" and the system shows all accounts registered in our device.
    Later, select the account that you want to manage, select  "Remove User Account" and confirm that you want to remove it with all data, after that, it’s like never existed that account.
    After that, add this account to new laptop.
    In addition, Please sign in through the Web for test to see if this account is available.
    https://login.skype.com/login?application=account
    If no, please ask Microsoft account forum for more professional help.
    http://answers.microsoft.com/en-us/windowslive/forum?auth=1
    Karen Hu
    TechNet Community Support

  • Re: How to iterate to a specific node in Oracle ATS OpenScript

    Hi
    We have insurance production developed using oracle forms 10. Trying to automate few processes of the application. Installtion is fine recording and playback works. Have list of queries which needs to be addressed:
    - When I try to choose to the functional EBS/forms I'm able to recordand play back say for ex sample1 test. This is also achived in Load testing EBS/forms aswell when I compare the tree view or java code. I able to see the action set.textfield(value) while I choose the Functional ebs/forms this is not seen I can only mousecilck accelement("@index=0") 322,17s.Please advise on this if any settings are missed.
    - I used databanks configured them to required fields ex : CURRENCIES_CURR_NO_2 ={{db.currencydata.CURRENCIES_CURR_NO_2}}. I have few records which has to be picked when I run the iteration kindly advise me how this can be achived. i HAVE PASTED SAMPLE JAVA CODE Of my application.
    Please advise me how this can be done.

    Hi, DeepuM,
    Thnxs fr this info,I've followed the step which was mentioned earlier in your posts..but i m getting error.
    here's my scenario : i have a lo-gin script node and two child scripts in RUN Section,i want to iterate only the lo-gin node.. hence i moved the child scripts to initialize section ended up with this error "Failure when running child script"
    kindly help.
    Thanks in Advance.
    Regards,
    Diane

  • How to iterate to a specific node in Oracle ATS OpenScript

    Hi,
    I have recorded a script in Oracle ATS Open Script tool. I want to iterate back to a specific node after completing the first iteration. Is there any way to do that?
    I don't want to iterate back to first step again and again.
    Regards,
    Sahil
    Edited by: 1009073 on May 31, 2013 1:39 AM

    Hi, DeepuM,
    Thnxs fr this info,I've followed the step which was mentioned earlier in your posts..but i m getting error.
    here's my scenario : i have a lo-gin script node and two child scripts in RUN Section,i want to iterate only the lo-gin node.. hence i moved the child scripts to initialize section ended up with this error "Failure when running child script"
    kindly help.
    Thanks in Advance.
    Regards,
    Diane

  • How can I sync a previous library with a current one?

    I got a new computer for Christmas and synched my Apple data with it. I have not synched any new music using my computer for several months now, because I either purchase it from iTunes on my phone or use another music service.
    I recently downloaded an album from a third party site (bandcamp.com) and want to add my new Shakey Graves album to my phone. The issue is, for some reason my library is missing several gigs worth of music.
    Music that I have on my phone from a previous library, but apparently don't have the files for on my new computer.
    Am I able to just add this album onto my phone (or something along those lines) without disturbing my current content on my phone?
    Thank you for your replies.

    Libraries cannot be synced.
    The correct way to handle a new computer is to copy the ENTIRE iTunes folder from the old comptuer to the new computer.  At this point, the same library exists on both comptuers and the user simply starts using the new computer and library.  The old computer can then be wiped or disposed of.
    Syncing to the new computer at this point will remove all content from the device and replace it with content from the new computer/library.

  • How to count number of xml nodes , with JSTL XML api?

    I am trying to count the number of nodes in the parsed xml by doing this:
    <x:out select="count($doc/Items/Item)"/>
    There are about 50 item nodes in the source xml, but I get the output as 0
    Is this syntax correct?
    I searched every where but couldn't find the xpath syntax to be used inside jstl xml tags, I was assuming that it's the same as the syntax used in xslt

    Thank you for your reply, sorry I wasnt very clear with my question.
    I want to count the number of nodes inside the jsp file , not inside the xslt file.
    My xml file is something like this for example:
    <?xml version="1.0" encoding="UTF-8"?>
    <DocumentRootNode>
    <Products>
    <Item>1</Item>
    <Item>2</Item>
    <Item>3</Item>
    <Products>
    </DocumentRootNode>
    I want the count of number of Item nodes , in the JSP file.
    I'm doing something like this in the JSP but it gives 0 instead of 3:
    <c:import url="source.xml" var="xml" charEncoding="UTF-8"/>
    <x:parse doc="${xml}" var="xml_doc"/>
    <x:out select="count($xml_doc/Products/Item)"/>
    null

  • How to create a new tree node with the initial edit function

    Hi all,
    I would like to mimic the Windows system when the user creates a new node. The newly created node should be in the edit mode, i.e.it should
    be highlighted and the cursor should be appear at the end of
    the newly created node name.
    I have the folloing code after I create the new node and set its selection:
    TreePath selectionPath = getTree().getSelectionPath();
    tree.startEditingAtPath(selectionPath);
    However, this only partially does what I want, the cursor does not appear at the end of the node's name and I am not sure how to select the text name of the new node.
    I hope someone can help.
    Kanita

    I haven't tried myself but my guess is that you need to customize your tree cell editor for putting
    cursor at specific position, etc.

  • How to delete photo albums previously synchronized with iCloud

    I previously set my iPhone to enable photo streaming. I also set iTunes to backup to iCloud. After a while, I decided to revert to back up and sychronize with my PC. I also disabled photo streaming.  Prior to this change, my photo albums got uploaded to iCloud including a particular album which I subsequently deleted from my PC photo folders. When I tried to synchronize through iTunes, the album will not get removed in my iPhone, even if it is no longer in my PC photo folder. I assumed it got stuck in the iCloud but I have already disabled photo streaming and this was supposed to delete all photos in iCloud.
    I tried all sorts of suggestions, but short of restoring, which I find such a ridiculous solution because it would delete all my data and all I wanted was to delete this one empty folder. Eventually I stumbled upon a simple yet effective one. Here's what I did:
    1.  Connected the iPhone to my PC which fired up iTunes (I set this as my default).
    2.  Clicked on my iPhone under Devices.
    3.  Under Summary, selected Backup to this Computer.  [This is to make sure I have a most recent backup of my iPhone files]
    4.  Clicked Sync button.
    5.  Clicked Photos tab (rightmost tab)
    6.  Unchecked Sync Photos From box.  [This will delete all photos in the iPhone]
    7.  Clicked Sync button again.
    8.  When sychronization finished, ejected the iPhone from iTunes by clicking on the eject icon to the right of your iPhone's name.
    9.  Went to Photos in the iPhone. Only Camera Roll and the empty Album appeared.  I clicked on Edit and a red (do not enter sign) icon appeared to the left of the empty Album name. Tapped that and proceeded to delete the album. No more albums would be displayed.  [Note: The red icon did not show up previously when there were other albums listed.]
    10.  Reconnected my iPhone to PC, starting up iTunes.
    11.  Went to Photos tab.
    12.  Checked Sync Photos From box again. [This will restore all your selected photos/albums to the iPhone]
    13.  Clicked Sync button again.
    14.  When synchronization finished, ejected the iPhone from iTunes.
    15.  Checked the Photos album.  The empty folder is no longer there!
    Hope this helps others with a similar issue.

    If these are albums that were synced from your computer via iTunes then you can only delete them by unselecting them on the Photos tab when your iPad is connected to your computer's iTunes and then syncing, they can't be deleted directly on the iPad.
    If these are albums that you have created directly on the iPad in the Photos app via the Edit button, then you can delete them by tapping the Edit button and then tapping the 'x' that appears on the top left corner of the album

  • How to select a specific XML node with XPath

    Hi,
    I'm trying to a select a specific node from my XML data using the XPath Builder.  For example, say I have a process variable 'xmlData' with the
    following contents:
        User 1
        101
        User 2
        102
    I can successfully use the following expression to retrieve the name of
    a specific user:
    (/process_data/xmlData/users/user[userid='102'])/name
    The problem is I need to use another process variable for the selection
    key.  For Example:
    (/process_data/xmlData/users/user[userid=/process_data/@userId])/name
    But this always returns null.  I've tried surrounding /process_data/@userId
    with single quotes, double quotes, and event {$..$}. 
    Any help would be greatly appreciated.
    Thanks.

    Hi,
    Thanks for the quick replies.  I gave a bit of a bad example, as the
    userid in my data is really a string, not a number.
    A better example is:
        User 1
        user1
        User 2
        user2
    I can get the following to work perfectly:
    (/process_data/xmlData/users/user[userid='user2'])/name
    but I can't get it to work with
    /process_data/@userId = "user2"
    (/process_data/xmlData/users/user[userid=/process_data/@userId])/name
    Thanks.

  • TS2755 How do I share a previous message with one person to another person later or can it be emailed

    How do I forward a message to another contact or email it?

    Hi Valjeannebluejeanqueen,
    Happy New Year, and welcome to the Support Communities!
    The link below for the iPad User Guide will show you how to forward a text message:
    Manage conversations - iPad User Guide
    http://help.apple.com/ipad/7/#/iPad99acb44a
    Forward a conversation. Select the conversation, touch and hold a message, tap More, select the parts to include, then tap the forward arrow.
    Cheers,
    - Judy

  • HI Can I add a child node to an Element Node with a name that  exists

    HI,
    Can I add a child node to an Element Node with a name that is already existing in the Element Node.
    Let me explain what I need exactly.
    My Existing element Node looks like this:
    <form>
    <name>
    <FirstName></FirstName>
    <LastName></LastName>
    </name>
    </form>
    Can I add another child node with hte name 'FirstName' to the 'name' node ..?
    I want to put a attribute rvsn with a value 1 for the original 'FirstName' element Node.
    so the new Element Node should look like the foloowing:
    <form>
    <name>
    <FirstName rvsn="1"></FirstName>
    <FirstName></FirstName>
    <LastName></LastName>
    </name>
    </form>
    Hopefully this is valid XML !!
    when I tried to use appendChild, it removed the previous node and put the new one. Thats what is the documentation also said.. I read it after I tried it :(
    Anyway, ther should be another way to add a node like that.
    Any hints, ideas will be of great help.
    -Thanks in advance !!
    Murthy

    // this method will start marking the old values with a revision number.
         private void saveNodeDetails (Node node) {
    String Content = "";
    String nodeName = "";
    int rvsn = getRvsn();
    int type = node.getNodeType();
    int tempRvsn = 0;
    String tempNodeName = "";
    String tempParentNodeName = "";
    Node tempParentNode = null;
    // check if element
    if (type == Node.ELEMENT_NODE) {
    Node traverseNode = node;
    nodeName = getNodeName(traverseNode);
    if (nodeName != null && nodeName.trim().length() > 1)
    nodeName = nodeName.substring(0, nodeName.length() - 1);
    if (_debug)
    System.out.print("2. ELEMENT_NODE name## " + nodeName);
    // if the element has no children, its leaf node.
    // if its there in the Hashtble, then update the value from the hashtable.
    if (reqParams.containsKey(nodeName)) {
    if (_debug) System.out.println("3. Hash Value = " + reqParams.get(nodeName).toString());
    if (traverseNode == null)
    if (_debug) System.out.println("3A. traverseNode == null ");
    if (node == null)
    if (_debug) System.out.println("3B. node == null ::(((((");
    // get the node children
    NodeList children = node.getChildNodes();
    // end of getting children for the Node.
    if (_debug) System.out.println("4. Got ChildNodes ");
    if (children != null) {
    int length = 0;
    length = children.getLength();
    if (_debug) System.out.println("5. Got children Length = " + length);
    if( ((Element) node).hasAttribute("rvsn") ){
    System.out.println(" node has Attribute(rvsn) ");
    tempRvsn = Integer.parseInt( ((Element) node).getAttribute("rvsn") );
    if( tempRvsn == rvsn){
    // user is changing the same data again and again.
    // so remove the text node and append the new value as text node finally
    for (int index = 0; index < length; index++) {
    if (_debug) System.out.println("6. index = " + index);
    if (_debug) System.out.println(index + ": children.item( index )@saveNodeDetails@ContainerDoc = " + children.item(index).getNodeType() + " -- " + children.item(index).getNodeValue());
    if (children.item(index).getNodeType() == Node.TEXT_NODE)
    node.removeChild(children.item(index));
    }else{
    int l= 0; // do not do any thing if the current node rvsn is different from the rvsn of the DOM
    // programme logic could enter this part when ther are multiple revisions of the NODe in the DOM,
    // and we are traversing through the previous versions of it.
    } else{
    System.out.println(" node has no Attribute(rvsn) ");
    // the node has no rvsn attribute.
    // it is the initial version of the dom.
    // add the rvsn from the DOM to this NODE for the first time.
    ((Element) node).setAttribute("rvsn", (new Integer(rvsn)).toString() );
    // get parent node and add a new child node with the same name as current node.
    // so parent node will have the previous node with a rvsn and a new node without the rvsn !!
    tempNodeName = node.getNodeName();
    tempParentNode = node.getParentNode();
    tempParentNodeName = tempParentNode.getNodeName();
    System.out.println(" adding node: " + tempNodeName + " to : " + tempParentNodeName);
    node = addNode(tempParentNode, tempNodeName, "");
    getNodeName(node); // print the name of the node after modifying it !!!
    printSiblings(node);
    //System.out.println(" After adding the node : " + getNodeName(node));
    } else if (_debug) {
    System.out.println("7. Node name exist in the Hash but has no children to be removed..!!:: @saveNodeDetails ");
    if (_debug) System.out.println("7B. Update the dom from the hash value " + nodeName + ", " + reqParams.get(nodeName).toString());
    node.appendChild(document.createTextNode(reqParams.get(nodeName).toString()));
    if (node != null) {
    if ( ( (Element) node).hasAttribute("rvw"))
    ( (Element) node).removeAttribute("rvw");
    if ( ( (Element) node).hasAttribute("msg"))
    ( (Element) node).removeAttribute("msg");
    if ( ( (Element) node).hasAttribute("dor"))
    ( (Element) node).removeAttribute("dor");
    }// end of if (type == Node.ELEMENT_NODE)
    NodeList children = node.getChildNodes();
    if (children != null) {
    for (int i = 0; i < children.getLength(); i++) {
    saveNodeDetails(children.item(i));
         } // end of saveNodeDetails method
    public Node addNode(Node parentNode, String nodeName, String value){
    Node newNode = null;
    try{
    newNode = parentNode.appendChild( document.createElement(nodeName) );
    newNode.appendChild( document.createTextNode( value ) );
    }catch(Exception Ex){
    System.out.println("2. Exception@addNode@ContainerDoc = " + Ex);
    return newNode ;
    } // end of addNode method

Maybe you are looking for