Method to remove a given node from the list?

Anybody know how to do it?

import java.util.Iterator;
import java.util.HashSet;
import java.util.Set;
* A doubly linked list as introduced in lecture 6 in IN2002. Template for
* coursework 2a in 2006.
public class DLList implements Iterable {
     * Inner class for doubly linked list nodes.
     class DLNode {
          Object info; // the data element
          DLNode next; // the next node
          DLNode prev; // the previous node
          DLNode(Object argInfo) {
               info = argInfo;
     private DLNode head, tail;
     private int count;
     * Appends an object at the tail of this list.
     * @param argOb The object to append.
     public void appendAtTail(Object argOb) {
          DLNode node = new DLNode(argOb); // new node
          if (tail == null) { // empty list
               tail = node;          // set the tail
               head = tail;     // and head
          } else {               // non-empty list
               tail.next = node; // connect the
               node.prev = tail;     // new node
               tail = node;          // set the tail
          count++;               // udpate count
     * Deletes the given node maintaining the list structure.
     * @param node The node to delete, must be in the list.
     private void delete(DLNode node) {
..............................???

Similar Messages

  • Accidentally removed a purchased app from the list

    Accidently removed an app from the purchased list. How do I get it back on the list.
    Alos is there a way to get App Store from continually saying that this app needs to be updated when in fact it is?
    Allan

    The Apple Support Communities are an international user to user technical support forum. As a man from Mexico my first language is Spanish. I do not speak English, however I do write in English with the aid of the Mac OS X spelling and grammar checks. I also live in a culture perhaps very very different from your own. When offering advice in the ASC, my comments are not meant to be anything more than helpful and certainly not to be taken as insults.
    If you clicked the X on the line with the app's name on the Purchased pane, you have hidden the app in the list. Select Account in the Quick Links to the right of the Mac App Store on the Featured pane and you will find a section in your account details to manage hidden apps.
    The other issue appears to be a glitch some folks encounter in the MAS that is hard to track down. You can try eliminating cache files associated with the MAS and try to track it down or if you plan to upgrade to Mt Lion later this month hope that will eliminate the problem.

  • Delete file from the list & as well as from file upload

    I have come across a situation where there is a sap.ui.unified.FileUploader & user is free to upload as many file selected. then there is a button to display the list of added files as list(deleteable list). list delete is possible by using the standard function provided in the explored of SAP UI5 SDK document. but how to bind both the controls?? do that at the time of deleting the list it will also delete the files added in FileUploader. attaching the screenshot for better understanding...
    SAP UI5 Version 1.24.3

    Hi,
    you can use the setValue() method when you delete a file from the list:
    oFileUploader.setValue("");
    Kind regards,
    RW

  • How to hide a tree node from the GUI but still keep it in the tree model?

    Hi, All
    I used a JTree in my project in which I have a DefaultTreeModel to store all the tree structure and a JTree show it on the screen. But for some reason, I want to hide some of the nodes from the user, but I don't want to remove them from the tree model because later on I still need to use them.
    I searched on the web, some people suggested method to hide the root node, but that's not appliable to my project because I want to hide some non-root nodes; Some people also suggested to collapse the parent node when there are child to hide, it is not appliable to me either, because there still some other childnodes (sibling of the node to hide) I want to show.
    How can I hide some of the tree node from the user? Thanks for any information.
    Linda

    Here's an example using a derivation of DefaultTreeModel that shows (or does not show) two types of Sneech (appologies to the good Dr Zeus) by overiding two methods on the model.
    Now, there are many things wrong with this example (using instanceof, for example), but it's pretty tight and shows one way of doing what you want.
    Note: to make it useful, you''d have to change the implementation of setShowStarBelliedSneeches() to do something more sophisticated than simply firing a structure change event on the root node. You'd want to find all the star bellied sneech nodes and call fireTreeNodesRemoved(). That way the tree would stay expanded rather than collapse as it does now.
    import javax.swing.JTree;
    import javax.swing.JScrollPane;
    import javax.swing.JOptionPane;
    import javax.swing.JCheckBox;
    import javax.swing.JPanel;
    import javax.swing.tree.TreePath;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.DefaultMutableTreeNode;
    import java.awt.Dimension;
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.Enumeration;
    class FilteredTree
         private class PlainBelliedSneech {
              public String toString() { return "Plain Bellied Sneech"; }
         private class StarBelliedSneech {
              public String toString() { return "Star Bellied Sneech"; }
         private class FilteredTreeModel
              extends DefaultTreeModel
              private boolean mShowStarBelliedSneeches= true;
              private DefaultMutableTreeNode mRoot;
              FilteredTreeModel(DefaultMutableTreeNode root)
                   super(root);
                   mRoot= root;
              public Object getChild(Object parent, int index)
                   DefaultMutableTreeNode node=
                        (DefaultMutableTreeNode) parent;
                   if (mShowStarBelliedSneeches)
                        return node.getChildAt(index);
                   int pos= 0;
                   for (int i= 0, cnt= 0; i< node.getChildCount(); i++) {
                        if (((DefaultMutableTreeNode) node.getChildAt(i)).getUserObject()
                                            instanceof PlainBelliedSneech)
                             if (cnt++ == index) {
                                  pos= i;
                                  break;
                   return node.getChildAt(pos);
              public int getChildCount(Object parent)
                   DefaultMutableTreeNode node=
                        (DefaultMutableTreeNode) parent;
                   if (mShowStarBelliedSneeches)
                        return node.getChildCount();
                   int childCount= 0;
                   Enumeration children= node.children();
                   while (children.hasMoreElements()) {
                        if (((DefaultMutableTreeNode) children.nextElement()).getUserObject()
                                            instanceof PlainBelliedSneech)
                             childCount++;
                   return childCount;
              public boolean getShowStarBelliedSneeches() {
                   return mShowStarBelliedSneeches;
              public void setShowStarBelliedSneeches(boolean showStarBelliedSneeches)
                   if (showStarBelliedSneeches != mShowStarBelliedSneeches) {
                        mShowStarBelliedSneeches= showStarBelliedSneeches;
                        Object[] path= { mRoot };
                        int[] childIndices= new int[root.getChildCount()];
                        Object[] children= new Object[root.getChildCount()];
                        for (int i= 0; i< root.getChildCount(); i++) {
                             childIndices= i;
                             children[i]= root.getChildAt(i);
                        fireTreeStructureChanged(this, path, childIndices, children);
         private FilteredTree()
              final DefaultMutableTreeNode root= new DefaultMutableTreeNode("Root");
              DefaultMutableTreeNode parent;
              DefaultMutableTreeNode child;
              for (int i= 0; i< 2; i++) {
                   parent= new DefaultMutableTreeNode(new PlainBelliedSneech());
                   root.add(parent);
                   for (int j= 0; j< 2; j++) {
                        child= new DefaultMutableTreeNode(new StarBelliedSneech());
                        parent.add(child);
                        for (int k= 0; k< 2; k++)
                             child.add(new DefaultMutableTreeNode(new PlainBelliedSneech()));
                   for (int j= 0; j< 2; j++)
                        parent.add(new DefaultMutableTreeNode(new PlainBelliedSneech()));
                   parent= new DefaultMutableTreeNode(new StarBelliedSneech());
                   root.add(parent);
                   for (int j= 0; j< 2; j++) {
                        child= new DefaultMutableTreeNode(new PlainBelliedSneech());
                        parent.add(child);
                        for (int k= 0; k< 2; k++)
                             child.add(new DefaultMutableTreeNode(new StarBelliedSneech()));
                   for (int j= 0; j< 2; j++)
                        parent.add(new DefaultMutableTreeNode(new StarBelliedSneech()));
              final FilteredTreeModel model= new FilteredTreeModel(root);
              JTree tree= new JTree(model);
    tree.setShowsRootHandles(true);
    tree.putClientProperty("JTree.lineStyle", "Angled");
              tree.setRootVisible(false);
              JScrollPane sp= new JScrollPane(tree);
              sp.setPreferredSize(new Dimension(200,400));
              final JCheckBox check= new JCheckBox("Show Star Bellied Sneeches");
              check.setSelected(model.getShowStarBelliedSneeches());
              check.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        model.setShowStarBelliedSneeches(check.isSelected());
              JPanel panel= new JPanel(new BorderLayout());
              panel.add(check, BorderLayout.NORTH);
              panel.add(sp, BorderLayout.CENTER);
              JOptionPane.showOptionDialog(
                   null, panel, "Sneeches on Beeches",
                   JOptionPane.DEFAULT_OPTION,
                   JOptionPane.PLAIN_MESSAGE,
                   null, new String[0], null
              System.exit(0);
         public static void main(String[] argv) {
              new FilteredTree();

  • I 'd like to know regarding a method to separate a standby node from CE

    Hi community
    I have a question regarding a method to separate a standby node from CE.
    I would like  to know if it is possible to run the vary off command on standby node while active instance is working.
    For example,
    -shutdown standby instance on standby server.
    -run vary off and exportvg command on standby node while active instance is working.
    Version Info
    -OS : AIX 6.1
    -DBMS : Sybase CE 15.5 with 2Node
    -Shared Volumn : DS8700 ( 4TB )
    In this case, I would like to know if there is any side effect on Active instance.
    Our CE version is ASE15.5 ESD5.3 on AIX.
    Thanks in advance
    Regards
    Taiwoo Kim

    To make sure I understand, you have a two node ASE cluster....one of which is active, the second is idle.   You want to detach (for some reason) the disks from the second node of the cluster.
    From the cluster viewpoint, provided you shutdown the ASE instance on that node and don't run any cluster utilities on that node (e.g. sybcluster, quorumutil, etc.) - then whether the disks are attached or not is likely not going to be an issue.   It would be no difference to the surviving node than if you shutdown the other node completely (host included).
    What concerns me is that you obviously are planning something that affects that volume group - e.g. moving it to a new machine???    Swapping HW???  Updating OS volume management firmware???   If swapping HW, remember, the quorum has the list of participants in the cluster - so unless the new hardware hostname/ipaddr matches the old, you will need to modify the quorum entries (TechSupport can help with this) - although the better approach would be to build a new node of the cluster on the new HW (temporarily a 3 node cluster) and then remove the old node from the cluster.    If updating OS firmware, just be careful that the patch doesn't cause problems with IO fencing by changing the SCSI PGR versions or something.

  • How can I  remove my credit card from the automatic billing for my account?

    How can I remove my credit card from the automatic billing for my account?

    The following has instructions for changing iTunes payment method: http://support.apple.com/kb/ht1918

  • 3750x Stack UTIL-3-TREE: Data structure error--attempt to remove an unthreaded node from a tree

    A Cisco Stack 3750X switch report the following error message:
    %UTIL-3-TREE: Data structure error--attempt to remove an unthreaded node from a tree.
    every minute +-20 sec
    Cisco IOS Software, C3750E Software (C3750E-IPBASEK9-M), Version 15.0(2)SE4, RELEASE SOFTWARE (fc1)
    analog bug: https://tools.cisco.com/bugsearch/bug/CSCsz93221

    WS-C3750G-24PS-E C3750-IPBASEK9-M version 12.2(53)SE2
    After implementing 802.1x with Avaya IP phones
    %UTIL-3-TREE: Data structure error--attempt to remove an unthreaded node from a tree
    Port then fails authentication and goes into vl-err-dis

  • How to remove a static class from the Runtime of the JVM

    I want to remove a static class from the Runtime of the JVM.
    My goal is to clear the cache of the "InetAddress.getByName(String host)" static method.
    Thanks in advance.
    Floweb

    Sorry, It means a class that has been loaded in the JVM by the call to a static method......
    Floweb

  • How do I remove an old username from the app store when using the update function

    How do I remove an old username from the app store when using the update function.
    I purchased my Mac used.  The former owners username prepopulates when I try to perform the updated function on the app store.  It does not allow me to use a different user name.    I have created my own username and password.  I have even been able to purchase items from the app store, it's just when I use the update function it does populate with my username.  Any help is appreciated.

    The first thing to do with a second-hand computer is to erase the internal drive and install a clean copy of OS X. You — not the previous owner — must do that. How you do it depends on the model, and on whether you already own another Mac. If you're not sure of the model, enter the serial number on this page. Then find the model on this page to see what OS version was originally installed.
    1. You don't own another Mac.
    If the machine shipped with OS X 10.4 or 10.5, you need a boxed and shrink-wrapped retail Snow Leopard (OS X 10.6) installation disc from the Apple Store or a reputable reseller — not from eBay or anything of the kind. If the machine has less than 1 GB of memory, you'll need to add more in order to install 10.6. Preferably, install as much memory as it can take, according to the technical specifications.
    If the machine shipped with OS X 10.6, you need the installation media that came with it: gray installation discs, or a USB flash drive for some MacBook Air models. For early MBA models, you may need a USB optical drive or Remote Disc. You should have received the media from the previous owner, but if you didn't, order replacements from Apple. A retail disc, or the gray discs from another model, will not work.
    To boot from an optical disc or a flash drive, insert it, then reboot and hold down the C key at the startup chime. Release the key when you see the gray Apple logo on the screen.
    If the machine shipped with OS X 10.7 or later, you don't need media. It should boot into Internet Recovery mode when you hold down the key combination option-command-R at the startup chime. Release the keys when you see a spinning globe.
    2. You do own another Mac.
    If you already own another Mac that was upgraded in the App Store to the version of OS X that you want to install, and if the new Mac is compatible with it, then you can install it. Use Recovery Disk Assistant to create a bootable USB device and boot the new Mac from it by holding down the C key at the startup chime. Alternatively, if you have a Time Machine backup of OS X 10.7.3 or later on an external hard drive (not a Time Capsule or other network device), you can boot from that by holding down the option key and selecting it from the row of icons that appears. Note that if your other Mac was never upgraded in the App Store, you can't use this method.
    Once booted in Recovery, launch Disk Utility and select the icon of the internal drive — not any of the volume icons nested beneath it. In the Partition tab, select the default options: a GUID partition table with one data volume in Mac OS Extended (Journaled) format. This operation will permanently remove all existing data on the drive.
    After partitioning, quit Disk Utility and run the OS X Installer. You will need the Apple ID and password that you used to upgrade. When the installation is done, the system will automatically reboot into the Setup Assistant, which will prompt you to transfer the data from another Mac, its backups, or from a Windows computer. If you have any data to transfer, this is usually the best time to do it.
    Then run Software Update and install all available system updates from Apple. To upgrade to a major version of OS X newer than 10.6, get it from the Mac App Store. Note that you can't keep an upgraded version that was installed by the previous owner. He or she can't legally transfer it to you, and without the Apple ID you won't be able to update it in Software Update or reinstall, if that becomes necessary. The same goes for any App Store products that the previous owner installed — you have to repurchase them.
    If the previous owner "accepted" the bundled iLife applications (iPhoto, iMovie, and Garage Band) in the App Store so that he or she could update them, then they're linked to that Apple ID and you won't be able to download them without buying them. Reportedly, Apple customer service has sometimes issued redemption codes for these apps to second owners who asked.
    If the previous owner didn't deauthorize the computer in the iTunes Store under his Apple ID, you wont be able to  authorize it immediately under your ID. In that case, you'll either have to wait up to 90 days or contact iTunes Support.

  • How can I remove a mailbox address from the "From" drop down box in a new e-mail my old e-mail address continue to populate as the sender address

    How can I remove a mailbox address from the "From" drop down box in a new e-mail my old e-mail address continue to populate as the sender address

    Hello,
    Try Mail>Preferences>Accounts icon>Account Information tab>Click on the Outgoing SMTP server drop down, choose edit Server list, highlight the old one & click Remove.
    (Such convolution is worthy of Windows® in my estimation)

  • How to remove available downloads from the list

    how to remove available downloads from the list without it resuming when i open itunes or check for available downloads?

    There is not a way to remove them from the list.  Just let them download, and then delete them from your library when they are done.

  • Can I remove a SPECIFIC file from the "Recents" list?

         As far as I can see, Adobe Reader for Android has only the option of clearing ALL the files in the "Recents" list. It doesn't have the option of removing a specific file from the "Recents" list.
         Maybe I'm just missing the option I'm talking about or Adobe Reader doesn't really have that feature.
         Sensible answers to my question will be greatly appreciated. Thanks!

    Hi iSTULIN
    I assume you can delete the complete list, not the single file ...
    Please check the below link : http://blogs.adobe.com/readermobile/2011/09/09/faqs-for-adobe-reader-on-android/
    You can raise a feature request on the below link : https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

  • How do I stop my MacBook removing all my icons from the desktop ?

    How do I stop my MacBook removing all my icons from the desktop ?

    Hi Matt
    After I create say a word document, file it on my desktop and then shut down my machine. The next time I open up the MacBook the file icon has been removed from the desktop. I can still retrieve the file in a folder labeled with the month I created it. But why has the OS removed it from the desktop and how can I stop it happening?
    It happens to alias icons as well!
    Regards

  • How do you remove back up data from the memory storage? my storage data states that i have over 80gb of data used for back ups and i dont know why as i use a external hard drive as a time machine .now my 250gb flash storage is nearly full

    how do you remove back up data from the memory storage? my storage data states that i have over 80gb of data used for back ups and i dont know why as i use a external hard drive as a time machine .now my 250gb flash storage is nearly full.. HELP!

    When Time Machine backs up a portable Mac, some of the free space will be used to make local snapshots, which are backup copies of recently deleted files. The space occupied by local snapshots is reported as available by the Finder, and should be considered as such. In the Storage display of System Information, local snapshots are shown as  Backups. The snapshots are automatically deleted when they expire or when free space falls below a certain level. You ordinarily don't need to, and should not, delete local snapshots yourself. If you followed bad advice to disable local snapshots by running a shell command, you may have ended up with a lot of data in the Other category. Ask for instructions in that case.
    See this support article for some simple ways to free up storage space.

  • How do I remove my iWeb pages from the Home folder so I can publish to a new host?

    I have moved my MobileMe site to a new service (GoDaddy).  The basic transfer went very smoothly.  With one tiny hitch:  the new URL text.
    IWeb places web  pages in folders, each folder being a  "site." The name of the root folder automatically becomes a "pointer" to the web site -- and part of the URL text.
    My current root folder  is named DavidChartrand -- me.  So..... when I published everything over to GoDaddy the text "DavidChartrand" was attached to my URL. 
    Instead of seeing www.davidchartrand.com in the URL bar, visitors  see:   www.davidchartrand.com.com/DavidChartrand
    GoDaddy staff says this is simply a quirk in iWeb's design.  Fine, but it's annoying.  Is there anyway I can keep using iWeb but somehow remove the root folder.....that is, remove my site pages from the root folder and and then re-publish? GoDaddy tech support swears it  has many former MobileMe/iWeb users who have done this successfully but offered had no idea how.
    David

    The way iWeb publishes its websites, in its own folder, the normal URL is http://www.domain_name.com/Site_name/Page_name.html.  This is a normal URL for any web host.
    If you want to get rid of the site name you will need to publish your website to a folder on your hard drive and upload only the contents of the website folder to your server with a 3rd party FTP client like YummyLite, Transmit or Cyberduck.  That will get rid of the site name in the URL. 
    Of course remove the existing website foldr from the server beforehand.
    I believe the folder you publish to on GoDaddy is named public_html.  You might try renaming your website to "public_html" and publish to GoDaddy.  In theory iWeb will see the website's folder already on the server and publish the website file into it. 
    It works that way with HostExcellence.com which names the home folder the same as the domain name associated with it. This tutorial explains more about it: iW16 - Using HostExcellence.com with iWeb
    OT

Maybe you are looking for