A set of sets

I was trying to create a Set of sets of strings earlier today but getting an odd error from the compiler. My code looked something like this.
Set< Set<String> > finalSet = new LinkedHashSet< LinkedHashSet< String> >();and the compiler error was as follows
Controller.java:27: incompatible types
found   : java.util.LinkedHashSet<java.util.LinkedHashSet<java.lang.String>>
required: java.util.Set<java.util.Set<java.lang.String>>
                Set< Set<String> > finalSet = new LinkedHashSet< LinkedHashSet< String> >();Neither me nor anyone i know could see anything wrong with my code and i still havent figured out why it couldnt upcast the LinkedHashSet up to a set. When i changed my code to the following it worked fine though
LinkedHashSet< LinkedHashSet<String> > finalSet = new LinkedHashSet< LinkedHashSet< String> >();Also, when i changed my code to that I got another error in a later function which looks like this
finalSet.add((LinkedHashSet<String>)getResults.parse(regex, args[0]));getResults.parse() returns a set of strings but until i put the cast (LinkedHashSet<String>) on that result i was getting the following error
Controller.java:29: cannot find symbol
symbol  : method add(java.util.Set)
location: class java.util.LinkedHashSet<java.util.LinkedHashSet<java.lang.String>>
                finalSet.add(getResults.parse(regex, args[0]));which strikes me as a bit odd. Why couldnt it find the add method?
The entire thing confused me quite a bit so any help would be appreciated.
Thanks,
Sean

Or you could try this (untested) code:
Set< Set<String>> finalSet = new LinkedHashSet< Set<String>>();
String[] sa1 = {"a","b","c"};
String[] sa2 = {"d","e","f"};
Set<String> set1 = new LinkedHashSet<String>(Arrays.asList(sa1));
Set<String> set2 = new LinkedHashSet<String>(Arrays.asList(sa2));
finalSet.add(set1);
finalSet.add(set2);
System.out.println(finalSet);

