Need help to map a key in hashmap

hi guys,
I want to find a value from hashmap.
But the key should be matched a regex.
I want something like...
hashmap.contains(regex key)Thanks in advance...

Dhaval.Yoganandi wrote:
But I dont want to iterate through all the keys...Then stop as soon as you've found one.
Edit: Why don't you want to iterate through all the keys?
is there any other solution ? Otherwise I've to go for iteration..Not really. You could store your data in a different data structure that is more useful for searching for regex, but all solutions will come down to linearly searching through all (or some) elements and checking the regex.
If you don't really need the full power of a regex, then you might find a better datastructure, for example using a Trie for prefix-matching.

Similar Messages

  • Hi i need help one of my key on the keyboard dosen't work for some reason please help

    hi i need help one of my key on the keyboard dosen't work for some reason please help

    try smc reset
    http://support.apple.com/kb/ht3964
    and Pram reset
    http://support.apple.com/kb/ht1379
    (Try pram a few times to get correct sequence)
    Check what you have selected in
    system preferences/system/accessibility/keyboard
    and system preferences/hardware/keyboard  (keyboard and keyboard short cuts tabs)

  • Need help on maps v3.04

    i need help for map v3.04. i just downloaded the v3.04 and i notice it doesn't have GPS signal on the map. last time i was using v3.03, it has. the problem is, i have disabled the connection of internet. but when i use the map v3.04 for navigate, my credit still affected. i wonder why. is it using v3.04 is still ok or do i need to use v3.03. how to install v3.03 since the updater only have new one.thanks
    Solved!
    Go to Solution.

    You should be able to use V3.04 without incuring any network charges as long as you have it set up correctly. Check the following.
    Start the Location application and click on Positioning>Positioning methods. Make sure everything other than Integrated gps is unticked.
    You will also need to download all the required map data. To do this, connect your phone to a pc using Ovi Suite and download the relevant map data. After that, start Maps, click on the Spanner icon>Internet>Connection, set this to Offline.
    As for the signal bars, this has been replaced by the red dot on V3.04. The dot stops flashing when position fix is obtained. Sometimes you may see a pink halo around the red dot. The size of this halo gives you an indication of the position accuracy. The bigger the halo the less accurate the fix.

  • Need help with locating a key using a value in a HashMap.

    I am quite new to Java and programming, and am just learning this in High School (enjoying it thoroughly). Sorry if I don't respect the etiquette or formatting of this board (it's unintentional).
    I am using the book, Objects First Wth Java A Practical Introduction Using Blue J and am working on extensively improving the "World of Zuul" project. Which is a text-based adventure game.
    Here is a code sample;
    public String getNameFromList(String name)
      boolean found = false;
      Set pairSet = xItemList.entrySet();
      for(Iterator iter = pairSet.iterator(); (found == false && iter.hasNext());){
      Item currentItem = (Item) iter.next().getValue();
      String currentKey = currentItem.getName();
      if(name.equals(currentKey)){
        String changedName = iter.next().getKey();
        return changedName;
    error; cannot resolve symbol:
    method: getValue()xItemList is a HashMap with String keys, and Item values.
    The relevant field of Item is name, which is a string.
    The currentKey local variable is a little misleading, it is the current name, but acts as the 'key' when looking for the actual key.
    changedName (if the parameter name is found from the item.getNames()), is what the method returns, the key associated with a object (by looking at the object's field).
    My objective for this method is for it to have a name as a parameter, which it searches for in the HashMap (by Iteration over the entrySet - or I suppose iteration over Set values(), but this loses which object value is tied to which key, doesn't it?), and returns the respective key.
    Any help would be very much appreciated (even if it is telling me that this can't be done with HashMaps!).

    It's not clear to me what your question is, or if indeed you even have a question.
    You seem to be having a problem with types. Iterators return Objects.
    So in this line:
      Item currentItem = (Item) iter.next().getValue();The iterator's next() method is returning an Object, and you're trying to call getValue() on that Object. But Object doesn't have a getValue() method. That would explain your error message. Map.Entry does; you apparently meant to call Map.Entry's getValue() method. You would cast the result of iter.next() to Map.Entry before you call getValue().
    Also you're calling next() on your iterator twice in the body of the loop, which means you're getting two different values... this is probably not what you intend.
    But you're making this more complicated than it needs to be anyway.
    Why are you iterating through the set of entries in the HashMap?
    The whole point of a Map is that you get an item using an object as the key. Just do xItemList.get(name). Right?

  • Need help on mapping of obsolete and new function module

    Hi Expert,
    We are working on a  upgradation tool in which i have to repace the obsolete function module "HELP_VALUES_GET_WITH_CHECKTAB
    " by "F4IF_FIELD_VALUE_REQUEST
    ". I am not sure about the functionalities of these function modules as i have never used it. Can anyone please help me  by providing some information abt  these FMs. Also i need to do the mapping of parameters of old and new function module. So please provide the details of mapping also. Any pointers on this will be highly appreciated.
    Thanks & Regards,
    P Sharma
    Moderator message : Duplicate post locked.  Continue with [Parameter mapping of FMs|Parameter mapping of FMs;.
    Edited by: Vinod Kumar on Jul 8, 2011 9:40 AM

    Hey Enivass,
    you can ckeck the input field "Account Number" whether it is numeric or Alphabet using *"Conversions ->Fixvalues"*
    Steps:
    1.  Extract first character of input using *" Text -> substring"*  -- start position 0 , char count 1 
    2. In Fix Value table you have to give following values:
    Dafault value : Alphabet
    key----
    value
    0----
    Number
    1----
    Number
    2----
    Number
    9----
    Number
    3.  Write logic IF "number" than  "Arithmatic -> FormatNumber   (0000000000)   -
    // for leading zeros
             ELSE
         concat with extra space        -
    Thanks

  • Need help with adding a Key flex field to a seeded OAF page

    We have a seeded OAF page on which we already have Account Key Flex Field.
    Properties of this flex field are:
    The ApplShortName - SQLGL
    Name - GL#
    Type - Key
    As per the client requirement, in the KFF screen, we have disabled the seeded structure for Accounting Flexfield and created a custom structure.
    Our custom structure for the KFF is displayed correctly on the OAF page.
    But now the requirement is to add a new KFF on the OAF page which is duplicate of the existing KFF, along with the existing KFF field; the structure and segments are same. Only difference being the display name of the existing KFF field is Account; the new one needs to be Tax structure.
    Using personalization we added a new flex item and added the properties same as the existing KFF.
    ApplShortName - SQLGL
    Name - GL#
    Type - Key
    But the page is giving following error:
    The data that defines the flexfield on this field may be inconsistent. Inform your system administrator that the function: KeyFlexfieldDefinitionFactory.getStructureNumber could not find the structure definition for the flexfield specified by Application = SQLGL, Code = GL# and Structure number =
    We tried options like compiling the flexfield definition, but the error persists.
    Any help in this regard is highly appreciated.
    Regards,
    Kiranmayi.

    Hi,
    Please check whether your key flex structure is frozen or not. If now please freeze it and re compile and try.
    This may helps too
    error while developing KFF in oaf
    Thanks
    Bharat
    Edited by: Bharat on May 10, 2013 4:51 AM

  • Need help with mapping

    Hello professionals,
    I need to map this structure
    <message>
    <node1>
       <ab>1</ab>
       <ab>2</ab>
       <ab>3</ab>
    </node1>
    <node1>
      <ab>3</ab>
      <ab>4</ab>
    </node1>
    <node1>
       <ab>5</ab>
       <ab>6</ab>
       <ab>7</ab>
    </node1>
    </message>
    So, in the target structure I need to take only the first "ab" occurence in node1:
    <message>
    <node1>
       <ab>1</ab>
    </node1>
    <node1>
      <ab>3</ab>
    </node1>
    <node1>
       <ab>5</ab>
    </node1>
    </message>
    How can I do this? Many thanks for help!

    Hi,
    You can use COLLAPSECONTEXT or COPYVALUE(0) function
    see this
    http://help.sap.com/saphelp_nw04/helpdata/en/26/d22366565be0449d7b3cc26b1bab10/content.htm

  • Need help with mapping( UDF)

    Hi,
      I had a mapping requirement where i need to transfer data with double quotes
          suppose data is
    sap-labs
    i need to send as "sap-labs".
    The main problem is when ever there is '-'(it can be any where in the string) I need to modify as above, otherwise data can be sent directly.
    I know how to do this requirement using Standard Functions.But, I am trying to use UDF so try to help me out with the code.
    and also what i have to import for this UDF. and why i have to import them?
    Thanks in advance,
    Siva.

    Hi Siva Bonthala,
    Note: - quote ("), apostrophe ('), ampersand (&), less than (<), greater than (>) are special characters in XML. They should not be present in data. [Link1|http://www.w3.org/TR/REC-xml/] [Link2|Re: Special Character Handling (&) in the payload content in PI 7.1]
    When you writing Java code to insert these special characters, you should use escape scequence characters.
    Test it for your self, in graphical mapping, use 'concat' function and type Delimiter String as ". Then check output XML, it will contain &quot ;.
    If you have to replace sap-labs with "sap-labs" for many element, I recomand you to use Java Mapping instead of UDF's for every field.
    Regards,
    Raghu_Vamsee

  • Need help in Mapping Logic

    Hi all,
    In mapping i need to mapp like this
    Idoc--file scenario, sending delivery document to file system
    in header of file structure, i have a field called Total Units, the logic for this field shld be
    Sum up the field ZCONV_QUAN for each delivery.
    How to do this please help me
    Regards

    Hi satish,
    I have to do some thing more in this.
    As you said i mapped the field to sum and to target field.its fine
    Now this field is there at header level and comes only ones, i should repeat this field as many number of times the line item repeats.
    Now iam using the ligic like this
    ZCONV_QUAN--UseOneAsMany-Sum--Target Field
    to UseOnaAsMany function i mapped ZCONV_QUAN as first argument and changed the context to Idoc and the second argument as line Item segment changed the context to Idoc, third argument as line itme segment.
    its giving the error as
    Too many values in first queue in function useOneAsMany. It must have the same number of contexts as second queue
    Regards

  • Need Help to delet sort key! Please help!

    Hi,
    I have a problem in the following program.
    Source Code:
    t-belnr  = bsid-zuonr.
    SPLIT t-belnr at '#' into wk_belnr wk_x_belnr.
    CLEAR t-belnr.
        t-belnr  = wk_belnr.
        t-xblnr  = bsid-belnr.
        IF t-belnr NE space.
          s-belnr      = t-belnr.
        ELSE.
          t-belnr      = t-xblnr.
          s-belnr      = t-xblnr.
        ENDIF.
    IF t-xblnr NE space.                                    "WD041005a
          s-xblnr      = t-xblnr.                               "WD041005a
        ELSE.                                                   "WD041005a
          s-xblnr      = t-belnr.                               "WD041005a
        ENDIF.                                                  "WD041005a
        WHILE s-xblnr(1) EQ '0'.                            "INS MG130606
          SHIFT s-xblnr LEFT.                               "INS MG130606
        ENDWHILE.                                "INS MG130606
    In the final ALV.
    If first colum (t-zuonr) (sort key for the document )is blank, the document need to be deleted.
    Question:
    How can I write the code to deleted the t-zuonr when it is space?
    Please help!!!
    Thank you!!

    Try as below:
    DELETE <itab> WHERE <fld> IS INITIAL.
    i.e
    DELETE t WHERE zuonr IS INITIAL.
    Kind Regards
    Eswar

  • I need help changing the security key for WRT54G2 1.5

    I already know the security key on my network, I just need to change it.  I don't have 'cisco connect'. I've tried the web based method with the 192.168.1.1 IP and using 'admin' for the password, but that gives me a '401 Not Authorized' error.  I've tried using my own security key instead of 'admin' and that doesn't work either.   How do I change this.  I tried to use the Linsky's knowledgebase and that didn't help. Live Chat won't help unless I'm willing to sign-up for some paid service plan, and there is no way I'm doing that.  I've never heard of a company charging their customers just to explain how to do something. All I have is a simple question about how to change the network security key when I already know what it is and there is no problem with the connection. Can anyone help me.  PLEASE.

    If admin didn’t work, it’s possible that you might have setup a different password to login to the setup of the router when you initially set it up. Since admin and your security key didn’t work when you tried accessing your router page, the other option for you then is to reset the router. Push and hold the reset button on the router using a pin or a paper clip for 30 seconds and unplug the power cord for another 30 seconds. Once the power light goes solid, you may start reconfiguring the settings of the router. For instructions, refer to these links: Setting up a Linksys router with Cable Internet service & Setting up a Linksys router for DSL Internet connection. Once you establish the wired internet connection, you may then start reconfiguring the wireless settings. Go to the Wireless tab: set the wireless configuration to manual; set a network name; then save the settings. Once saved, click on Wireless Security subtab:  set the security mode to WPA2 Personal and enter a new security key on the passphrase bar.

  • Need help in reassigning 'fn' key to be a command [apple] key

    Hi everyone,
    I have a Japanese keyboard-ed Powerbook 12". I would like to reassign the fn key to function as a command/apple key, primarily for web browsing. I tried adding a keyboard shortcut just for Safari but it wouldn't work and I am ont sure what I am doing wrong.
    The Japanese keyboards only have one command/apple key (on the left side), and it would be nice to have one on the right side instead (close to the arrow keys).
    FYI, the keyboard layout on the right side is currently:
    [kana-switch to JP key] [fn] [enter] [arrow keys]
    Thanks for any help!!

    Hi Nate --
    I'm not certain (in fact, the more I look at it I kind of doubt it), but maybe DoubleCommand might help you do what you want, or at least something approximating that.
    I'll keep looking, but it's the best I can come up with right now.
    -- JDee

  • Need help re-assembling Fn key

    I took my Fn key off to clean out some crumbs that fell underneath and I'm having trouble figuring out how to put the plastic pieces underneath back on correctly.
    Does anyone know from experience how to put these together correctly, or know of documentation that would cover something like this? I don't live near an Apple Store. I can describe the pieces better if necessary but I assume that anyone who knows how to do this would not need that description.

    I think one of these should be what you're after:
    http://www.thebookyard.com/images/manuals/keyreplace.pdf
    http://www.powerbookmedic.com/Manuals/Apple-Key-Replacement.pdf

  • Need help with map ids

    I am getting very confused with generating a map id file, and
    would appreciate a few pointers (using RH7).
    I want to generate ids for *all* topics. I did this with
    auto-generate, and that worked fine (created BSSCDefault.h). Since
    then, I changed some topics (added/deleted) and want to regenerate
    the map file.
    I've tried simply regenerating into the default file, and
    creating a new map file. When I do this, the topics start numbering
    'after' the numbers from the first run. How do I simply blow away
    the original file and start again?
    Next... when I first generated the file, I was using X5. I
    created .h and .bas files. Now, in RH7, I can't find where to
    generate the .bas files. Help?
    Thanks. I'm in a forest/trees situation right now and am sure
    I'm missing something(s) really obvious.

    Personally I prefer manually editing the map (.h) and alias
    (.ali) files in notepad to add/amend mapids as when I first went
    into this area I found the RH dialog more than a little bit
    confusing. However once you get your head around it, it isn't too
    bad.
    The auto generate function works fine the first time around
    but as you have found out, is less clear on subsequent use. You
    could set the mapid options to start at a certain number but this
    applies across all map files. That said, if you add to a new file
    each time this wouldn't be a problem. What may be a problem is
    several releases down the line where you end up with numerous map
    files which makes it more difficult to manage.
    If you were to delete the original map file, you will
    automatically remove all the mapids and their association with the
    topics. This may appear to the easiest way to go if you have all
    your topics covered by mapids. However when you next auto generate,
    you may end up with topics having different mapids from the
    previous version which would mean your application API call
    requiring a change for a lot of dialogs for each release.
    It is best to leave the original map file and mapids and
    added to them as required. I'd recommend having as few mapids as
    possible unless there is good reason (e.g. too many mapids). Just
    select the map file in the RH dialog, add the mapid via the icon
    and then assign the topic to it.
    As far as the .bas file is concerned, this has nothing to do
    with the RH map file. Is this something produced on the VB
    application side?

  • Please I need Help with Map quiz!!!

    I design a map quiz that contain different area in my state, there is button that will be click to load a quiz in a particular area.. I don't know where to start from because i'm still a dummy in flash actionscript.
    I will like if anyone could help before i forget there will be a score board for each area +2 and hotspot +10 mark and the question of each area must be random from xml file and they are different area. please help.......................

    Click here and follow the instructions to change the iTunes Store country.
    (82303)

Maybe you are looking for

  • Istat menus version 3.23 not working correctly on MBP mid 2012

    I purchased iStat menus for my MBP (no r) mid 2012 and it does not seem to work right. It seems to install ok without any messages popping up but once installed where I get the chosen options onto the menu bar I have a problem. When I click on say CP

  • Tabbed Panels: Opening panel with panel number doesn't work with Spry Data

    I have some data inside a TabbedPanelsContent div, and would like to be able to open tabs using links, but it only seems to work with static content. Clicking on tabs themselves loads content correctly, whereas clicking on links does nothing. I tried

  • Why can't I read the text on some web pages?

    I'm using my laptop with a Vista OS and Firefox. Some of the text that appears on web pages seems to be rendered incorrectly on my screen. I'm hoping someone can tell me how this happens. Here is a [http://img840.imageshack.us/img840/151/54855858.jpg

  • N97 Music Player Keeps On Refreshing

    I recently updated my N97 V.20 and the phone is way better than before.. I have problem in my music player when i copy files on my internal 32GB memory and refresh the library it keeps on refreshing then i have to remove battery. When i on the phone

  • Hi downpayments- withholding tax

    Hi Gurus, i updated the vendor master record with withholding tax invoice and payment detials. i deducted withholding tax in case advance and invoice also. i adjusted that in f.54. Now  i want make payment to vendor, the withholding data regarding pa