What is the best Collection/Iterator to use?

Anyone come across this scenario before?
I have a list of elements that I want to put into a Collection/List of some description. I then want to iterate through the list searching for an element that matches my requirements.
When I find one I then want to 'read ahead' through the list to see if there is a matching element matching my requirements.
If I find I match, I'd like to be able to delete both elements from the list and then continue reading through the list after the first element I found.
I've had a look at ListIterator, but this doesn't seem to allow you to re-position the cursor or even restart() the iterator.
Can anyone tell me if any or all of this is possible?
thanks

Place the items in a Set. Since Sets don't allow duplicates, that problem is solved. Then just iterate the set and delete those entries you don't want.

Similar Messages

  • What is the best backup drive to use to backup a windows xp pc and to transfer that data to a new iMac i5 May 2011 and then to backup my iMac on it?

    What is the best backup drive to use to backup my windows xp pc and to transfer these files to my iMac i5 new in May 2011 and then to backup my i5 iMac?

    Get something with both USB and Firewire connections, as big as you can afford.  Format it Fat 32, plug it into the XP machine with USB, drag and drop the files you want to keep, plug it into the iMac with Firewire, drag and drop again.  If you want to use it just to back up your Mac in future, reformat it Mac OS Extended and enable Time Machine.  If you're likely to want to share the drive with Windows PCs in future, leave it Fat 32.

  • What is the best way of insertion using structured or binary type in oracle

    what is the best way of insertion using structured or binary type in oracle xml db 11g database

    SQL*Loader.

  • HT1586 What's the best HDMI switcher to use for Apple TV?

    What's the best HDMI switcher to use for Apple TV?  My widescreen TV has only one HDMI outlet and it is in use. 
    Thanks,
    Joanna

    Anyone sold by MONOPRICE.COM are really worth buying!

  • What is the best display setting to use with a sanyo projector for Mac OS x 10.8.3

    What is the best display setting to use with a sanyo projector for Mac OS x 10.8.3

    You would use whatever the native settings for the projector are.
    Regards.

  • What is the best media player to use on iBook  500MHZ, 576MB RAM

    Can anyone advise me what is the best media player to use to play .avi files on my iBook. I have tried using Quicktime (7.6.4) with Perian installed and it is very choppy. I have also tried VLC (0.8.6i)and that's not much better.
    My iBook is 500MHZ, 40GB HDD, 576MB RAM running MAC OS X 10.4.11 with all updates installed. I have also disabled dashboard and spotlight but that's not made much difference.
    Many thanks
    Garry

    Well, now, isn't that interesting?
    I left my iBook G3 800 MHz in Mac OS X 10.3 because I believed that upgrading to 10.4 would tax it too much. Others have successfully run 10.4 on their iBook G3s, and with the upgraded hard drive, I would have thought you'd be okay with it.
    I generally don't do more than one upgrade of the OS past what my Mac came with. When I want to upgrade further, I upgrade my Mac.
    I'm glad you figured out something that would work for you. Posting back to let us know may help someone else in the future, so thank you for that.

  • My computer is part of the iMac 1TB Seagate Hard Drive replacement program. What is the best external modem to use in order to back up my files prior to me dropping off my computer.

    My computer is part of the iMac 1TB Seagate Hard Drive replacement program. What is the best external modem to use in order to back up my files prior to me dropping off my computer.

    As Babowa says, get an external disk.  You should have one for normal backups anyway.
    Actually, I'm a strong fan of having multiple backups.  3 copies including the original, 2 different backup formats, and 1 backup off-site.
    And when you have your iMac in for service, if you have just 1 backup at that point in time you have just 1 copy of your data.  I get paranoid about my data.
    But if you are just making 1 backup, I would use SuperDuper (free for a full clone, and extremely good software, as is Carbon Copy Cloner, but it is not free anymore).
    And then I would "Boot" from the clone, to make sure it was a good clone.
    Booted from the clone, I would then use Applications -> Utilities -> Disk Utility to zero the original disk, as suggested by Babowa, so that when they replace the disk, the original disk containing your data is not in the hands of strangers.  A single pass of zeros is more than good enough as an erase, as the chances are no one is going to spend the money needed to try and read the erased data.  It is not like you have any super secret data, just stuff you do not want the casual data theif to get.  You will find the zeroing options under Disk Utility -> Erase -> Security Options
    Just make sure you actually boot from your clone before erasing your original.  And if you are paranoid like me, make 2 backups, then erase the original :-)

  • What is the best mail account to use with Apple Mail?

    Hi All, I am a recent convert to Mac from a PC and I am on a sharp learning curve. At present I am trying to use mail on Leapord. I have a Googlemail account which I have tried linking to Apple mail but I seem to get the same issue many others have with send e-mails. What is more, googlmail's All Mail facility is doing my nut in at the moment.
    Therefore I was wondering what is the best mail account to use with Apple Mail? I only have a Mackbook and an i-pod nano so subscribing to mobile me at £58/yr just to get the @mac.com account (which I assume would be perfect) seems a little extreme for me.
    Are their any other account that work correctly and don't have this All Mail option.
    Thanking you in advance.
    Matthew

    Hi,
    I have 2 issues.
    1) I have mail 3.6 and when I set up the mail account via IMAP and STMP I recieve mails ok, but I can not send them. If I do I get the following window pop up.
    "can not send message using smtp.googlemail.com server" it tells me my address was rejected by the server.
    2) I have 2500 e-mails in my All Mails folder on googlemail. Nearly all of these I delete from my inbox years ago (my bad mailbox management). Google seems to store all my mails. I want to delete these permentaly as they also get downloaded into Apple Mail.
    Hope you can help.
    Matt

  • What is the best compressor setting to use ... when exporting a 720p timeline from FCP for a project that will only be played back in a standard def monitor?

    What is the best compressor setting to use for DVD StudioPro ... when exporting a 720p 30 timeline from FCP for a project that will only be viewed in a standard def monitor?

    Update: The iBook can play any 480p video and higher if I encode them with DivX and in AVI format. But of course this is not compatible with my iPhone 4. At least I can shrink my library now and get away from the full MPEG-2s. I don't get why I can't use Apple's h264 though. There has to be a setting I am missing. The sample Apple h264 videos from the days of Tiger worked flawlessly on my iBook when it was new so the CPU must be capable of decoding it. I really can't understand this.
    Also, since I made my videos in English for my family, I had to create soft subtitles for my wife's Chinese family, and I can't get players like QT with perian or MPlayerX to sync them properly to an AVI encoded with DivX, they only sync well with the iPhone 4 m4v/mp4 formatted files I made. This is a real pickle.
    So now I may need three or four copies of each video, LOL. I need to hardcode the subtitles if I want to use AVI to playback on older machines, and keep the mp4 file for the iDevices too, while keeping higher quality h264 videos for my American relatives...
    If h264 is compatible with my iBook, what is the proper encoding settings? Must I dramatically lower the settings or frame rate? I can settle on 2 copies of each video that way. One iBook/G4/eMac compatible video that syncs correctly with my srt soft subs, and another version that works well with my iPhone 4 and iPad.
    All in all, I will end up with more than 3 or 4 version of each video. On my late G5 dual core I have the full 720-1080p uncompressed master files. On my i5 iMac I have the h264 compressed versions for distribution, and lower versions for my iDevices. Now I need to keep either full MPEG-2 files for the iBook to play, or convert to older formats like DivX AVI for our family's legacy machines. I am running out of hard disk space quick now, LOL.
    Is there an easier way?

  • What is the best I/O to use for a MUD?

    What is the best I/O to use for a MUD?
    It seems that people usually show I/O examples with IOs like:
    BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInptuStream()));
    PrintWriter out = new PrintWriter(socket.getOutputStream());
    out.println("Hello World");
    out.flush();
    PrintStream out = new PrintStream(socket.getOutputStream());
    out.println("Hello World");
    out.flush();When I say 'best I/O' I mean, can you give me an I/O that'll be the best if a MUD starts getting LOTS of request and becomes rather busy?
    Thanks!
    -Neo-

    One last question, are output streams thread safe?A stream is inherently serial in the way it data is written to it. If two threads try to write to the same stream asynchronously, the ordering of the data written will not be predictable.
    For example:
    One class is recieving input from a user and
    reply-printing thing like "Command Successful", and
    another class is recieving messages from other users,
    but the PrintWriter would be originally created in the
    first class and then passed as a parameter to the
    second class...would this work, or should I just
    redirect all command replies to that second class?If they are in the same thread, then it could work. If there are separate threads, then some higher granularity synchronization needs to be imposed, so that the second thread doesn't start writing part way through the first's output.
    For example:public class NeoThreadWriter implements Runnable {
      final String name;
      final int delay;
      final boolean synch;
      NeoThreadWriter (String name, int delay, boolean synch) {
        this.name = name;
        this.delay = delay;
        this.synch = synch;
      public void run () {
        if (synch) {
          new Synch().run();
        } else {
          new ASynch().run();
      class Synch implements Runnable { 
        public synchronized void run () {
          synchronized (System.out) {
            for (int i=0; i<6; i++) {
              System.out.println(name+":"+i);
              try {
                Thread.sleep(delay);
              } catch (InterruptedException iex) {
                iex.printStackTrace();
      class ASynch implements Runnable { 
        public synchronized void run () {
          for (int i=0; i<6; i++) {
            System.out.println(name+":"+i);
            try {
              Thread.sleep(delay);
            } catch (InterruptedException iex) {
              iex.printStackTrace();
      public static void main (String[] args) {
        try {
          Thread threadA = new Thread (new NeoThreadWriter ("A", 40, false));
          Thread threadB = new Thread (new NeoThreadWriter ("B", 20, false));
          System.out.println("asynchronous threads");
          threadA.start();
          threadB.start();
          threadA.join();
          threadB.join();
          System.out.println("synchronized threads");
          Thread threadC = new Thread (new NeoThreadWriter ("C", 40, true));
          Thread threadD = new Thread (new NeoThreadWriter ("D", 30, true));
          threadC.start();
          threadD.start();
          threadC.join();
          threadD.join();
          System.out.println("Done");
        } catch (InterruptedException iex) {
          iex.printStackTrace();
    }With asynchronous threads A and B, the output is all mixed up. With synchronized threads the ordering of the output is maintained. Note that the guard has to encompass all of the code that generates the output; simply synchronizing the println invocations wouldn't prevent the mixing.
    Pete

  • What's the best app I could use to create a word document

    What's the best app I could use to create a word document ?

    Have a look at the following (in my order of preference)
    http://itunes.apple.com/sg/app/quickoffice-pro-hd-edit-office/id376212724?mt=8&l s=1
    http://itunes.apple.com/sg/app/documents-to-go-premium-office/id317107309?mt=8&l s=1
    http://itunes.apple.com/sg/app/office2-hd/id364361728?mt=8&ls=1

  • What is the best external battery to use with a macbook pro retina?

    Looking for the best option here. What is the best external battery to use with a macbook pro retina?

    You should check your date of purchase against the manufacturer's warranty
    or guaranty since some of those better brands have some recourse should
    they fail within a specified time period. A good reason to save dated receipts.
    Since solid-state USB drives probably don't (all) use a wear-leveling software
    to equally utilize their recordable space evenly, it is possible that some of these
    may exhibit a failure in some sector areas due to excessive over-writing. If the
    ones you use do not have such a technology or an undercounted total capacity
    with a means to automatically write in other sections, you may have to consider
    manually using a disk utility to zero-overwrite and reformat them occasionally.
    Even so, that may only help a marginal flash or thumb drive work a little longer.
    Should a camera memory card fail you still may be able to attempt with margin of
    success, to +recover image files+ from it. re: http://www.cgsecurity.org/wiki/PhotoRec
    The standard default format they ship with works well for most file types; so if
    you aren't moving OS X or Mac app specific files around on a USB flash drive,
    the original format should be fine. Oh, you can use Disk Utility to attempt to do
    a repair; but in some cases you may have to reformat them, etc.
    {Some of the flash drive warranties or guarantees may vary from between regions;
    so if you have one with a '5 Year' guarantee in the US, other rules may apply in EU,
    or when you seek to replace an item under warranty outside of where it was bought.}
    Good luck & happy computing!

  • What is the best wireless printer to use with an IPad Air and IPhone?

    What is the best wireless printer to use with an IPad Air and IPhone that will print both text and photos?  Also, is the separate keyboard available for the IPad Air, yet?

    Best is relative. Different people like different things. I have an epson that I like. I'd look through a site like Best Buy and compare reviews for Air Print enabled printers.
    as to the keyboard, I know Zagg has one and I think there are other manufacturers that have keyboards for the Air. As far as I know, pretty much any bluetooth keyboard will work, but if you want a case then you'd need to get a specific one.

  • What's the best logic reverb to use for trumpets and sax

    what's the best logic reverb to use for trumpets and sax.

    The lower transmit frequency limit is in there to make the device meet FCC regulations.. that is a regulation imposed of US regions and, to a lesser extent, Latin american regions that border with the US.
    In addition, you'll be pleased to know that the N900 will not use certain European WiFi channels if a) the sim card is removed or b) the phone has a sim card but is OUT of 3G coverage.. again, to make the device meet FCC regulations.. (seriously.. when you go out of 3G coverage, the kernel reports it is switching from EU wifi to US wifi!!)
    Let me put this into perspective..
    From: http://www.nokia.com/results/Nokia_results2009Q3e.pdf
    Nokia sold 3.1million handsets in the US 2009 Q3
    Nokia sold 27.1million handsets in Europe during the same period.. That is 9 times as many.
    The USA has its OWN firmware
    and yet ALL versions of the firmware (including the UK specific one) are crippled to meet the requirements of a region that produces the lowest sales figures by a factor of 3 (Latin America produced 9.7 million units in 2009Q3)
    Why the HELL are we suffering because of US restrictions..
    That's like saying you can't use bluetooth because it isn't allowed on the Christmas islands.. (it is allowed.. not picking on you, Christmas Islands, but you are small!)
    If the FCC wants a phone that doesn't allow broadcasts on sub 88Mhz frequences, and doesn't want certain Wifi channels to be used, the ALTER THE US FIRMWARE..
    What next, BMWs have with left hand steering in the UK because the US drives on the Left?
    Phillips TVs that only work on 120V because the US uses 120V..
    I don't give a **** what the FCC say.. I'm not in the US and I have my own european and UK legislation to adhere to..
    For a company that INSISTS on having a billion regional firmware versions, they don't appear to be able to get that right either!!! The UK version lacks UK specific restrictions such as the ability to us UK frequencies for wifi and FM transmission!!
    Crazy and very very irritating

  • What are the best export settings to use...

    Operating system: Vista SP1
    Camera: Canon HF100 (1900x1080 HD quality 29.97fps) -- uses AVCHD compression which is H.264 I believe.
    I'm able to watch my camera video files in Vista nicely. However, I'm having trouble with the watching the results of my edited and exported videos. Assuming I want the same quality and playability as the source video, what settings should I use in the export?
    In the export settings window... I select:
    Format: H.264
    Preset: HDTV 1080p 29.97 High Quality
    Source files have the extension: .m2ts
    ...I don't change the other values. Then I export. Now the result is an .mp4 file which does not play in Windows Media Player. It does play in Quicktime or iTunes however it plays jerkily... I would like to be able to play it as smoothly as the original source plays... And I'd like to be able to play it in windows media player just as the source can be played in media player. Media player seems to play the source more smoothly than does iTunes or Quicktime.
    So what are the best export settings for me so that I can watch my edited HD video on my computer as easily as the source footage???
    I've been able to edit and save the results of the edit using the crappy ImageMixer3 video editor that comes with the camera. The results are perfect and play in windows media fine. The files it exports the edited video as is the same as the soure... the file extension is .m2ts
    So the problem is how to get Adobe to export the edited video to an .m2ts file or at least to a file type that plays as nicely in my system?

    See
    Exporting to iPods, cell phones, PSPs and other mobile devices in the PPro Help for details.
    Cheers
    Eddie
    PremiereProPedia   
    RSS feed)
    - Over 350 frequently answered questions
    - Over 300 free tutorials
    - Maintained by editors like
    you
    Forum FAQ

Maybe you are looking for

  • Should I create a new version of my app?

    I am upgrading an existing app from "Multi Folio" to "Multi Folio with Entitlement and iTunes Subscription"? Currently, I have created and downloaded the .ipa file. I used the existing Apple ID from Manage Your Apps and can get the new test app loade

  • FEBAN - resetting a cleared item in FEBAN

    Has anyone been successful in resetting/reversing a posted clearing from FEBAN so that it can be reprocessed?  We cleared a check against the wrong payment doc number.  I've tried FBRA - then editing table FEBEP (removing certain fields that are set

  • Not able to post accounting document from CRM to ECC.

    I am tring to post accounting document through BDOC but it is not posting . Can any one have idea how we can post accounting document to ECC from CRM with out use of Bdoc .  Thanks

  • Burn a dvd from a VIDEO_TS  folder

    Hi all, this is sily, i have done this before i know i have, i cannot do it now ! I have a Folder named VIDEO_TS on my hard drive, it contains the contents of a video that i want to burn onto a DVD DL disc So far today i have wasted 4 disc's trying 4

  • Can I drag and drop single photos into Events?

    Hi guys. I've very recently ordered a new Mac that will have iLife 08 on it. Before I get started with it I've got a question about Events. I've been using iPhoto for the last several years, organizing my photos into albums. I've cleaned up my images


HashFlare