More then two attribute in to Hashtable

I want to store more then two attribute in to Hashtable, So i put the values into class and store the object into the Hashtable.
Every thing works fine, but how to retrieve the values which are stored in to the object.
name,sessionid and time are the 3 attribute which i store in the
Session class. In the hashtable a key("AAA","BBB") and the object is
stored.I want to get all the attribute values which are stored for a particular key.
When i display the content of the hashtable for a key,
System.out.println(ht.get("BBB"));
I get just the object name but not the values like
Session@f4a24a
Is there any way to get the values from the object which are stored into the hashtable. Will any one help me
Here is the code:
import java.util.*;
class Session {
private String name;
private String sessionid;
private long time;
Session(String n, String s, long t) {
name = n;
sessionid = s;
time = t;
class Hash{
public static void main(String args[]) {
Hashtable ht = new Hashtable();
Date date = new Date();
ht.put("AAA",new Session("John", "session1",date.getTime()));
ht.put("BBB",new Session("White", "session2",date.getTime()));
System.out.println(ht.get("AAA"));
System.out.println(ht.get("BBB"));
}

Hei!
Define methods in the Session class with which you can retrieve the private fields from the class, and use these methods.
for example:
class Session{
long getTime(){return time;}
class Hash{
System.out.println(((Session)ht.get("AAA")).getTime());
Pizzarelli

Similar Messages

  • Oracle RAC with more then two nodes?

    Hello,
    knows anybody a reference client project that use Oracle RAC with more then two nodes on a Linux environment?
    Many thnaks!
    Norman Bock

    Hello Norman,
    XioTech is a SAN company that has a project called "THE TENS". They configured and ran a 10 node RH Linux Oralce 9i RAC. I understand they want to see if 32 are possible. I am sure if you ask them, they would be happy to give you the details.
    http://www.xiotech.com/
    Cheers

  • User can not add more then two products against one order

    Hi frnd,
    My requirement is in CRM while creating order using CRMD_ORDER transaction. The user can not be entered more then two products against one order.
    I am using CRMD_ORDERADM_I_BADI badi to give error I am unable to use this badi. Is there any other options are there.
    Please do need full help.
    Regards,
    Ashish.

    Hi Amit,
    DATA: gt_header TYPE crmd_orderadm_h. "OCCURS 0 WITH HEADER LINE.
    data: ET_PRODUCT_I     TYPE     CRMT_PRODUCT_I_WRKT.
    data: gs_PRODUCT_I     TYPE     CRMT_PRODUCT_I_WRKT.
    DATA : gt_header_guid     TYPE     crmt_object_guid_tab.
    DATA : gs_header_guid     TYPE     crmt_object_guid.
      gs_header_guid = IV_HEADER.
    *INSERT gs_header_guid INTO TABLE IV_HEADER.
      CALL FUNCTION 'CRM_ORDER_READ'
        EXPORTING
          it_header_guid       = gt_header_guid[]
        IMPORTING
          ET_PRODUCT_I         =   ET_PRODUCT_I[]
        EXCEPTIONS
          document_not_found   = 1
          error_occurred       = 2
          document_locked      = 3
          no_change_authority  = 4
          no_display_authority = 5
          no_change_allowed    = 6
          OTHERS               = 7.
    endmethod.
    I am using ds code. Its working fine records are coming in Product. But how i will save product into one
    itab.
    Regards,
    Ashish S

  • Object would have more then one attribute with the tag :VALUE

    I'm creating a new component in Ultiboard - a 100 pin connector.  This connector (Hirose) has 4 rows of 25 pins. Alternate rows are staggered. I'm trying to name each pin with it's appropiate name: A1, A2, A3 ....A50. Then B1, B2, B3 .....B50.
    When I change the VALUE or NUMBER attribute, I get the DRC error  message:
    This action cannot be completed because the resulting Object would have more then one attribute with the tag :VALUE
    Please remove one of the attributes and try again.
    Okay, so I've tried deleting the tag and now I can't name the pin at all. 
    What am I missing?

    You should be in the footprint editor to edit the pin name.  Select tools>>Database>>Database Manager, highlight the component in your database and click on the Edit icon.  In the footprint editor, double click on the pad and a SMT or THT pin Properties dialog appears, select the Attributes tab and highlight the Number row, press the change button and you should be able to change the pin name.   
    Tien P.
    National Instruments

  • 7920 - Cant handle more then two callls?

    Hi,
    We got a person who have one active call, with person #1.
    Then she receives one more call, from person #2.
    She want's to transfer person #1, and then speek to person #2.
    She is not possible to transfer #1, how come? Is it a limit in 7920? We have tried to change busy trigger and maximum number of calls. but without success.
    This is on both CCM 4.1(3) and 4.2..
    Is it anyone else who have got this problem?
    Thank you,
    Sorry for being bad at describing the problem, please ask if you have any question.
    Best regards
    Christer

    Hi,
    We got a person who have one active call, with person #1.
    Then she receives one more call, from person #2.
    She want's to transfer person #1, and then speek to person #2.
    She is not possible to transfer #1, how come? Is it a limit in 7920? We have tried to change busy trigger and maximum number of calls. but without success.
    This is on both CCM 4.1(3) and 4.2..
    Is it anyone else who have got this problem?
    Thank you,
    Sorry for being bad at describing the problem, please ask if you have any question.
    Best regards
    Christer

  • HOW TO MANAGER APPROVE LEAVE REQUEST AT A TIME MORE THEN TWO

    Hi Experts,
    This is Kalyan.I am working on ess/mss . How to manager approve four work items at a time .
    And how to add  Custom Fields in UWL .Can u please help me.
    Regards,
    Kalyan

    Hi Kalyan
      Suppose if multiple persons raise workflows like Leave, Travel, Claims, Loan every workflow is different. You cannot have single workflow and single work item. The work item comes to UWL for the approver. In the UWL you can customize the screen put a radio button in the screen such that only approve and reject button. So every wprk item can be just selected with approve and reject radio button on the UWL itself. Finaly update button will update the entier page with the approvals. But this is very very very difficult.
      Think logically Y the approver wants to do mass approval. Suppose the approver receives the leave work item without seeing the leave quota will he approve?. Similiarly for travel without seeing the expense amount will the approver approve the trip.
    UWL is for all the module like Travel, Leave, Claims, Loan etc. Every module the approval screen itslef different. So mass approval is not possible.
    If ESS is implemented only for Leave or Travel or Payroll then its possible. In that case customize the UWL with radio button and after mass approve or rejection finally need to update. But this is absolutly not advisable since every person the data are different.  So mass approval is not advisable.
    I think am logically correct?
    Regards
    vijay

  • How can I restrict more then one user to access the table?

    Hi !
    I have a problem and two solutions and I am a bit confused as to
    which one is the best one and/or can there be any better way of
    handling the problem ?
    Problem : I have to update a key field of a table when I update
    it in the form 5.0 screen. I am basically doing a maintenance of
    a table and if a certain field is updated then the change has to
    be reflected in two more tables. But the issue is that the field
    is a part of the key in those two tables. So all I can think of
    is that I need to insert new set or rows for that new value of
    the field and delete the old set of records for old values of
    the field.
    There are two ways of doing it;
    1.One option can be to explicitely define two cursors separately
    and fetch the values in them one by one and then insert the new
    records and then delete the old records in both the tables. This
    I feel will be a cumbersome process both in terms of processing
    time and the coding.
    2.Second option I was thinking can be to create two flat tables
    (without keys) and insert the values in them and update the
    changed field there and then insert the rows in the respective
    tables. Delete the old records in the main tables and delets the
    records in these flat tables. This is a bit more faster and
    easier to predict and code. This seems to be a better option for
    me.
    Any comments on these ?
    In both the cases I was thinking of making some provision so
    that more then one person can't update the table simultaneously.
    Since if there are more then one persons doing the processing
    then some inconsistency might creep into the whole process.
    This is easier to do in the second process as if I check the
    data in the flat tables and if there is some data then I can
    presume that some one is doing the processing and I can ask the
    other person to hold for a while. But in this case how can I
    stop more then two people to simultaneously check for the empty
    table and start inserting the record ?
    I was just thinking of having a sepatare table having only one
    field and this will be a key field and as the process begins the
    process will insert a fix value say 'Y' in the key field and at
    the end of the process the record will be deleted and this way
    we can restrict the user to access the process more then one at
    a time..? Since you can't have same value of the key in a table
    more then once.
    Any better way of handling it will be deeply appreciated.
    How about locking the table at the begining and releasing the
    lock at the end ? Will there be any issue in that? since I am
    inserting and deleting the rows in the same transaction.
    Comments welcome,
    Shobhit
    null

    How about performing the update IN the database using a stored
    procedure?
    By using non-database fields on your form to get the
    information, you can then call the procedure in the database to
    perform the updates. If an error occurs in the procedure you
    rollback, if necessary, and send a message or status back to the
    form. If it succeeds you might wish to commit and then re-
    execute the form's query -- using either the original key values
    or the new key values...
    null

  • Issuing more then one item in free goods

    Hi SD gurus,
    My client is asking to issue more then two items as free goods along the main item. Example material A is sold along with material B and C as free goods.As far as my trails, I'm able to configure only one item as free goods but not the second one. Can any one suggest to configure the above scenario?

    Hi Ravi krishna,
    Free goods can only be supported on a 1:1 ratio. This means that an order item can lead to a free goods item. if you want to give free goods X & Y for material A, then you need to enter material Y in order, simply change the item category as TANN.
    As of my knowledge there is no alternative to it.
    these are the constraints for free goods:
    Free goods are not supported in combinations with material structures (for example, product selection, BOM, variants with BOM explosion).
    Free goods are only supported for sales orders with document category C (for example, not quotations).
    Free goods are not supported for deliveries without reference to a sales order.
    regards
    Sunil

  • How to use 'BAPI_GOODSMVT_CREATE'  for more then one row selected ???

    Hi,
    I am using bapi , BAPI_GOODSMVT_CREATE  ,  my requirement is that first perform ALV display with check boxes & then user can selsct any number of rows  & then on clicking execute button  this bapi is triggered , now my ques is that  if i am selecting rows one by one & executing , then am able to post data successfully, but if am selecting  more then one row at a time then its giving me error
    " exactly one serial no must be selected  (instead of more then two / three ) ."
    plz help me .
    this is how i am filling data in BAPi & bapi call
    FORM FILL_BAPIDATA .
      wa_GOODSMVT_HEADER-PSTNG_DATE = sy-datum.
      wa_GOODSMVT_HEADER-doc_DATE = sy-datum.
      wa_goodsmvt_code-gm_code = c_gmcode.
      LOOP AT it_final INTO wa_final.
        wa_GOODSMVT_ITEM-MOVE_TYPE = c_movtype.                 " '313'.
        wa_GOODSMVT_ITEM-material =  WA_final-MATNR.
        wa_GOODSMVT_ITEM-ENTRY_QNT = wa_final-verme.
        wa_GOODSMVT_ITEM-plant =  WA_final-WERKS.               "'DB10'.
        wa_GOODSMVT_ITEM-STGE_LOC =  WA_final-LGORT.
        wa_GOODSMVT_ITEM-BATCH = WA_final-CHARG.
    wa_GOODSMVT_ITEM-BATCH = l_charg.
        append wa_GOODSMVT_ITEM to IT_GOODSMVT_ITEM.
        clear: wa_GOODSMVT_ITEM.
      ENDLOOP.
      LOOP AT it_final INTO wa_final.
        wa_serialnumber-SERIALNO = wa_final-sernr.
        APPEND wa_serialnumber to it_serialnumber.
        CLEAR wa_serialnumber.
      ENDLOOP.
      LOOP AT it_position2 INTO wa_position2.
        wa_serialnumber-MATDOC_ITM = wa_position2-wepos .
        MODIFY it_serialnumber INDEX sy-tabix from wa_serialnumber TRANSPORTING MATDOC_ITM .
      ENDLOOP.,
    data: begin of mthead.
            include structure bapi2017_gm_head_ret.
    data: end of mthead.
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
        EXPORTING
          GOODSMVT_HEADER               = wa_GOODSMVT_HEADER
          GOODSMVT_CODE                 = wa_GOODSMVT_CODE
       IMPORTING
          GOODSMVT_HEADRET              = mthead
        MATERIALDOCUMENT              = w_MATERIALDOCUMENT
        MATDOCUMENTYEAR               = w_MATDOCUMENTYEAR
        TABLES
          GOODSMVT_ITEM                 = IT_GOODSMVT_ITEM
          GOODSMVT_SERIALNUMBER         = IT_SERIALNUMBER
          RETURN                        = IT_RETURN
      GOODSMVT_SERV_PART_DATA       =
      EXTENSIONIN                   =
    APPEND w_MATERIALDOCUMENT to it_GOODSMVT1 .
    IF sy-subrc = 0 .
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    *MESSAGE text-016 TYPE 'I'.
    PERFORM msg_log  .
    ENDIF.

    Hi,
    Did u check the serial numbers table before calling the BAPI. Might be the case tht same serial number is assigned for all items, in this case the goods movement may be possible with same serial number for all items.
    Reagrds,
    Aditya
    Edited by: aditya on Aug 11, 2009 11:46 AM

  • Hi everyone i have just bought new Ipod touch 32 GB and upgraded to 5.0.1 and it it worse now my battery doesn't last long for more then hvvour. what should i do?

    Hi everyone,
    I have just bought new Ipod touch 32 GB and upgraded to 5.0.1 and it it worse now my battery doesn't last for more then two hour.
    what should i do? it is seriously big problem.
    Please help me.......

    This is a general comment, not directed to anyone, and not to be taken personally by anyone.  This ongoing screw up with the new upgrade (5.0.1) is getting to be a **** SHAME.  In no way can APPLE or anyone else for that matter not know by now that the upgrade is terribly flawed.  The Ipod machines themselves are super great products, and I enjoy mine to the max.  However the upgrade once applied ruins it.   And at least, not to my current knowledge,  there haven't been any fixes forcoming. 
       In my opinion Apple should own up to that fact and warn folks that, even though the upgrade was presented with the best intentions, IT JUST AIN"T WORKING.  And not to download it until further  notice. This noticication could be done through the retail sales outlet, online, what ever.
      I liken this to a pharmaceutical coming out with a new vaccine, encourage everyone to use it, then discover it's bad to the degree it causes it uses to become sick.  Rather then pull the vaccine they keep on allowing unsuspecting ones to continue to vaccinate, and become sick.  What a shame!
    Charlie Lee 

  • More then 2 # per contact

    does anyone know if I can my contacts to show more then two phone numbers for each enter contact

    yes, I guess I did not pose the ? properly. I synced my itunes with outlook. In my outlook I have a number of contacts that have more then 2 phone numbers per one contact. On my iphone it only comes in with two. Is there a preference somewhere I need to change to bring/ import/ sync all the numbers

  • Restricting the item data for two pages if data is more then cutoff

    Hi Expers,
    I have one requirement that i need to restrict item data upto two pages .If more data is vailabe even pritning after two pages then data should cutoff(means we don't want to print that extra  data in the next pages ).Could you please explain  how can we achive this in main window ?Can we achive this even using secondary window also?Thanks for your help in advance.
    Thanks and Regards,
    Venkat

    Dear experts,
    For restricting the data up to two pages in the mainwondow ,I have written the condition SFSY-PAGE LE 2.But still i am getting more than two pages means entire data.Can any one explains why this condition is failed(My main window is in the first page itself).
    Many thanks for your help,
    venkat

  • Bug? My events on the iPad iCal app aren't shown in the year view if they are more than two years in the future.

    My events on the iPad iCal app aren't shown in the year view if they are more than two years in the future even though I can see them on the month, week and day view. Any suggestions on how to fix it? I've tried it all. I called the apple support and they checked on their iPads. They all did the same and they couldn't help me. They suggested trying this way. I'd like to be able to plan a few years ahead and the year view would make thing so easy!
    Is this a bug?

    Go to the Home screen and double click the Home button. That will reveal the row of recently used apps at the bottom of the screen. Tap and hold on the app in question until it wiggles and displays a minus sign. Tap the minus sign to actually quit the app. Then tap anywhere on the screen above that bottom row to return the screen to normal. Then restart the app and see if it works normally.
    Then reboot your iPad. Press and hold the Home and Sleep buttons simultaneously ignoring the red slider until the Apple logo appears. Let go of the buttons and let the iPad restart. See if that fixes your problem.

  • Not able to Render more than two asset type in a drop zone on page

    Hi All,
    I have created two different assets by making two different flex family.
    I need to render these two assets in a single drop zone on a page.
    Can some one tell me how is it possible to make a drop zone on page which will be able to take two different type of assets because while creating Page attribute when i select page attribute of type asset there is no option through which i can select more than two asset types.
    Thanks & regards,
    Ankur Bhatia

    Hi Rodney,
    Thanks for ur Reply.
    While creating page attribute on admin site,when we select attribute type as "asset" a dropdown list comes just below through which we can select only a single asset.
    how to use a list option here or how can we create it so that it can be used with various asset types.
    Also in avisports site there is no drop zone which can contain more than one asset of different type.
    The Drop zone contains here all the assets of same type.
    Thanks and Regards
    Ankur Bhatia

  • HOW DO I USE MORE THEN ONE ITUNES WITH MY IPHONE WITHOUT ERASING MY MUSIC?

    I have two different laptops with iTunes on it. I use both of them but my iPhone only works with one iTunes. I plug it into the computer and it says that my iPhone cannot use more then one iTunes. Is there a way I can use both or no?
    YES I AM CLICKING MANUELLY ADD SONGS TO MY iPhone.
    I just bought my iPhone about a week or so ago.
    Please help ASAP.

    I clone my library to a portable drive using SyncToy 2.1, a free tool from MS. I run this both at home & work so that I essentially have three identical copies of my library for backup redundacy, any of which I can use to update my iPods and my iPhone. I use iTunes Folder Watch occasionaly in case I've managed to download, for example, a podcast at one location but overwrite the library with a newer copy updated at the other. It can be done but you need to take considerable care...
    tt2

Maybe you are looking for

  • Delete Adjacent Records in DTP execuetion

    Hi , I just want to delete adjacent records while loading DTP ,since Start routine logic was incorporated. Adjacent Records are not getting deleted because of the comparison takes place in different data packages. Pls. let me know if u have some idea

  • Remove leading zeros from a string

    Hi, I have a string with some numeric value. e.g. String a = 54890001 I want to make it 10 digits long by padding zeros at the begining Now a = 0054890001 ( this is for display purpose ) I know how to do it. Now How can strip these leading zeros from

  • Chrome PDF Rendering Issue

    Hello all, I've been noticing some odd behavior in Chrome when trying to render a PDF I've exported from InDesign; attached is a screenshot of the symptom, and if you take the following link, you can also see it firsthand (though occasionally it will

  • Adobe thinks I've already activated CS5 on two computers

    So, I have the student version of CS5. I installed it on my PC running Windows XP Professional in March and it ran perfectly fine until July, when I got my first notice that it had "already been activated on two computers" and that I should deactivat

  • Whats App stopped working, can't re-install, can't download from App World or Internet

    A few days ago, Whats App messages were not longer being delivered.  I contacted Whats App support and they sugggested turning connections on / off, soft reset, hard reset, etc....and then finally uninstall / reinstall the application.  Service books