Similar Messages

  • I am getting an unable to connect error messagen when I start the browser. The setting is set to "no proxy" and my internet connection is working fine. What can I do to fix this?

    I opened up my firefox browser yesterday and it crashed. Since then I get an error message that says "unable to connect" every time I try to load the browser. The setting is set to "no proxy" So it should be connecting. My internet explorer browser is working fine. So I know it is not my internet connection. What can I do to make the firefox browser work again?

    Hi,
    Maybe the radio connection on the other end is not working. Hope this helps.
    xxmitchxx90

  • Where is the setting to set up pages instead of spreads? Need to pdf separate pages from a spread setup.

    Where is the setting to set up pages instead of spreads? Need to pdf separate pages from a spread setup.

    This is the selection you're looking for:

  • SAP Netweaver/General settings/Set Countries/Set Country-Specific Checks

    Hi All,
    following the customizing navigation:
    SAP Netweaver/General settings/Set Countries/Set Country-Specific Checks
    By the flag "Other data", I can activate the check of tax numbers.
    So, SAP gives me an error message if a tax number filled in master data of customers or vendors is wrong.
    I'd like to change the message in warning...
    I've tried to do it, but without unsuccessfully.
    Could anyone help me?
    Thanks

    Hello,
    This is a cross client activity which is not directly available in the system in OBA5.
    The error message that is AR191
    You need to go to transaction code OBMSG and enter the message number in application area.
    In case if you get a warning message at this time stating that: "Changes to Repository or cross-client Customizing are not permitted". In that case you need to check with your basis administration to allow the cross client settings in SCC4. Until you make necessary changes in SCC4, your OBMSG transaction code is in ONLY DISPLAY mode.
    Application Area: AR
    Message No.191
    Allowed: W
    Standard: E
    Save your entries.
    Now this is available in OBA5 and give the application area AR and enter the message number.
    In Online and batch put the message number to W.
    Save your entries.
    Hope this solve your issue.
    Regards,
    Ravi

  • How do you set the setting in iPhoto to ask before deleting a picture?

    How do you set the setting in iPhoto to ask before deleting a picture?

    If you delete a picture, it sends it to iPhoto trash (left column), there you can permently delete using the empty trash with the icon in the upper right corner. It will come up with a warning if you want tp permently delete trash (photos).  It the iPhoto trash you can drag them back out, once you empty the trash, they are gone.
    You can also go to finder preferences>advanced, and unclick secyre empty trash, and make sure show warning before empting trash is clicked.

  • How to set Content Set from 'Parallel' to 'Sequential' in Report Manager?

    Dear All,
    How to set Content Set from 'Parallel' to 'Sequential' in Report Manager?
    Thanks,
    Jackie

    Sorry, Please ignore, thanks...

  • Next Set / Prev Set buttons

    HI,
    I have a concert that I've set up in which each set has a patch with a Playback plugin that plays my backing trax. The next set button is configured at the concert level. but it doesn't work. I have my Playback plugin instituted at the Set level, so my footpedal on my line 6 Toneport will start/stop playback. If I put in even just an empty patch in a set, playback doesn't work, but then the next set/prev set buttons will. I've got about 50 songs in my Concert.
    Thanks,
    St Mix

    To the Oracle Reports Team,
    Could you or anyone else send me, a sample code of a jsp report that uses startRow and endRow attributes in rw:for each JSP tag. I couldn't find out how to include and use these attributes in the example mentioned in reports9i online help.
    Any help in terms of a sample report will be greatly appreciated. My mail id: [email protected]
    Thanks,
    Bharat

  • Is it possible to set character set at instance level?

    hi all,
    I have some confusion.
    say my database character set is AL32UTF8.
    and i want tio set charcter set of instance is WE8MSWIN1252
    Is it passible to set character set at instance level?
    Please reply with yes or No or why?
    Thanks & Regards,

    Hi,
    It's DataBase Level. One best example would be when you try to change the character or characterset conversion by using "Csscan" you can check the log or report. Which can guide what the things are happening. Instance - I think you might be referring to "Session".
    - Pavan Kumar N
    - ORACLE OCP - 9i/10g
    https://www.oracleinternals.blogspot.com

  • My Deskjet HP7610 can't sense the 11 x 17 paper on any of my Acrobat or Photoshop "fit to media" jobs.  Why, after I've set every setting to 11 x 17 do both printer and computer cite "paper size mismatch?

    My Deskjet HP7610 can't sense the 11 x 17 paper on any of my Acrobat or Photoshop "fit to media" jobs.  Why, after I've set every setting to 11 x 17 do both printer and computer cite "paper size mismatch?

    Mandeep5062 wrote:
    Moving to Photoshop Forum
    Try again.

  • Setting Application Set Parameters For Variable

    Hi Guys,
    When I've read the BPC help about "Setting application set parameters" and the statement likes this : 
    Allows you to define a custom email message that is sent when a work status code is changed. The message is applicable to all applications in the application set. You can customize the message using the following variables:
    %USER% - name of user who changed the status
    %ED% - Entity dimension
    %EM% - Entity member
    %CD% - Category dimension
    %CM% - Category member
    %TD% - Time dimension
    %TM% - Time member
    %STA% - Work status
    %OWNER% - Entity owner
    %TIME% - time of change
    For example, you can enter "This is to inform you that %USER% has updated the work status for %EM%, %CM%, %TM% on %TIME%". The message can be up to 255 characters, and there is no need for quotes or brackets around parameters.
    The Questions:
    When I put the "%ED" into the textfield "APPROVALSTATUSMSG", after that I try to send email from BPF and the "%ED" still same into the email message. But it should describe the value of variable.
    Could you help me how to view the value of variable ?
    Thanks,

    If I look at the available parameters in the helpfile 2 things are strange in my opinion:
    1)the parameter is called approvalstatusmsg, approval status was the V4 naming convention of the function, right now it is called workstatus, so it might be a V4 function. Never used it myself but maybe it is something not correctly migrated to v5.
    2) Even if it is working in V5, which I don't know for sure, then it is strange that you only have variables for Categroy, time and entity, since you can setup the workstatus for more then these 3 dimensions in V5 which you would also like to have in a case you set it up for more then 3 dimensions. For example for if you want to use Category,time,Entity & Product dimension in the workstatus, you would also like to inform the people which product is updated, since only just category,time and entity won't say that much.
    So I think you best check with support if this function is still usable in V5 or if it is an old function from V4. and if it is working in V5, how do you get the right parameters in the variables when you setup workstatus for other dimensions then just Category/time/Entity.
    I would like to know the results!
    Joost

  • Repeat button set is set to white= off.  but next song always plays

    Repeat button set is set to white= off, but the next song always plays with shuffle either on or off.
    The other two (Blue) Repeat options function properly.
    Any ideas or suggestions?

    If you touch the screen in album cover mode it will bring up the controls for repeat and shuffle. This is all covered in the iPod User Guide available at: http://manuals.info.apple.com/enUS/iPod_touch_iOS4_UserGuide.pdf

  • When I insert sim into iPhone 3G and network setting I set Enable 3G off

    when I insert sim into iPhone 3G and network setting I set Enable 3G off so my own iPhone 3G has no service

    what?

  • How to SET CHARACTER SET UTF8

    I am looking to execute something like the stmt "SET CHARACTER SET UTF8"
    However if i put the above stmt in a SQLDBC_Statement_execute call, i get fail message.
    I should also mention here that, SQLDBC_Connection_connect call provides a way to provide the character set as one of the parameter. Is that the only way we can set character set from an application while using SQLDBC ?
    Regards
    Raj

    Hi Lars,Elke and Thomas,
    Thanks to all of you for your valuable input. Honestly speaking i'm little lost on how to go about this requirement of unicode support for my application. Please allow me some more time to investigate this and then get back to you.
    In my application for all other databases a simple execution of "SET CHARACTER SET UTF8" is all that's been done to set the support for UTF-8. So, I really need to figure out what all changes needs to be done in the app if this is not going to work.
    In the meantime something more caught my attention while i was using this command:
    sqlcli MAXDB1=> \dc domain.columns
    Table "DOMAIN.COLUMNS"
    Column Name
    Type
    Length
    Nullable
    KEYPOS
    SCHEMANAME
    CHAR UNICODE
    32
    YES
    OWNER
    CHAR UNICODE
    32
    YES
    What does the type  'CHAR UNICODE' for Type means here?
    Regards
    Raj

  • ON RESTORING 1601 ERROR COMING HOE WE SET SECURE SETTING FOR RESTORE AND UPDATE

    ON RESTORING 1601 ERROR COMING HOE WE SET SECURE SETTING FOR RESTORE AND UPDATE

    If you don't have a sim card in the phone, you won't be able to activate it. You can't activate any GSM iPhone without a valid sim card installed in the phone. The sim itself need not be activated, but it must be valid & present.

  • How to set up set which NIC card to use for multicast?..

              I just downloaded Rolling Patch 1 for WLS6.0SP2.
              While reading the README file it says
              " ISSUE 42518: Provided a way to set which NIC card to use for multicast traffic
              Can anyone tell me how to set this?. on my WebApplication server it has two NIC
              cards and I want to use the NICcard which is being used to talk to internal network
              for multicast messages.
              One more thing,
              Can anyone one tell how to search for bugs (ISSUES) in weblogic. I am looking
              place where I enter ISSUE number and should get the detailed description of bug/issue
              etc..
              Thanks for helping,
              Nilesh
              

              Thanks Kumar, I'll try this.
              Does this -Dweblogic.interfaceAddress used only for multicast. Or this is also
              used to talk to AdminServer?.
              The other problem I am facing is when I restart the AdminServer in recovery mode
              it's not finding my WebApp servers, because my webapp servers are on public network
              and my admin (management) server is on private network.
              please look at http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.management&item=1217&utag=
              , for more details about my problem.
              Thanks,
              Nilesh
              Kumar Allamraju <[email protected]> wrote:
              ><!doctype html public "-//w3c//dtd html 4.0 transitional//en">
              ><html>
              >You should be able to do it via console in 6.1
              ><br>Not sure if it was added in 6.0
              ><p>For 6.0 you can set this via command line
              ><br>java -Dweblogic.interfaceAddress=<addr>
              ><p>You need 6.0 SP2 RP1
              ><p>--
              ><br>Kumar
              ><p>Nilesh Shah wrote:
              ><blockquote TYPE=CITE>I just downloaded Rolling Patch 1 for WLS6.0SP2.
              ><br>While reading the README file it says
              ><br>" ISSUE 42518: Provided a way to set which NIC card to use for multicast
              >traffic
              ><br>"..
              ><p>Can anyone tell me how to set this?. on my WebApplication server it
              >has two NIC
              ><br>cards and I want to use the NICcard which is being used to talk to
              >internal network
              ><br>for multicast messages.
              ><p>One more thing,
              ><p>Can anyone one tell how to search for bugs (ISSUES) in weblogic. I
              >am
              >looking
              ><br>place where I enter ISSUE number and should get the detailed description
              >of bug/issue
              ><br>etc..
              ><p>Thanks for helping,
              ><p>Nilesh</blockquote>
              ></html>
              >
              

Maybe you are looking for

  • Ipod touch and security on public wi-fi

    My wife was driving around town today and with my new ipod touch I was curious how many wi-fi signals I could pick up. In about a 6 mile trip I saw about 15 separate signals. Of course some were locked down with encryption, but other were not. I coul

  • Import swf files in CP3, but export without any voice?

    Did anyone have the same problem with me? I imported swf file in slide and published. But I can't hear any voice in the slide.... At the same time, I tried to import as flv file and published, then it works. Voice in slide can be heard with no proble

  • Touchscreen is not working

    The touchscreen of my iPhone GS is not working so my phone is frozen.  I can't open it or shut it down because the slider will not  move.  Any solutions?  Thanks!

  • IPhoto 6 goes really, really slow

    Hi, my iPhoto 6 is going really, really slow, and as soon as I open iPhoto 6 other open programs go slow too. First I thought it must be the size of the pics but with other Photo editing programs everything seems to go with normal speed. Has anyone g

  • IPhoto stalls entire system when importing photos

    Just ran into this issue on my new iMac. I have been trying to import a group of photos (either by drag and drop or import menu item). It's a group of 17 pictures, a mix of tif and jpeg, that I'd like to import as a single "Event". Every time I try i