What kind of data structure should I use?

I have a user input dialog basically like following which need user input the sample number to specifiy each file belongs to which sample:
user input the sample number in the following dialog:
file name             sample
test 1                  1
test2                   2
test3                   1
test4                   2In another words, each sample could include multiple files, each file has a column of data. I tried to get
a data structure which specifies the sample and file relationship, to get an idea of what kind of files are in
one sample. I tried to use hashmap or hashtable, but they ask the key must be unique. What I need is to get the sample data structure for the later data processing.
thanks in advance!

You could make a Sample object, which creates a List of file names. Then put SampleNumber and SampleObject into a Map...
  class Sample {
    java.util.List fileNames;
    Sample()
    {  fileNames = java.util.ArrayList(5); }
    addFile(String fName)
    { fileNames.add(fName); }
    String[] getFileNames()
      String[] names = new String[fileNames.size()];
      for (int a = 0; a < names.length; a++)
      { names[a] = fileNames.get(a).toString(); }
      return names;
  Map samples = new HashMap();
  Sample samp1 = new Sample();
  samp1.addFile("Test1"); samp1.addFile("Test3");
  Sample samp2 = new Sample();
  samp2.addFile("Test2"); samp2.addFile("Test4");
  samples.add("1", samp1);
  samples.add("2", samp2);
  String selected = //String user selects...
  Sample sampNeeded = (Sample)samples.get(selected);
  String[] files = sampNeeded.getFileNames();

Similar Messages

  • What kind of blank discs should I use on my macbook?

    What kind of blank discs should I use on my macbook?

    cd-r - for burning audio and MP3 cd's for playback on stereos via iTunes and storing under 700MB in files.
    dvd-r - for burning data dvd's and movies to 4.5GB
    dvd-r ds - dual sided for 9GB
    dvd-r dl - for dual layer on one side about 9GB total, good for making copies of OS X install disks
    dvd-r dl ds  - dual layer double sided for about 18GB total
    then there is blueray dvd's but that requires a external burner and special disks for even larger amounts of data.
    If you see "+" instead of "-" like cd+r, it's a differnet format on the disk, but most all new modern machines can read/burn either now.
    Older machines might only be "-" or "+" with "-" being the most commonly used.

  • What kind of CD-R should I use?

    I've recently had problems burning CD's from iTunes . . .the CD's seem to burn correctly, but when I insert them into one of several DVD players, they skip, pop and do other weird things. (Burning DVDs from iDVD runs smoothly.) I have the original drive that came with my G5 as follows: PIONEER DVD-RW DVR-117D.
    Reading through the forums, it seems that the type of media used is a common cause of problems like this. I don't know what kind of CD's I was using before, but the spindle I have now contains Memorex CD's with a 52X max speed, and hold 700 MB.
    I think my drive has a maximum speed of 16X, so I tested burning at 16X and then 4X . . .I got the same results.
    If I'm reading the threads correctly, my drive would work best with 650 MB disks with a max burn speed of 16X. As far as I can tell from Goggling however, that kind of disk is no longer exists.
    So what specs should I look for that will be most compatible with my drive?
    Thanks!
    Bryce

    Thanks! It looks like these drives are only $26 . . .I'll bet I've spent at least half that much in wasted CD's over the past few days.
    Perhaps this next question should go over to the Final Cut Pro discussions, but I'll start here . . .as long as I'm considering replacing the drive, I'm wondering if I should upgrade to something better/faster.
    I remember there being an issue some years ago that software like iDVD and DVD Studio Pro would only write to certain Apple sanctioned DVD burners.
    For me, it's less about the money and more about have equipment that works properly . . .and faster (time is money).
    Any advice about upgrading?

  • EMERGENCY: what kind of jdbc driver should I use?

    Suppose one machine with 9iAS standarv version installed, and another one with oracle8.1.6 installed. OSE is used for JSP and servlet engine. In this case, Oracle internal JDBC driver does not apply, am I right? Then what kind of JDBC should I used to access the database on the other machine?
    thanks
    null

    Your have 4 driver options :
    1) 2 from a client install
    a) jdbc thin
    b) jdbc oci with a client install
    2) 2 from inside the JVM including the ose component.
    a) server sdie internal(kprb) -- for inside the rdbms usage ONLY
    b) server side thin driver.
    Please review the following "overview" :
    Overview of the Oracle JDBC Drivers
    http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/java.817/a83724/overvw2.htm#1000908
    For server side jdbc connection the following information is also relevant :
    It applies to java code in IAS 9i running in the Oracle jvm (including the ose) -- but not the apache jserv component.
    JDBC in the Server: the Server-Side Internal Driver
    http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/java.817/a83724/advanc4.htm#1001042
    i hope this helps ....

  • What kind of visa session should i use to communicate with a serial instrument?

    I´m trying to communicate with a serial board, i don´t want to use the Measurement and automation explorer, so the resource name should be COM1 instead of ASRL1::INSTR, how can i do this?. What king of session should i use? Waht visa VI should i use to open, close read and write from the srial port?. I want this to work with out MAX. Thanks in advance

    The below link dtalks about LabVIEW.ini settings.
    Go to this link and scroll down to the entry for serial. It will show you the syntax you need and alos provide another link for more info.
    I seem to remeber (not sure) that Visaconfig.ini defines the aliases normally assigned by MAX.
    http://labview.brianrenken.com/INI/undoc.shtm
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • What kind of screen protector should I use for my iPhone 6? Should I use one?

    I'm looking for a screen protector for my brand new baby. To my dismay, it's hard to find one that "fits" because of the curved edges. I have ocd, not to mention that what isn't covered by a screen protector are usually crucial areas. Can anyone recommend anything? I always use a screen protector because I'm super paranoid. I throw my phone in my purse a lot where I feel like it will come in contact with one too many things that can scratch it. I don't have a ton of money to spend, sorry I'm a college student. Also, I don't like glass protectors. If I need one I'm looking for a film. Thanks in advance from a new iPhone 6 parent!

    I have an iPhone 6 Plus but I thought I would try to help you out!! I use the Zagg Glass Invisible shield and I must say at first I loved it! It feels smooth and accepts input super well! It doesn't, however, go all the way to the edge of the screen which is weird, I agree. I've only had it for about a month now and its already chipped on the top edge by the speaker and its super annoying!! They will replace it for free but I'm not sure that I want another one that chipped so easily.
    I've heard great things about the iloome screen mate and it goes all the way to the edge of the screen and covers the curved part. I know you said you don't like glass protectors but those are the best and if you get a good one you pretty much only need to replace it once a year so you pay a bit more up front but it lasts a lot better than just film ones. Hope that helps!!!!!

  • What kind of SD card should I use?

    Just to make sure, could somebody tell me which cards are compatible?

    Thank you! I was using a 64 gig I bought on eBay, and it wouldn't work. I thought it was because it was exFat (you know like it still had to be FAT, not exFAT),  but I believe the card was just defective (the files I copied to it kept disappearing). Well, I am going to be able to return the card, and I just wanted to make sure I was buying the right kind.

  • HT3500 i just want to connect with hp printer what kind of wire i should use

    i just want to connect with hp printer what kind of wire i should use

    Is your HP printer wireless? If so, no wire.
    If it isn't plug it in using the cable it came with. Simple.

  • What kind of version checking should be done for applications using SQLDBC

    Hi,
    This query is regarding the kind of version checking that an application should do.
    Currently I am building my application in MaxDB version of 7.6.05.09, which is the community edition available on the sdn download site currently, this will change to the enterprise edition once we have finalized everything in terms of code and packging etc....
    Now when the application is shipped to customer site, what kind of version checking should the application do to ensure that the version of library/kernel/client/sdk it has been built with is consistent with the one that is installed at the customer site.
    From what i see SQLDBC exposes the following method for getting version related information.
    char * SQLDBC_Environment_getLibraryVersion(SQLDBC_Environment* hdl);
    char *getSDKVersion();
    SQLDBC_Int4 SQLDBC_Statement_getKernelVersion(SQLDBC_Statement* hdl); (Note: Wondering why should a handle to SQLDBC_Statement be needed to find the Kernel version)
    Just to give you little more hint of what i am talking about, for MySQL database we use the functions
    mysql_get_client_version and mysql_get_server_version and check that the values returned by these functions are less than the value which was used at build time.
    Regards
    Raja

    Hello Raja
    From the documentation:
    const char* SQLDBC::SQLDBC_Environment::getLibraryVersion ()   
    Returns the version of used SQLDBC runtime.
    This is the version of the used SQLDBC library. The version of the loaded
    runtime may differ from the version inidacted in the used header. It is our
    aim that newer versions of the runtime will run with old applications without
    the need to be re-compiling.
    Therefore, for compatibility checks, use getLibraryVersion.
    getKernelVersion is also available from the connection:
    SQLDBC_Connection::getKernelVersion()
    Regards  Thomas

  • What kind of external drive should I get for my macbook pro for backups etc

    what kind of external drive should I get for my macbook pro for backups and storage

    Hi, i have a Mercury Elite-AL Pro from OWC, www.otherworldcomputung.com
    this is the one;
    http://eshop.macsales.com/item/Other%20World%20Computing/MEAQ7S1TB32M/
    have had this for over two years, moved around a lot with the drive, ( to date ) no problems, they have good after sales support; give them a call if you need info.
    There are a lot of drives out there as others here will let you know, there are good NAME drives but they also fail, POPULAR drives also fail, select the one you are happy with for your system and how you plan to use.
    i suggest if $ is not a problem get a big drive you will find someting to put on it and is better.
    hope this helps.

  • If my iphone 4s doesn't support 4G LTE, then what kind of data would I get from the plan with 4G LTE Data?

    I am currently have iphone 4s. I am planing to use the plan which have 4G LTE for data; however, my phone doesn't support 4G LTE. So, i want to know what kind of data would i get from this plan. Is it gonna be 4g or 3g or no data at all? I am very confused right now.
    The plan is UNLIMITED WEB & TEXT WITH 100 MINUTES TALK.  Up to 5Gb of nationwide 4g lte data.
    If you look at the plan it has 4g lte data, but my phone doesn't support it. Please answer my question.

    Ask the wireless provider you have the plan with - they should be able to tell what speed
    you will get if you cannot connect at 4G/LTE.
    Your iPhone will connect at the highest speed it can by default. But not all wireless providers
    offer 3G as the fallback connection on their 4G network - some fall back to 2G.

  • I need in Formula Node to assign to the variable value 4000000000!!! What kind of variable it should be???

    i've just tryed to write unsigned in32, but it does not understand 'unsogned'... But i need variable to be unsigned, because the max value = 4000000000... So, how can i solve this probleme???

    Hi,
    I don't see exactly what you're trying to do here.
    Where do you want to assign the variable 4000000000 to? If you want it as an
    input, just use a dbl, with only zeros behind the coma.
    Note that an integer is a number without any decimals. An integer in LabVIEW
    is this, but with an extra limitation that it can only be 32 bits... So a
    dbl can be an integer.
    If the input dbl is not an integer, use round, round to -inf or round to
    +inf to make it one. This can also be done if the output needs to be an
    integer.Inside the formula node floor(x), int(x), intrz(x) or ceil(x) can be
    used to make integers.
    I hope this is what you mean... I can't see any problems doing this.
    Regards,
    Wiebe.
    "DrON" wrote in message
    news:506500000008000000E
    [email protected]..
    > I need in Formula Node to assign to the variable value 4000000000!!!
    > What kind of variable it should be???
    >
    > i've just tryed to write unsigned in32, but it does not understand
    > 'unsogned'... But i need variable to be unsigned, because the max
    > value = 4000000000... So, how can i solve this probleme???

  • What kind of graphics card should i get to run final cut pro x on my 2008 mac pro?

    What kind of graphics card should i get to run final cut pro x on my 2008 mac pro?

    Hello Andres. I own an Early Mac Pro 2008, and have had the blessing of using both FCP X & Motion 5 for some time now. This is a pritty open question and it depends on your usage and the throughput nessesary to handle your work load. I can share what my set up is, & it may help you deside if this is enough power for you or help you move in another direction. Keep in mind that the buss speed and cpu are a big part of helping FCP X more so than the video card, although the video card does come into play here as well. Now if you are wanting to run Motion 5 as well, the video card is Almost Everything, and you need the biggest and best situation here that the throughput on this system will except. I'm running 14 gig of system ram, and the video card is an ATI Radeon 5870. For FCP X, running 1920x1280p footage optimised in pro-res 422, she can move along with some render time nessesary when dropping on the timeline, also filters, transistions, titles ex, have a bit of a laps time to render, but then she runs ok. This wait is not as much of a challenge with this set up as with Motion. I need a much bigger gpu on the video card for this app. Not sure if this computers throughput is really worth the upgrade. Beleive this though, Motion is demanding on using ALL you can give it. It is a Genious App, and it also calls for ALL THE POWER YOU CAN GIVE HER IN A VIDEO CARD. Conclution: if you are just starting which it sounds like, even a smaller video card than this can work For FCP X. Make sure you have at least 8 gig of cpu ram. 12 or more will help here. Also make sure the card is OpenCL compadible.....& this is in the thread above,,,,,,,,

  • What type of hard disk should I use if I want to use it on mac and windows?

    Hey Forum,
    I am using windows xp on my macbook (snow leopard). I came across some dealers who say that there are hard disks for mac only and for both mac and windows. So, I wanted to buy a hard disk so that I can use it both on mac and windows xp, so what type of hard disk should I use? Must I partition into 2?
    or are there any harddisk in the market which is compatible for both mac and windows xp without screwing up the format(NTFS/Mac OS X Journaled)? Pls look into this matter and help me with it.
    All of your replies and suggestions is much appreciated.
    Thank you.
    Ala.

    Run, don't walk, from that dealer! and never look back
    Once in a very long while Apple will have customized firmware on drives, and it is possible to find SCSI/SAS or drives that are destined to be used with high end storage controllers.
    But that is the exception that makes the rule.
    SATA is SATA. Though.... there are now SATA III drives that don't work in XP, or that need a jumper, and Seagate and some drives have managed to deliver firmware that has caused trouble... and Apple has had to issue firmware updates to help compatibility....

  • What version of Flash Player should I use with my Power PC based Mac?

    I did the following (see below from a Recent Forum) - and even got a sucessful INSTALLED, but when I go to YouTube....I can not get anything and I am asked to update FLASH.....thoughts?
    What version of Flash Player should I use with my Power PC based Mac?
    Please follow these instructions for installing the most recent version of Flash Player that supports PowerPC based Macs
    1. Follow the instructions for uninstalling Flash Player on the Mac: Uninstall Flash Player
    2. Download and extract the Flash Player 10.1.102.64 zip file
    3. Navigate into the folder "/Flash Player 10.1.102.64/10_1r102_64/"
    4. Mount the file "flashplayer10_1r102_64_ub_mac.dmg" by double clicking
    5. Install using the normal procedure

    I was finally able to successfully installed FP on my Mac OS 10.5.8 using the last trick shown below by Chris (Adobe Flash Player.pkg file). This, only after several (at least 10) attempts, and only after restarting my computer after downloading the install file. Thanks for the helpful post.

