Mapping some integers

hello
I have this code below which maps out my string keys with string values; once it has maped them out it gets the string keys in the order that they are maped out at.
my problem is that i want to map some integers out with them ( int keys[]={0,1,2,3,4,5,6,7,8,9} )
How would i do this?
please help me
nicky
Hashtable ht2 = new Hashtable();
//Add vector to store results
Vector results2 = new Vector();
Object value2 = null;
String keys2[] = {"FirstName", "LastName", "Id", "Addr1", "Phone","County", "Postcode", "Country", "Addr2", "Town"};
//System.out.println(keys2);
String values2[] = {"ben", "ben", "ben", "mum", "ben","mum", "ben", "ben", "mum", "mum"};
// First, map keys to values in a hashtable
Hashtable hash2 = new Hashtable();
// the code matches values one by one for each of the keys
for(int i = 0; i < keys2.length; i++) {
hash2.put(keys2, values2[i]);
// Then we find each value and remove it from the hashtable
for(int j = 0; j < values2.length; j++) {
ht2 = (hash2);
value2 = (values2[j]);
Vector v = new Vector();
if( ht2.containsValue( value2 )) {
Enumeration e = ht2.keys();
while (e.hasMoreElements()) {
String tempkey2 = (String)e.nextElement();
String tempvalue2 = (String)ht2.get(tempkey2);
if (tempvalue2.equals(value2)) {
                         v.add(tempkey2);
                         ht2.remove(tempkey2);
results2.add(v);

As you probably know you cannot use integers as keys in your Hashtable object, because the keys have to be objects and int is a primitive type, not an object.
Use the Integer wrapper class:
Hashtable ht = new Hashtable();
ht.put(new Integer(1), "number one");
ht.put(new Integer(2), "number two");
To lookup a string:
int key = 2;
String value = (String)ht.get(new Integer(key));
Jesper

Similar Messages

  • How can I see in what maps some table is used?

    Hi,
    Anyone can tell me how can I see in what maps some table is used, without open all of then?
    Thanks,
    Gustavo.

    Good morning Gustavo,
    OWB has some public views defined which can provide you with this information. Check Appendix D (Warehouse Builder Public Views) of the OWB User Guide for all info.
    Log in as the owner of the design time repository, if you run the following query you'll have a basic overview of whic table is used in which mapping:SELECT MAP_NAME         MAPPING_NAME
    ,      DATA_ENTITY_NAME TABLE_NAME
    ,      BUSINESS_NAME    TABLE_OPERATOR_ALIAS
    ,      DESCRIPTION      TABLE_OPERATOR_DESCRIPTION
    FROM   ALL_IV_XFORM_MAP_COMPONENTS
    WHERE  DATA_ENTITY_TYPE = 'TABLE'Good luck, Patrick

  • While field  mapping some fields are missing....

    Hi,
    In field mapping I have some fields are in unassigned status after select auto field mapping.How can I assign this fields ?bcs in standards program this fields are not there.pls guide me..

    Hi,
    In maintain source field option ....you will find a button square button with lines on it ......
    Thanks
    Dipak

  • OMW hangs on mapping some databases

    Hello:
    I am migrating about 20 databases from MS SQL 6.5 to Oracle
    8.0.5. 15 of the databased migrate flawlessly, but 5 of them
    hang on OMW during the mapping phase. I have to "End Task" the
    program to get it to stop. I have played with the source model
    by trying several variations of removing some tables, indexes,
    etc. I can get the mapping to work when I remove all ot the
    tables... but that is not too helpful.
    I am using:
    OMW 1.2.1.0.0
    MS SQL 6.5
    Oracle 8.0.5 on NT for the repository DB (same machine as the
    migration tool)
    Target DB Oracle 8.0.5 on Unix, but I do not get that far...
    Any ideas?
    TIA,
    ~Sean
    null

    15 out of 20 is not bad :-) but our goal is 20 out of 20.
    Please email a schema dump of one of the troublesome DB's to
    [email protected] and development will investigate.
    Donal
    null

  • OBIEE11g maps Some map formatting cannot be displayed

    Hello!
    I'm getting this warning when the obiee11g maps showing more than 500 poligons on OBIEE11g:
    Warning:
    Some map formatting cannot be displayed.
    Edit the query to return fewer rows
    But i realy need to show about 600 poligons.
    Is there a way I can alter this limit?
    Thank you!

    Actually I found out that this is not a limitation.
    There is a parameter in instanceconfig.xml where you can set the maximum number of polygons:
    Inside the ServerInstance tag, you must add the following code:
    <SpatialMaps>
    <ColocatedOracleMapViewerContextPath>/mapviewer</ColocatedOracleMapViewerContextPath>
    <RemoteOracleMapViewerAbsoluteURL></RemoteOracleMapViewerAbsoluteURL>
    <LayerDataLayout>
    <MaxRecords>900</MaxRecords>
    </LayerDataLayout>
    </SpatialMaps>
    It works!
    Tiago Toigo

  • I cant find(map) some data types

    Hello!
    I am doing some test using a Access and SQL Server databases in order to do the mapping of the data types that is offered using the "sun.jdbc.odbc.JdbcOdbcDriver" ,I am using jdk1.3 I have not downloaded any other driver .
    The thing is that I an MS ACCESS table that I have
    Memo Field
    OleObject Field
    Text Field
    DateTime Field
    Currency Field
    When I get thet metadata for that table and aquire the java.sql.Types for the Memo and OleObject Aceess Types I get LONGCHAR and LONGBINARY Java.sql.Types....but I can not find them in the Java API documentation!!!! Are they the same with LONGVARCHAR and LONGVARBINARY that are reffered in the Java API ?
    Am in loosing somthing here?
    Thanks in advance

    They are one and same. Have a look at, http://www.i-mech.com/docs/jdbc/tbl_21_7.html
    Sudha

  • ARD 3.2 Update will not map some keys

    Hi All,
    Have just updated from 3.1 to 3.2 Apple Remote Desktop Admin and found that the remote computer will not map three keys anymore.
    These are '~', ')' and '+' insead, it maps the character on the key without the use of the SHIFT key, i.e. '`', '0' and '='.
    I'm using the "Australian" keyboard layout and have tested on two separate machines now, a PowerBook G4 and an eMac G4. Tried a clean install from CD of ARD 3.0 and upgraded to 3.2 - same issue. Tested all keys on keyboard in TextEdit with and without the SHIFT key and only find these three keys do not map.
    Anyone else experiencing this since te update?
    Cheers,
    PJR
    --

    Hi All,
    Have just had a go at reinstalling (rolling back to) 3.1 ARD.
    It think it's all working ok now - only thing I've lost are my computer lists which shouldn't be too difficult to re-populate.
    These are the steps I followed:
    1. Stop ARD
    sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/k ickstart -agent -stop
    2. Backup ARD files
    mkdir /ARD_backup
    sudo cp -rv /var/db/RemoteManagement /ARD_backup/
    mkdir /ARD_backup/libPref
    sudo mv /Library/Preferences/com.apple.RemoteDesktop.plist /ARD_backup/libPref/
    mkdir /ARD_backup/usrPref
    mv ~/Library/Preferences/com.apple.RemoteDesktop.plist /ARD_backup/usrPref/
    mkdir /ARD_backup/AppSupport
    sudo mv /Library/Application\ Support/Apple/Remote\ Desktop /ARD_backup/AppSupport/
    mkdir /ARD_backup/usrAppSupport
    mv ~/Library/Application\ Support/Remote\ Desktop /ARD_backup/usrAppSupport/
    3. Delete existing files
    sudo rm -rf /var/db/RemoteManagement
    sudo rm -rf /System/Library/CoreServices/Menu\ Extras/RemoteDesktop.menu
    sudo rm -rf /System/Library/CoreServices/RemoteManagement/
    sudo rm -rf /System/Library/PreferencePanes/ARDPref.prefPane
    sudo rm -rf /System/Library/StartupItems/RemoteDesktopAgent/
    sudo rm /Library/Preferences/com.apple.ARDAgent.plist
    sudo rm /Library/Preferences/com.apple.RemoteManagement.plist
    sudo rm -rf /Library/Receipts/RemoteDesktopAdmin.pkg
    sudo rm -rf /Library/Receipts/RemoteDesktopAdmin310.pkg
    sudo rm -rf /Library/Receipts/RemoteDesktopAdmin320.pkg
    sudo rm -rf /Library/Receipts/RemoteDesktopClient.pkg
    sudo rm -rf /Library/Receipts/RemoteDesktopPrefs.pkg
    sudo rm -rf /Library/Receipts/RemoteDesktopRMDB.pkg
    4. Install ARD 3.0
    <Run RemoteDesktop.mpkg on ARD 3 Install CD>
    5. Update to ARD 3.1
    <Run RemoteDesktopAdmin310.pkg to update to 3.1>
    6. Input Serial Number
    Launch the application
    Input XARD-030-000--***-***-***-***-***-***- serial number
    Quit Remote Desktop application
    7. Restore db files
    sudo cp -rv /ARD_backup/RemoteManagement/ClientCaches /var/db/RemoteManagement/
    sudo cp -v /ARD_backup/usrPref/com.apple.RemoteDesktop.plist ~/Library/Preferences/
    cp -rv /ARD_backup/usrAppSupport/Remote\ Desktop/* ~/Library/Application\ Support/Remote\ Desktop/
    8. Logon and test
    You should then have your list of computers in "All Computers" and just need to bulk select the machines you require, set a password and then add to a new container.
    Reference marterial:
    kickstart:
    http://docs.info.apple.com/article.html?artnum=108030
    ARD uninstall:
    http://docs.info.apple.com/article.html?artnum=108021
    No doubt someone else will have a better way of doing this but it's worked for me. Some machines have even remembered their passwords so I don't need to re-enter the whole lot!
    Cheers,
    PJR

  • Value Maps for Collections in Archiver missing some fields

    Hi all,
    I'm using Archiver and I need to map some of my folder metadata like the profile trigger but when I'm at the "Edit Value Maps" to map the old value to the new value for this field I find that the field I want is missing (in fact all fields that start with ColMeta. are missing.. something tells me these are the fields that are custom).
    It does not let me do a custom query either! is there any way I can get this to work?
    This field does appear for Content tho, it's just for folder/project metadata.
    I'm looking into doing a "Field Map" from ColMeta.xProfileTrigger to some field available and then use that field for the value map but I'm not sure of the implications this will have in the field I choose since those others are fields used for something else and I don't want my mapping going to that other field.
    Thanks for any help,
    malky

    Well nevermind I solved it, but I'll say how in case someone has the same problem:
    Just create the archive with any field, then go and replace that field with the one you want everywhere in the archive.hda file.
    If someone has a more elegant or better way to do this I'd like to hear it for future reference.
    Cheers,

  • Reg ABAP-XSLT mapping

    Hi All,
           One of my inetrfaces i am using ABAP-XSLT mapping some times i am getting the following erre "Error while calling mapping program ZXXXX_XXX (type Abap-XSLT, kernel error ID CX_XSLT_RUNTIME_ERROR) No valid source context supplied"
    What does it mean and what is the reason for that error.
    Regards,
    Rama
    Edited by: Ramakrishna Balusu on Oct 27, 2009 1:35 PM
    Edited by: Ramakrishna Balusu on Oct 27, 2009 1:36 PM

    Check this discussion:
    XI Error
    Regards,
    ravi

  • Mapping ejb and database - primary key problem

    I'm trying to map some ejb's to an existing database. Unfortunately, when I load the db schema into deploytool, the table I'm interested in is not available because it doesn't have any primary key defined.
    Is it impossible to map an ejb to a db table without primary key ?
    Is it a sun-specific feature, or can I expect the same behaviour from other application servers vendors ?
    Thanks for the help.

    Hi Maxime,
    In J2EE RI 1.4, you can't map beans to tables w/o primary keys. I don't know, how other other products treat this issue.
    Regards,
    -- markus.

  • Few Mapping Transformations

    Hi All,
    I have, say, 3 DataStore's. I have to send few fields from DSO1 to DSO3 and rest from DSO2 to DSO3.
    There are many other fields on 3 of the DSO's that doesn't feed one another.
    Now, when I am trying to map some fields from DSO1 to DSO3 and trying to activate I get an error "Error while activating transformation. Message no. RSTRAN510".
    How do I map only the fields that I need?
    Thanks,
    Pradeep

    I asked because of OSS note 905624, you can verify whether it is applicable to you :-
    <i>
    Symptom
    If the transformation contains a start routine or an end routine, you may not be able to activate it. The system issues message RSTRAN 510.
    Other terms
    Start routine; end routine; RSTRAN510; RSTRAN 510
    Reason and Prerequisites
    The error occurs if the transformation contains a start routine or an end routine. In these routines, a field of the <SOURCE_FIELDS> structure or the <RESULT_FIELDS> structure is used and this field is not used in a normal rule.
    </i>

  • EJB 3.0 Entity Bean Inheritance Table Mapping

    What I want to do (I think)...
    In a distilled example form...
    - class A defines field x
    - class B defines field y, extends A, inheriting field x
    - class C defines field z, extends A, inheriting field x
    - I want class B to map to tbl_b which has columns x, y
    - I want class C to map to tbl_c which has columns x, z
    What I **don't** want to do (I think)...
    - make a base table for class A that is joined to tbl_b and tbl_c
    - map class B and class C to a single table that has a discriminator column
    Questions...
    1) Is there a conceptual problem with what I want to do?
    2) Is there a way to do what I want to do? I've tried via annotations. Maybe via the XML mapping alternative to annotations?

    Thanks for the reply Simon.
    Just to re-word what I want to do... I want to use a single table **for each lineage** in the hierarchy. In my original example that would be two tables.
    Table per class is what I tried but couldn't get to work - at least using annotations. I want to map some columns in the single table to base fields and some to derived fields.
    It seems that only 'single table with discriminator', or the 'join table' methods are sanctioned ways to handle an inheritance hierarchy.
    I didn't yet try using the XML method. I might be able to use the single table method by mapping base class properties as if they were derived class properties. This approach would work with a native Hibernate mapping XML.
    Back to the conceptual question. Is there a reason why I shouldn't do what I want here?
    What I'm trying to avoid...
    1) joining tables for performance issues
    2) having one table with columns that only make sense for certain records - ugly and potentially database storage waste.

  • INDESIGN GLITCH: Creating an XML file from Indesign Layout - Issue "Using more than one line of GREP" & "Map Styles to Tags"

    I currently create XML from InDesign CC by Mapping Style to Tags.
    - The Paragraph Styles are manually apply to text. These styles include multiple lines of GREP to automatically apply character styles.
    - I map some of the paragraph and character styles to prebuilt tags that have the same name "Map Styles to Tags".
    I have found through trouble-shooting that InDesign is unable to "Map Styles to Tags" for more than one line of GREP. I therefore have to chose which line of GREP to automatically tag and which lines to manually tag.
    Please can anyone help, I need to automatically map tags to at least two character styles in one paragraph via GREP.
    Thanks,

    OK. The best I can suggest is running a Find/Change like this:
    Which will actually apply the character style to the italics (and I would do the bold as well just to make certain). Then run the Map Styles to Tags again, using the Apply by Name. Which will tag the italics.
    I don't know why ID can map to the bold and not the italic character style. It either should do them both (as in this instance) or none at all as the character styles are not actually applied by the grep, just the styling from the character styles.
    Mike

  • Mapping field SAP R/3 and CRM

    Dear Sir,
    As would like to add more mapping some from R/3 to synchonize to CRM . How should I do?? and which document will have the standard fields for mapping from field R/3 to CRM .
    THnk you and best regards,
    Vimol

    Hi VImol,
    Select the BP role sold-to party and you will see the sales area tab enabled for your BP. Select the maintained sales area for your BP and then go the organization tab. Here you will see the Sales Group field.
    The exchange of Sales office and sales Group was enabled from CRM 3.0 SP14 onwards prior to that it was not enabled. If you need further information see the oss note 513313.
    Reward points if it helps!!
    Thanks,
    Vikash.

  • N8 Maps problem after hard reset

    There have been some cases where users have used the 3-fingered hard-reset method on their N8 devices and lost Ovi Maps in the process. If you find yourself in this situation, you can now resintall Maps via the software update feature in Ovi Suite. For other apps, you may need to refer to your nearest Nokia Care point.
    Please note that it is not wise in general to use the 'three-fingered suicide' as a method of troubleshooting issues with your phone, this procedure is intended to attempt to revive a device that will not boot, in which circumstances you already know that everything is going to be lost before starting.
    If this or any post answers your question, please remember to help others by pressing the 'Accept as solution' button.

    The following is an official statement from Nokia concerning this matter:
    You
    should not use the "three finger" reset (pressing volume down + camera key +
    menu key and pressing power button) to hard reset the Nokia N8-00 device. Doing
    this will delete some applications (Ovi Store, Ovi Maps, some preinstalled
    widgets) which cannot be restored.
    If the device needs to be reset, try the following methods
    instead of the "three finger" reset:
    Press down the power button for 8
    seconds.
    Restore the factory settings by selecting Menu
    > Settings > Phone > Phone management > Factory settings >
    Restore.
    The "three finger" reset should be used only
    as a last resort if the device cannot be booted up in any other way.
    If
    successful, the device can be used after the reset but some of the applications
    are missing. The device needs to be taken to a Nokia Care point for reflashing
    to get the original applications back in the
    device.
    If this or any post answers your question, please remember to help others by pressing the 'Accept as solution' button.

Maybe you are looking for