Need to reenumerate Vector after removing element(s)?

Hi,
I'm using a Vector to hold a collection of Hashtables, and periodically I call a cleanup routine on the Vector as the contents change quite frequently. My question is: after I enumerate the Vector in order to walk through its contents to remove any Hashtables that are no longer needed, if I remove a hashtable do I need to reenumerate the Vector? Or will the removal of the Hashtable not affect the enumeration indices?
Pseudo-Code example.....
Vector v;
Enumeration e = v.elements();
while(e.hasMoreElements()){
Hashtable h = (Hashtable)e.nextElement();
if(h needs to be removed){
v.remove(h);
Any help is greatly appreciated.

yes, the Vector needs to be reenumerated, but a better approach is to not use Vectors for a collection that frequently changes.

Similar Messages

  • Do I need an account to place Photoshop elements on a new computer after deactivating or will the serial number suffice?

    di I need an account to place photoshop elements on a new computer after deactivating or will the serial number suffice?

    PSE only requires a serial number.
    Mylenium

  • Is it possible to rearrange the elements in a List after removing indexes?

    Hello,
    I am hoping someone can help me out w/a question.
    I have a list
    List<String>  Labels = new ArrayList<String> ();and I add 3 elements in the list
    labels.add("one"); //index 0
    labels.add("two"); //index 1
    labels.add("three");  //index 2Later on in the program I remove 2 indexes,
    labels.remove(0);
    labels.remove(2);When i try to iterate through labels it throws
    Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 1, Size: 1I perfectly understand the error. My question is this: after removing the indexes, how can i rearrange the list so that the one element that is left (currently at index 1) is set at index 0 so that it doesn't throw an exception ? is this doable ?
    Thanks very much for your help!!

    va97 wrote:
    Hello,
    I am hoping someone can help me out w/a question.
    I have a list
    List<String>  Labels = new ArrayList<String> ();and I add 3 elements in the list
    labels.add("one"); //index 0
    labels.add("two"); //index 1
    labels.add("three");  //index 2Later on in the program I remove 2 indexes,
    labels.remove(0);
    labels.remove(2);
    This doesn't work!
    Before those call the List looks like this:
    [one, two, three].
    After you call remove(0), it will look like this:
    [two, three]
    Now, when you try to call remove(2), it will throw an IndexOutOfBoundsException, as there is nothing at index 2 anymore.
    I perfectly understand the error. My question is this: after removing the indexes, how can i rearrange the list so that the one element that is left (currently at index 1) is set at index 0 so that it doesn't throw an exception ? is this doable ?I'm afraid you don't understand the error message correctly, since then your question would be different.
    The error message says "you tried to access something at index 1, but this list only is of size 1". This means that the only valid index at that moment is 0.

  • Deactivate "insert element before / remove element" in array

    Hello guys.
    It is possible to deacitvate "insert element before / remove element" function appears after right-click on a array in the frontpanel?
    "Description and Tip" should stay.
    Thank you.
    Alex
    Solved!
    Go to Solution.

    You can customize the right-click shortcut menu to remove some application items and keep others:
    Right-click on the array (and not on the array element!) in the front panel and select Advanced->Run-Time Shortcut Menu->Edit...
    This brings up the Shortcut Menu Editor:
     Change the drop-down control from "Default" to "Custom".
     Select the "???" line in the tree control on the left.
     on the right, change the Item Type from "User Item" to "Application Item -> Description and Tip..."
     It will automatically fill in the corrent Name and Tag.
     Save the rtm either into its own file or into the control.
     LV will automatically handle application items in the control, no event case needed.
     I sometimes find the "Copy entire menu" function of the shortcut menu pretty useful if I only want to disable a few items.
    http://zone.ni.com/reference/en-XX/help/371361G-01/lvconcepts/customizing_vis/#Customizing_Menus
    -Barrett
    CLD

  • I have installed elements 11. should i remove elements 8.

    i have installed photoshop elements 11. is it safe to remove elements 8?

    yes.
    to install an upgrade, you need either the serial number of the upgraded program or, the upgraded program needs to be installed. 
    in either case, the upgraded program does not need to be installed after the upgrade completes installation.

  • HELP! I need to be able to remove power from a PXI chassis and replace a card without rebooting the whole system

    I do not have particulars on the controller, but I am sure it's an NI chassis
    and NI regular controller that has a serial cable leading back to the PC.
    I am making this PXI rack into a debug rack for instrument cards,
    so I need to be able to remove power from just the PXI chassis
    and then replace the card with another one
    or the same one and then turn the power back on and restart a
    diagnostic test on the card WITHOUT
    having to reboot the PC.
    Is there a PCIe bridge setup that would allow me to do this?
    Is there software that I need that can accomplish this?

    Yes
    The Chassi is a NI PXI 1045
    and the controller is a NI-PXI-8331
    Let me re-enumerate my requirements:
    Background:
    I have a number of NI cards as well as other manufactured cards in the system.
    One of these cards in the NI system is considered to be a UUT.
    That is, I am using the NI card cage system and other cards in the system to test a CARD
    during a manufacturing test of said UUT CARD.
    The UUT uses a PLX 9030 for it's PCI interfacing.
    This UUT is not designed for hot swap, and I do not bieleve it is plug and play.
    Requirement:
    1. I need to be able to shut off the chassis and remove the UUT when the test finishes, replace the tested UUT
    with a unknown UUT, re-apply power and then test the new UUT WITHOUT having to reboot the PC.
    I have tried several things, such as disabling the PCIe busses in the windows control panel, and then removing power
    replacing the UUT with the next one, re-applying chassis power and then re-enabling the bus and SOMETIMES it works.
    I need a very robust way to do this.
    I also bought a CHROMA PXI-52906-E extender card with bus switches on it, so that I can remove power to the UUT
    without shutting off the chassis. The card is supposedley designed so that when power is re-applied to the UUT, the necessary
    signals to boot the PXI PCI interface is conducted, but I think something else has to be written to the card's PCI registers.
    I am by no means an expert in PCI/PXI, 
    but I seem to have exhausted all of my reserach online in how to meet my requirements.
    Perhaps there is a way for the NI8331 controller to capture PCI configuration data to the card's on system boot,
    and then "replay it" to my UUT after I re-apply power to the UUT?
    Or perhaps PLX makes such a tool?
    Any ideas?

  • Is there a way to remove elements from an array 1 by 1?

    I have an two arrays, and they vary in size depending on a parameter set by the user (both arrays are the same size though, they both can vary in length). What I need to do, is remove elements one by one from the array, and use these as indices for another array. Basically, I built two arrays to store x-values on a graph. At the first value on the first array, I want y values on the graph to move from 0 to Y (any value). Then on the first value on the second array, I want the y values to move back from Y to 0 (creating a pulse, essentially, from the first value on the first array and the first value on the second array). By having each x value act as an indice for the y array, I belive I can acc
    omplish this (ie, y =0 up to indice 90, then y = 5, then at indice 100, y goes back to equaling 0). I know this is poorly phrased, but it's difficult to explain. If anyone could help me out, I'd really appreciate it.

    jdaltonnal,
    Note: to add an attachment based on your comment of 6/12/01 to my earlier reply, I had to go back to this 'answer' mode, which gives me the option of adding attachments.
    Per your comment, you have a sequence, so I've added a simple sequence structure and the 2nd array to provide a 250ms delay between each array output. Let me know...Doug
    Attachments:
    arrayindexplus1withseqdelays.vi ‏27 KB

  • Please help: After removed a connector (nagios-connector) there is an error at the operations Manager Console

    Hello,
    after installing the nagios connecor and it doesn'work, i  try to remove it; with the powershell command remove-SCOMConnector. After removing it, Get-SCOMConnector shows me, that it doesn't exist:
    PS D:\> Get-SCOMConnector
    Name        : Network Monitoring Internal Connector
    DisplayName : Connector for populating network devices.
    Description :
    Initialized : False
    Name        :
    DisplayName :
    Description :
    Initialized : True
    Name        : SMASH Discovery Internal Connector
    DisplayName : Connector for populating SMASH devices.
    Description :
    Initialized : False
    Name        : Operations Manager Internal Connector
    DisplayName : A connector used by Operations Manager components to insert discovery data, please create your own connec
                  tor do not use this connector.
    Description :
    Initialized : False
    But when i take a look to the connectors in Operations Manager Console, it hangs, after a while i have this error:
    Date: 27.05.2014 10:04:43
    Application: Operations Manager
    Application Version: 7.1.10226.0
    Severity: Error
    Message: 
    System.NullReferenceException: Object reference not set to an instance of an object.
       at Microsoft.EnterpriseManagement.ConnectorFramework.EnterpriseManagementConnector.Reconnect(EnterpriseManagementGroup managementGroup)
       at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.GetUpdate(IndexTable indexTable, QueryUpdate`1 update, CacheCursor cursor, Range range, Int32 offset, Int32 groupLevel)
       at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.QueryCache`2.GetUpdate(IndexTable indexTable, QueryUpdate`1 update)
       at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.QueryCache`2.GetUpdate(CacheSession session, Boolean fullUpdate)
       at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.QueryCache`2.FireUpdateEvent(CacheSession session, DateTime updateTime, Boolean dataChanged, Boolean fullUpdate, Boolean updatesOnly, IEnumerable queryResult)
       at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.FireUpdateEvents(CacheSession session, Boolean dataChanged, Boolean fullUpdate, ICollection`1 queryResult)
       at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.PostQuery(CacheSession session, IndexTable indexTable, UpdateReason reason, UpdateType updateType, Boolean dataChanged, DateTime queryTime, ICollection`1 queryResult)
       at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.InternalSyncQuery(CacheSession session, IndexTable indexTable, UpdateReason reason, UpdateType updateType)
       at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.InternalQuery(CacheSession session, UpdateReason reason)
       at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.TryDoQuery(UpdateReason reason, CacheSession session)
       at Microsoft.EnterpriseManagement.Mom.Internal.UI.Console.ConsoleJobExceptionHandler.ExecuteJob(IComponent component, EventHandler`1 job, Object sender, ConsoleJobEventArgs args)
    Can somebody help me fixing this error?
    Strange.. the powerShell Command "get-SCOMConnector" works.. but the console hangs (on loading) when i want to show the connectors...
    Kind regards
    Wolfgang

    Hi,
    I agree, we may need to remove the connector from OpsDB. In addition, here is blog regarding to the similar issue, hope it helps:
    Error: “Object reference not set to an Instance of an Object” System Center Operation Manager 2012 Connector.
    http://blogs.technet.com/b/birojitn/archive/2012/07/07/error-object-reference-not-set-to-an-instance-of-an-object-system-center-operation-manager-2012-connector.aspx
    Regards,
    Yan Li
    Regards, Yan Li

  • Hi,   My photo stream used to work fine.  But after removing all the photos to separate folders in my computer, my new photos are no longer streaming to my PC.  They appear in the photo stream on my other devices - iPhone5 and iPad Mini.  It's just my PC

    Hi,
    My photo stream used to work fine.  But after removing all the photos to separate folders in my computer, my new photos are no longer streaming to my PC.  They appear in the photo stream on my other devices - iPhone5 and iPad Mini.  It's just my PC that's missing the photos.
    When I open the iCloud control panel, I cannot turn on the photos.  That option is ghosted.  I'm running on Windows 7 with iCloud 3.0.  Any ideas on how I can fix this?  All help is appreciated!  Thanks!

    Hi Kevinmvb,
    Welcome to the Support Communities!
    The article below may be able to help you with this.  It sounds like you may have moved your photos out of the Uploads folder where they need to reside.
    iCloud: My Photo Stream troubleshooting
    http://support.apple.com/kb/TS3989
    Cheers,
    - Judy

  • I need to uninstall downloaded version of Elements 12 on a computer, then install Elements 12 on the same computer directly from a disk. Elements 11 was previously used on same computer, and the albums and library had been moved to the first installation

    I need to uninstall downloaded version of Elements 12 on a computer, then install Elements 12 on the same computer directly from a disk. Elements 11 was previously used on same computer, and the albums and library had been moved to the first installation of 12, which I am removing. How do I correctly unstall the old Elements 12, and install the new elements 12 from disk, and retain all albums and libraries from the old Elements 12?

    You're welcome.  It was not an answer, it was a question, and it could lead to being helpful if you explain why you think you need to uninstall.
    As far as uninstalling goes, you will uninstall it like you do for any program, which depends on what kind of operating system you have.  If you wish to retain albums and whatnot, maybe the following link can provide some guidance.
    Photoshop Elements Help / Use Backup, Restore to move catalog | Organizer | Elements 6 or later
    http://helpx.adobe.com/photoshop-elements/kb/backup-restore-move-catalog-photoshop.html#ma in_Special_notes_if_you_restore_a_catalog_from_a_previous_version_of_Photoshop_Elements

  • Javascript array ;Add and remove elements without using push and pop

    Hi
     I need to perform add and remove  operation in Javascript with following scenarios
    i) Add element, if element does not exist in array(javascript)
    ii) Remove element, if element exist in array(javascript)
    Without using push and pop method how to achieve this?
    Regards
    Siva

    Completed the Scenario.

  • What is the best way to remove elements 10 from one pc and install it on another?

    What steps need to be taken to remove Adobe Elements 10 from one pc and install it on another?

    Use back up and restore from the Organizer menu. You are permitted two activations so no real need to deactivate the old copy unless you have installed it previously on another machine.
    See these instructions for PSE6 and above.
    http://helpx.adobe.com/photoshop-elements/kb/backup-restore-move-catalog-photoshop.html

  • Need to take the N-th element from a queue

    hello everyone!
    I have a problem, i don't know how to take ony one element from a queue...
    Indeed, i need to take only the 3rd element of a queue but i don't know how to do that... so i though maybe i can change it as an array (with the vi "flush queue") and then take the 3rd element of this new array but same problem, i don't know how to manage that!
    please help me, i have been trying to solve this problem all day long
    thank you very much!
    Yanis

    I am not sure if there is a more elegant solution but what I have done in the past in similar situations was to get all elements of the queue with the queue status. Then I would flush the queue and pop any elements I wanted back on the queue while removing the items I needed/wanted. As I say, this is not the most elegant but it is a tried and true method. If your elements are fairly small and you don't have lots of elements on the queue the performance hit is not too terrible.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • I need to reinstall CS5 on a machine that has had to be reformatted, i need a Support Code after obtaining the Challenge Code. Please help

    I need to reinstall CS5 on a machine that has had to be reformatted, i need a Support Code after obtaining the Challenge Code. My email address is <removed - kglad>
    Please help

    <moved from Adobe Creative Cloud to Downloading, Installing, Setting Up>
    use your serial number to activate.  if you cannot connect to adobe's server's to activate, Sign in, activation, or connection errors | CS5.5 and later

  • How do I cancel a Newsstand subscription when there is no auto-renew facility/option through Settings? After removing the item on Newsstand it still shows as Active in Store Settings/Manage Subscriptions.

    How do I cancel a Newsstand subscription when there is no auto-renew option via Settings/Manage Subscriptions? After removing the item from the Newsstand site it still shows as Active via Settings/Manage Subscriptions. The publisher tells me it is not a subscription rate that is theirs, they have no knowledge of it, I subscribed through iTunes Store. Thank you!

    Hi qwerty,
    Dun tink that creative customer support sucks cos I had been dealing with them in the past and I can say that their service are quite gd and fast. If you wanted a refund, I tink you need to contact the store that sells you the product. Dun tink creative will refund you though.

Maybe you are looking for

  • Reading Component Type in ABAP

    hi Given a table name, is it possible to identify its 'Component type' <b>programmatically</b> for example VBAK has the following Application/Component hierarchy: SD - Sales and Distribution        SD-SLS - Sales              VA -  Application develo

  • LOV icon missing in query mode

    Hi, I'm using a LOV in query mode. But in Query mode the button with the 3 dots is missing. I can only enter the LOV by pressing CTRL+L. To improve the easy of use, I want to show the button in the text field (with LOV) as well. How can I realize thi

  • Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/Server

    Dear Sir/Madam I downloaded the Weblogic610 server five times, and when I install it on my Linux box (RedHat 7.1), I always met the exception like: Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/Server When I check with lib direc

  • Creating customer without maintaining common distribution channel and divis

    Dear all... can anybody tell me how to create a customer without maintaining common distribution channel & division.. sathsdn..

  • Spry Menu Bar Navigation

    I'm using the Spry menu bar and have several menu items on my home page that have sub-items under them. For example, I have a "browse" menu item on the home page and under "browse" have "view inventory" and "wish list". I want users to be able to acc