Maybe you are looking for

  • Tableview getting refreshed when changing data in the rows

    Hi Gurus, Iu2019m doing a BSP with MVC. The requirement is as below. In the main page there is a button u2018Create Orderu2019, to create a sales order, once I click this button, another screen (pop up) comes up and within that I have a Tableview dis

  • What is the best way to add photos to Imovie6 to retain quality?

    When importing to timeline viewer, photos when previewed appear to be of less quality. I have tried scaling 620x480, with similar results. Previewing on a macbook pro. Is it the previewing? What is the best (recommended) method for placing stills int

  • TiBook Display keeps "falling asleep"!

    Hi there, I have a 550mhz TiBook whose display has been causing me some serious headaches. Basically, it will spontaneously go to "sleep" for no apparent reason when I am doing normal tasks. The problem seems to be worse when I am in MS Word or Text

  • Max resolution for QT movies??

    I have watched a few TV shows I have downloaded from itues via QT on both my windows machine and my ibook. My Windows machine I use a 20" Apple Cinema Display and is powered by an ATI850XT vid card. Since it is a 20" ACD the resolution is 1680x1050.

  • Google TV Remote App

    Will someone be developing a Google TV Remote App for blackberry like the android has so that I can operate my google tv and tv with my phone like my daughter does with her android?