Looking for the right collection for a specific problem

Hi guys,
Just wanted to say great work you guys are doing here. the forum has definitely helped me a lot in the past.
I am currently having a problem selecting a collection for this specific application that i have to do for my final year project. I am looking for a way to store a bunch of strings a collection that uses the actual string as its key and stores the number of times that the string have been added to the collection as its value.
so for e.g
String a = "a";
String b = "b";
String a2 = "a";
String c = "c";
/**Here is where i create my collection */
// Collection mycollection = new collection
// mycollection.add(a);
// mycollection.add(b);
// mycollection.add(a2);
// mycollection.add(c);
/**if you request for the string a or a2 the collection should return the number of times that string appead e.g */
// System.out.println(mycollection.get(a));
//this should print 2
Does such a collection exist? I remember using something similar when i was learning c++ but i havent been able to find what i am looking for in the API documentation. Please help.
Frank

I think what the OP is looking for is probably a Bag. Unfortunately the default collections framework does not provide a Bag interface or implementation. You could look into using the Jakarta Commons Collection, they do provide those (look at the API[url] as well.

Similar Messages

  • Looking for the Right Apple for me (a dumb Windows guy ;) )

    Yeah, I'm a Windows person, but I'm looking to do some filming. Macs, I know, are the best at this.
    I came into this particular board because I'm looking for a decent mac, but I'm a little broke (About to spend 1500 on a camcorder...so yeah).
    I saw the G4 powerbook and thought that it'd be perfect. Now, my friends, I have a few questions for you.
    I'm looking at errr...a site to buy a used mac(not sure if that is taboo on this site, so ignore what I said if it is) for a used mac.
    I am either going to get a Sony DCR-VX2000 or a Pana
    AG-DVC30, both are MiniDV. A) Is a G4 powerful enough (in your opinion ) and B) Do Macs have external DVD burners? Seriously, I looked and found nothing. Do they just come with them or something? Completely confused on that.
    Yeah, I know I probably used wrong terminology, etc. and I apologize. I'm just tryin' to find a good computer to do video editting, etc.
    Errr...okay that's all I can think of. Thank you in advance.
    Not yet   Mac OS X (10.4)  

    You could do that, but when you want to do some
    actual editing, it is better if you do it on the
    internal.
    I disagree. The internal hard drive is only a 2.5" and is limited in throughput compared to an external 3.5" drive. Second, while the video-editing software is trying to read footage off the disk while editing, it will fight with the OS and the application over access to the disk heads. If there is insufficient RAM, then all three will additionaly fight with virtual memory transfers.
    Whether the internal has the room or not, you'll probably get better performance by letting the internal drive handle system, vm, and application tasks, and leave the footage on a fast external disk like a 7200RPM FireWire drive. Then, if you are using Final Cut Pro for instance, you also set your scratch disk to the fast external (or preferably a completely different fast external).
    It's fine to edit on the internal if you have the room and you must be very mobile, but I think that top performance will come from reading/writing footage and renders to external drives, probably hanging off both your built-in FireWire port and a PC slot FireWire card. You will then be able to take advantage of parallel read/write streams, and prevent your entire operation from being bottlenecked by a single, slow laptop hard drive. Note that the 160GB notebook drive is only 5400RPM. You will also extend the life of your internal drive by not hammering it so hard.
    In a computer like the G4 which is so constrained by its low CPU and RAM ceilings, using fast external hard disks is one of the cheapest/easiest ways to maximize performance. I love my PowerBook but if I was going into video editing for a living I would go get myself a dual-core MacBook Pro immediately.

  • Looking for the right laptop for school use

    I'm hoping to find some good suggestions for a new laptop.
    I'm a college student and need something I can take with me from class to class & use for typing notes (in Microsoft Word) and opening and editing PowerPoint documents.  I'm also wanting a fast internet connection.  Other than that, I'm hoping to spend as little money as possible.   I'd like something slightly compact, but price is more important than size.  I won't need much memory at all- my school documents will be stored on a USB and on my home PC. (Dell Studio PC)  No gaming, no need for music or pics.
    Any suggestions????  Thanks
    Solved!
    Go to Solution.

    Pretty much any netbook will work.
    BUT.... the part that you'll need to clarify. Most netbooks/laptops don't come with an internet source built in. You'd either need to look at an air card from a wireless provider, or check to see if you'll have WiFi where you go to school. To be clear though.... Air Card = Internet pretty much everywhere. Wifi = Internet where it's provided by someone, either the college, or at your home, or Starbucks.
    If you like my post, or solution to your issue/question, go ahead and click on the little star by my name and/or accept the post as the Solution. It makes me happy.
    I'm NOT an employee of Best Buy, or Geek Squad, though I did work as an Agent for a year 5 years ago. None of my posts are to be taken as the official stance that Best Buy will take on your situation. My advice is just that, advice.
    Unfortunately, that's the bad luck of any electronic, there's going to be bad Apples... wait that's a horrible pun.

  • Looking for the Garbage Collection log files

    Hello,
    I am looking for the Garbage Collection log files which contain the GC events, like this:
    [GC 2095K->1709K(2160K), 0.0017628 secs]
    [Full GC 2161K->1018K(2276K), 0.0576353 secs]
    The server's GC is already configured accordingly:
    –verbose:gc
    I have examined the std_server<x>.out files at the work folder but can't see this info.
    My question is: Where would I find these files on the server?

    I can't find info in the format I know it not at dev_server* or std_server*.
    in std_server I see xml file like this:
    <gc type="scavenger" id="1" totalid="1" intervalms="0.000">
        <flipped objectcount="303111" bytes="24994248" />
        <tenured objectcount="0" bytes="0" />
        <refs_cleared soft="429" weak="4329" phantom="0" />
        <finalization objectsqueued="1711" />
        <scavenger tiltratio="50" />
        <nursery freebytes="497866672" totalbytes="524288000" percent="94" tenureage="10" />
        <tenured freebytes="1094921936" totalbytes="1098907648" percent="99" >
          <soa freebytes="1039977168" totalbytes="1043962880" percent="99" />
          <loa freebytes="54944768" totalbytes="54944768" percent="100" />
        </tenured>
        <time totalms="185.585" />
      </gc>
    I guess this is the info I need but it's not formatted in a way that your tool can read it and having a tool like this reading it is very helpful.
    Any ideas?

  • Looking for the right preset

    Greetings -
    I just recently purchased CS5 Production Premium and I want to use Premiere to create slideshows with still camera shots.
    My source is RAW images (.NEF). I process them in Lightroom 3 and I export them in .Tif or .Psd formats ranging in size from 1920x1080 to 4288x2412 for use in Premiere.
    The goal is to produce mpeg2 files that can be played on a Western Digital TV Live HD Media Player on rather large HD 1080p TVs (52” – 55”). The mpeg2 files that I have produced with other programs are either 24 or 29.97 frames per second with data rates of 30mbps and appear very good on the equipment described above.
    I do a lot of zoom and pans and add sound to these slideshows.
    I am looking to produce the slideshows with the highest clarity and smoothness possible.
    The question I have is: What Premiere sequence preset is the best choice for this kind of application?
    Any thoughts, suggestions or tips would be greatly appreciated.
    Thanks!

    Thanks for the fast response.
    The WD will handle 1920x1080p which matches my HD TVs.
    Looking at the choices presented for presets I see that the following have 1920x1080p settings:
    AVCHD
    Canon XF Mpeg2
    Digital SLR
    Red R3D
    XDCam EX
    XDCam HD422
    In respect to video is there one of the above that is more suited for stills?
    Thank you Bill for all of your help.

  • What is the right charger for a MacBook Pro 13"  mid 2009 model?

    What is the right charger for a MacBook Pro 13" mid 2009 model? I have two chargers for two different Mac and don't know which is  thankswhich. I'm really looking for specific details such as voltage/watts and all the rest to idenify my charger.  A link to where to web page where I could purchase the correct charger would also be very useful. Many thanks.
    All help much appreciated. THANK YOU

    Both power adapter I have are different (at the magnet end) from the one in link.
    Earlier adapters have T shaped connectors, which Apple later changed to the L shape, presumably to make them more abuse-proof. Either one is fine and the one you are using will not damage your Mac.
    Retina MBPs and new MBAs use a completely different MagSafe 2 connector which will not fit (without an adapter).

  • How can i find out which Macbook is the right one for me?

    I am looking into buying anew laptop and I'm currently considering a macbook as oppose to a windows laptop. which one is the right one for me?
    1. I will be using it for my work at college and university so it will need to have a reasonable amount of storage and have the correct programs.
    2. I use the internet alot.
    3. I have an ipod touch so i will need storage for my music.
    4. It will need it to be quite quick.
    5. It will need to support some software that i use on windows.
    Also, do you think a macbook is what i need as oppose to windows. what are the pros and cons of the macbook

    Prongs wrote:
    1. I will be using it for my work at college and university so it will need to have a reasonable amount of storage and have the correct programs.
    This is the most important question. I would check with your school. They may have a recommendation for what you need and the software you will need to use. They also may have a discount program for you to purchase your computer. If not Apple does have an education discount plan to give you a break.
    5. it will need to support some software that I use on windows.
    Hard to give an answer for this as we have no idea what your going to be using or what your school requires you to use. My sons college had specific programs he had to have.

  • Is JavaFX the right solution for this scenario...

    Hi,
    Is JavaFX the right choice for the following implementation choice I have to make? (see below for the requirement)
    Requirements:
    1. Provide a way to visualise within a web application an entity relationship type diagram (i.e. nodes with relationships between them). The backend database will hold the topology relationship. So to visualise this on a web application will need the ability to draw rectangles/lines/text etc.
    2. Provide a way to allow the use to trigger "add a new node", or "edit info in this node". For example a right hand context sensitive menu for example.
    3. Ideally will scale as the user resizes the browser window
    4. Would like the main functionality of the application to remain web based (is a Ruby on Rails application in fact), but have the visualization of the diagram render within the web application as transparently as possible.
    Options / Issues:
    * Issues I've struck with some investigation I've done is that whilst the <canvas> tag looks good for Mozilla/Firefox etc, it does not seem to have support on InternetExplorer. Hence cross-browser compatibility seems to be a real issue for the JavaScript type solutions from what I can see. This is why I thought JavaFX may be good?
    * Options therefore seem to me to be:
    - javascript (e.g. <canvas> tag) => cross-platform issue
    - JavaFX / Applet => (this is what I'm asking about)
    - Microsoft => costs $$ for development environment etc
    - AIR / Flex / Flex => ??? costs $$ again I think
    Regards
    Greg

    thanks - I'm still a little confused re their products and which would fit best so I've sent them some questions (below if you're interested)
    Hello,
    Could you please assist me in understanding which of your products would satisfy my needs. In fact (a) whether JGraph itself would and if not, or if it's not ideal, (b) which other product would.
    REQUIREMENTS:
    1. Provide a way to visualise within a web application a connectivity type diagram (i.e. nodes with relationships between them, a network connectively type of diagram).
    2. The server side (i.e. web application with database) will hold the topology relationship. HTTP type interfaces off the web application can be developed to provide the client side visualizing component with the topology data in the required format (assume this is XML)
    3. As well as just visualizing in the browser there would need to be a way for user to trigger a context sensitive "add a new node", or "edit info in this node". For example a right hand context sensitive menu for example.
    4. Ideally the diagram will scale as the user resizes the browser window
    5. Would like the main functionality of the application to remain web based , but have the visualization of the diagram render within the web application as transparently as possible. The the visualizing component would just take topology data and intelligently display this.
    6. DESIRABLE: Basic automated layout would be nice, or as a desirable (depending on cost) more sophisticated auto-mated layout.
    QUESTIONS:
    As well as your recommendation re which product would suite I had some specific questions which I would appreciate clarification on:
    Q1 - I assume if I have a web backend that can deliver topology inforrmation in an appropriate XML format via a HTTP REST type GET call that this could be used as a the source of data for a jGraph visualisation running within an Applet?
    Q2 - If running within an Applet, can jGraph cater for a right hand menu option off the nodes/links on the graph, that I could use to trigger other calls back to the backend? (e.g. to trigger an Add New Node call)
    Q3 - Following on from Q2 scenario, if I trigger an add new node scenario, if I wanted to visualise the form to type in the attributes for the new node, could this be handled within the applet by jGraph, or would this be a case of just adding your own Swing based dialogs to handle this?
    Q4 - Do the basic JGraph do any basic layout without having to go up to the layout Pro package (which I think costs if using it commercially).
    Q5 - If the answer to Q4 is No, how difficult would it be using the base JGraph library to do a basic layout? Is this doable/recommended? i.e. how would one "layout" the diagram if using only the base JGraph component? (noting from my requirements I'm really after a component I could send my topology information to in XML form and have it just visualise it for me)
    Q6 - Running the visualiation in an Applet in a browser, is the typical usage one where all changes to topology are made as calls to backend? i.e. or is there an approach where one would allow users to make changes to the topology within the applet and build up all the changes here on the client, and then at some point synch these back to the backend? (I'm assuming the keep it simple approach would be not to do this)
    Q7 - Is there a sample application/project with source code that implements a JGraph in applet/browser talking to web backend for data?
    Q8 - How does JGraphPro & mXGraph fit into the picture re solving my requirements in the most cost effective manner

  • Is Keynote the right application for the job?

    I have a job that requires integrating an audio soundtrack with some slides. The difference between this presentation and a normal slide presentation is that most of the information is in the soundtrack (it's a lecture, with some slides as visual aids). The amount of time in which the slides need to appear is relatively brief; in fact it's a fraction of the soundtrack's run-time.
    I have time index information that specifies where the slides should appear in the presentation. For example, there will be two minutes of soundtrack with a blue background, and then a slide will appear for 5 minutes while the soundtrack discusses its content. Then the slide should disappear into blue background for 10 minutes, then another slide for 3 minutes, then background for 20 minutes, then another slide...and so on.
    In other words, the soundtrack must play continuously, interspersed with occasional slides at specific times for specific durations, with blue background in between. I want to export the entire presentation as an integrated audio+video file and burn it to DVD. I already have the soundtrack as an .aiff file in Logic Pro 7.2, and I will have the slides as high-quality JPEG files. I don't own a Keynote license. I do have a QuickTime Pro license. I've played with this in Microsoft PowerPoint enough to determine that it's not the right tool for the job.
    I've looked at Keynote's Help documentation, and it's not immediately apparent how to start with an audio soundtrack and simply insert slides at specific times, for specific durations. Can I accomplish that in Keynote, or is there another application that would be better suited to the task?
    Thanks in advance for any help anyone can offer.

    Brian:
    If I correctly understand the effect you've described, I imagine that would be VERY annoying. However, in the test presentation I made in iMovie, that's not exactly what I experienced. I added the soundtrack first, and then I placed the slide images where I wanted them. Initially, I did notice that I couldn't just jump ahead and place an image all the way at the end of the soundtrack file without iMovie adjoining it to the last image's segment on the timeline, but that was easy to fix. Once the image was in the timeline, I just dragged it all the way to the end of the soundtrack. After that, I could place images anywhere I wanted.

  • Is DPS the right solution for me?

    I am currently working on a project that includes an iPad app that will direct users to one of 30 brochures. Other developers are working on the iPad app, I am creating the brochures.
    If i use the DPS to publish the brochures, do I need to create 30 custom viewer apps (at $495 a month/$6,000 a year), or is there a more cost-effective way to deliver the brochures? The brochures will be created in Indesign, and I would like them to have some interactive features (image slide-shows, pinch & zoom, etc.) but they have to be viewable on an iPad.

    Well, a DPS professional license would allow you to publish all 30 of those brochures in one app. But that would mean that all your brochures are available to anyone who downloads the app, so depending on your specific needs that could cause a problem.
    I love doing brochures through DPS, but if you already have developers working on the front and back ends of an app, I don't know if you want to replace their work with DPS.
    But long story short, with the limited info you have provided, it sounds like DPS could possibly be the right solution for you.

  • Is Premiere Pro CS3 the right program for me?

    Is Premiere Pro CS3 the right program for me?
    I am looking for a program that I can:
    Import files that were recorded on a DVR (mp4 format)
    Take two files placed next to each other on one screen and record a DVD
    | | | |
    | | | |
    | image one | | image two |
    | | | |
    |______________| |_______________|
    Also export the files to other file formats, AVi, MOV

    Dave,
    Premiere can do a PiP, Picture in Picture (basically, your PiP is one half of the frame), BUT your MP4 source is not the best to edit, especially with PP. If you had DV-AVI files, Captured in PP from a miniDV (tape) vid-cam, it would do a great job, but so would its little brother Premiere Elements, which wants the same source files as PP.
    I have not used Womble, that Jeff recommends, but think that it has PiP. Ideally, you want to keep any re-compression down to a minimum, as you are already working with compressed MPEG files, and every additional re-compression WILL cause image degredation. Depending on the CODEC used to create your MP4 files, you have probably lost a lot of info already, and when you go to MPEG-2 (DV CODEC), for DVD, you'll loose even more. About the only way that I see you keeping any quality is if your MP4's are coded for Blu-Ray, and you can find a program with Smart Render, leaving them just as they are, allowing you to edit, then burning to a BD. Lot of "if's" in that.
    I'd check out Womble and see if it can do PiP and if it works with MP4. If Jeff recommended it, it's very likely to do that. Juat expect a major quality hit, because you're already compressed the heck out of the image data once, and will have to do it again.
    You could convert your MP4's to DV-AVI with a 3rd party program, Import them into PP, or PE, edit and then burn to DVD - with Encore in PP, or directly from PE. See above for comments on quality hit. It's those source files that are the problem. That format is meant for distribution/viewing and not for editing. The effect, however, is easy as can be. There are many tutorials on how to do it with variations, on the Web, but nearly all NLE programs want better source material to start, if any quality is to be maintained.
    I'd also post on the Premiere Elements forum, as a lot of people there work with less than ideal source files, and might know of good free, or cheap, conversion programs to use. If you have the CODEC on your machine, DigitalMedia Converter can handle the conversion for you, and do it in batch. It's cheap at ~ US$45, and can batch process, but it cannot improve the quality, or get back the data lost in the first compression - nothing can.
    If this is all you want to do, with the above comments on conversion first taken seriously, Premiere Elements will cost about US$100 and do it easily.
    Sorry for the bad news,
    Hunt

  • Where are the right parameters for styles

    Hi there,
    after a upgrade from SPS12 to SPS15 on a java-only portal, the letters from the menue in the uwl like refresh or check connection status and all the topics in the workflowlist have big letters than before.
    Does anybody knows a hint, where I can set the right parameter for that?
    I noticed that only in webdynpro iviews.
    Best regards
    Christian

    thanks for you hint,
    but thats too easy :o)
    I know where I can change the portal theme, I´m looking for the right parameter in the theme editor :o)
    Regards
    Christian

  • Can someone point me in the right direction for a second monitor adaptor for my iMac?

    I'm trying to add a second monitor to my Late 2006 20 inch iMac (yes it still works just fine and I can't afford to upgrade yet). I'm having a hard time finding the right adaptor for the monitor, I've bought the wrong thing twice now (the second one I got looks like its just for Power PC, it won't go in here but it fits in my iBook G4 just fine)
    I've been searching but everything I find is either for newer or older models then mine Does someone might know of a place where I could find one that will fit my machine? Thank you!

    The late-2006 iMac has a mini-DVI port, so you'll just need a mini-DVI to the appropriate input for your monitor. The adapter you have for your iBook will not work. You can get adapters from the Apple Store as well as many other vendors.
    Regars.

  • When importing a spreadsheet with redeem codes into apple configurator, it says it's not the right codes for the app.  But it is the right codes. I used one of the codes to purchase the app in itunes.

    I have a cart of 25 ipads with a macbook air.  I have logged into my VPP account and purchased the needed number of copies.  I downloaded the spreadsheet.  I took the first code from the spreadsheet, and logged into itunes using a regular account (not my VPP account), and used the code to download the app.  I put the app into configurator and then tried to add the spreadsheet with the codes in it.  It comes up and tells me that it is not the correct spreadsheet for that app. But it is the correct spreadsheet!!  I tried re-downloading the spreadsheet again and even tried re-downloading the app.  So I've now used two of my redeem codes and still can't get it to accept it into apple configurator.  I removed the app from apple configurator and re-added it.  The error message says it's not the right codes for the app "Grammar Games by Tap To Learn" and to please get the codes for "Grammar Games by Tap To Learn."  It's the same one!

    It won't let me edit my post, so I'm typing this reply to add...
    I tried taking the version number out of the title. It looked like there were two spaces in the title "Grammar Games  by Tap to Learn". So I even made sure that matched. I still can't import my codes. Any other things to try would be really appreciated.

  • Looking for the *.ppd file for an HP P1102w printer (to install in eCS system (= OS/2)

    Looking for the *.ppd file for an HP P1102w printer (to install in an eCS system (=> OS/2)).  (.ppd means
    PostScript printer description, applies even if the printer is _not_ postscript.; available for most printers
    but isn't on the CD!)  Can anyone point me to the file ?
    John H. Lindsay

    The LaserJet P1102 models are 'host-based', which means that they do not understand any of the 'traditional' Page Description Languages (PCL5, PCL6 (a.k.a. PCL XL), PostScript).
    So unless your eCS system (whatever that is) has knowledge of the (various) proprietary and model-specific host-based languages, I don't think that a printer description file would help at all.

Maybe you are looking for

  • Is there a way to detect each pulse of a signal

    Hi All, I need to detect every pulse of my input signal pulse, is there a way to do that, I tried using basic level triggering but the trigger doesnot switch true and false between pulses. I need to detect the input pulse for some ms  and then genera

  • Automatic Generation of Settlement Rules for PM order

    Hi All, I am doing a maintenance orders settlement and I have the fallowing issue: My client has 2 types of equipment, namely vehicles and industrial equipment. Both have particular rules. For vehicles, we need to control all cost by an internal orde

  • Robohelp HTML, JBoss: UTF-8 Problem

    Hello We use Robohelp 8 to create a web help for our JBOSS based project. Unfortunaltely, all files that robohelp creates use UTF-8, but the default of our JBOSS is ISO-8859-1. So, if I open the help using Firefox in the web container I receive only

  • Graph cursor mystery

    I have troubles understanding how to use cursors on a XY graph. I can create a cursor, snap it to a graph and move it around. However, as soon as I use another Graph tool (such as zoom, etc), I can't grab the cursor again. The only work around that s

  • How do I combine two user iPhoto files into one...keeps blocking the pics between users

    How do I combine two user iPhoto files into one...keeps blocking the pics between users on the same Mac?