How to use a List interface?

Hi,
anybody can help me about using List interface?
I need one example please.
Thanks in advance and excuse me for my english.
Daniele.

List interface is useful when you want to provide an access to a data structure without exposing implementation details. For example :
public class Storage {
  private ArrayList _list;
  public List getList () {
    return ArrayList;
}If one day you prefer to use a LinkedList instead of the ArrayList, the classes using "Storage" won't need to be modified.
Hope this helps,
Matthieu

Similar Messages

  • How to use intractive list in Alv REPORT

    how to use intractive list in Alv REPORT with example.
    thangs
    venki.......

    Hi
    using the USER_COMMAND we can move to the Secondary(interactive) list in the ALV
    see the sample code
    report yh645_secndry_alv.
    type-pools: slis.
    data: fieldcat type slis_t_fieldcat_alv,
    fieldcat_ln like line of fieldcat,
    fs_layout type slis_layout_alv,
    t_layoout like standard table
    of fs_layout.
    data: begin of fs_spfli,
    carrid type spfli-carrid,
    connid type spfli-connid,
    countryfr type spfli-countryfr,
    cityfrom type spfli-cityfrom,
    airpfrom type spfli-airpfrom,
    countryto type spfli-countryto,
    cityto type spfli-cityto,
    airpto type spfli-airpto,
    fltime type spfli-fltime,
    deptime type spfli-deptime,
    arrtime type spfli-arrtime,
    distance type spfli-distance,
    distid type spfli-distid,
    fltype type spfli-fltype,
    period type spfli-period,
    checkbox,
    color(3),
    end of fs_spfli.
    data:
    begin of fs_table,
    carrid type spfli-carrid,
    connid type spfli-connid,
    end of fs_table.
    data: begin of fs_sflight,
    check,
    color(3).
    include type sflight.
    data:end of fs_sflight.
    data:
    begin of fs_table1,
    carrid type sflight-carrid,
    connid type sflight-connid,
    fldate type sflight-fldate,
    end of fs_table1.
    data:
    t_spfli like standard table
    of fs_spfli.
    data:
    t_table like standard table
    of fs_table.
    data:
    t_table1 like standard table
    of fs_table1.
    data:
    t_sflight like standard table
    of fs_sflight.
    data:
    t_sbook like standard table
    of sbook.
    data t_layout type slis_layout_alv.
    select *
    into corresponding fields of table t_spfli
    from spfli.
    perform start_list_viewer.
    perform get_spfli_details.
    *& Form SUB1
    text
    -->RT_EXTAB text
    form sub1 using rt_extab type slis_t_extab.
    data: flight type slis_extab.
    flight-fcode = 'SFLIGHT'.
    append flight to rt_extab.
    set pf-status 'SFLIGHT'. " EXCLUDING RT_EXTAB.
    endform. "SUB1
    *& Form START_LIST_VIEWER
    text
    --> p1 text
    <-- p2 text
    form start_list_viewer .
    data: pgm like sy-repid.
    pgm = sy-repid.
    fs_layout-box_fieldname = 'CHECKBOX'.
    fs_layout-info_fieldname = 'COLOR'.
    call function 'REUSE_ALV_LIST_DISPLAY'
    exporting
    i_callback_program = pgm
    i_callback_pf_status_set = 'SUB1'
    i_callback_user_command = 'USER_COMMAND'
    i_structure_name = 'SPFLI'
    is_layout = fs_layout
    tables
    t_outtab = t_spfli
    exceptions
    program_error = 1
    others = 2.
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    endform. " START_LIST_VIEWER
    *******Process Call Back Events (Begin)**************************
    form user_command using ucomm like sy-ucomm
    selfield type slis_selfield.
    case ucomm.
    when 'SFLIGHT'.
    selfield-refresh = 'X'.
    perform get_spfli_details.
    select *
    from sflight
    into corresponding fields of table t_sflight
    for all entries in t_table
    where carrid eq t_table-carrid
    and connid eq t_table-connid.
    perform display_sflight.
    when 'SBOOK'.
    selfield-refresh = 'X'.
    perform get_sflight_details.
    select *
    from sbook
    into corresponding fields of table t_sbook
    for all entries in t_table1
    where carrid eq t_table1-carrid
    and connid eq t_table1-connid
    and fldate eq t_table1-fldate.
    perform display_sbook.
    endcase.
    endform. "USER_COMMAND
    *& Form SUB2
    text
    -->RT_EXTAB text
    form sub2 using rt_extab type slis_t_extab.
    data: flight type slis_extab.
    flight-fcode = 'SBOOK'.
    append flight to rt_extab.
    set pf-status 'SBOOK'. " EXCLUDING RT_EXTAB.
    endform. "SUB2
    *& Form DISPLAY_SFLIGHT
    text
    --> p1 text
    <-- p2 text
    form display_sflight .
    data: pgm like sy-repid.
    pgm = sy-repid.
    clear t_layout.
    fs_layout-box_fieldname = 'CHECK'.
    fs_layout-info_fieldname = 'COLOR'.
    call function 'REUSE_ALV_LIST_DISPLAY'
    exporting
    i_callback_program = pgm
    i_callback_pf_status_set = 'SUB2'
    i_callback_user_command = 'USER_COMMAND'
    i_structure_name = 'SFLIGHT'
    is_layout = fs_layout
    tables
    t_outtab = t_sflight
    exceptions
    program_error = 1
    others = 2.
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    endform. " DISPLAY_SFLIGHT
    *& Form GET_SPFLI_DETAILS
    text
    --> p1 text
    <-- p2 text
    form get_spfli_details .
    loop at t_spfli into fs_spfli.
    if fs_spfli-checkbox = 'X'.
    fs_spfli-color = 'C51'.
    fs_spfli-checkbox = '1'.
    fs_table-carrid = fs_spfli-carrid.
    fs_table-connid = fs_spfli-connid.
    append fs_table to t_table.
    modify t_spfli from fs_spfli.
    endif.
    endloop.
    endform. " GET_SFLIGHT_DETAILS
    *& Form GET_SFLIGHT_DETAILS
    text
    --> p1 text
    <-- p2 text
    form get_sflight_details .
    loop at t_sflight into fs_sflight.
    if fs_sflight-check = 'X'.
    fs_sflight-color = 'C71'.
    fs_sflight-check = '1'.
    fs_table1-carrid = fs_sflight-carrid.
    fs_table1-connid = fs_sflight-connid.
    fs_table1-fldate = fs_sflight-fldate.
    append fs_table1 to t_table1.
    modify t_sflight from fs_sflight.
    endif.
    endloop.
    endform. " GET_SFLIGHT_DETAILS
    *& Form DISPLAY_SBOOK
    text
    --> p1 text
    <-- p2 text
    form display_sbook .
    data: pgm like sy-repid.
    pgm = sy-repid.
    call function 'REUSE_ALV_LIST_DISPLAY'
    exporting
    i_callback_program = pgm
    i_structure_name = 'SBOOK'
    tables
    t_outtab = t_sbook
    exceptions
    program_error = 1
    others = 2.
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    endform. " DISPLAY_SBOOK
    Reward points for useful Answers
    Regards
    Anji

  • How to use dynamic list box in survey builder?

    Hello,
    Could someone give me a little bit of thread? How to use dynamic list box in survey builder?

    Hi Liu,
    Dynamic combo boxes::A combo box is dynamic if it references a document property for which a value set is defined in the configuration (System Administration ® System Configuration ® Content Management ® Global Services ® Property Metadata ® Properties ® Parameter Allowed Values).
    At runtime (when you open the creation form) the system reads these values from the configuration and displays them in the dropdown list.
    If you link a combo box for which list entries already exist to a document property with a value set, the system asks whether you want to delete the list entries. it is recommend that you accept this suggestion and delete the list entries from the XML Forms Builder. Otherwise inconsistencies could arise between the entries in the XML Forms Builder and the value set in the configuration. This can cause errors when saving.
    Also you may Refer the Link for Further help:
    http://help.sap.com/saphelp_crm50/helpdata/en/29/c40d3d2a83752de10000000a114084/frameset.htm
    http://help.sap.com/saphelp_crm50/helpdata/en/00/9e7f41969e1809e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_crm50/helpdata/en/a7/5a874174a8050de10000000a1550b0/frameset.htm
    Hope it Answers your Queries..
    Thanks and Regards,
    RK.

  • I need to learn how to use jump lists.

    '''bold text'''I need to learn how to use jump lists. acording to all that I have muddled thru my ereader will only download books I have purchased and free ones if I use a jump list. I don't know how. If this is the correct method for ereaders downloads someone please explain it, simply to me. I have a reader I am totally unable to use. I have read the manual many times. That info doesn't work.

    How is that related to Firefox support?

  • CcBPM - How to use 1 Message Interface for 2 different Business System

    Hi,
    I have this bpm scenario below :
    JDBC QUERY (ASYN) ---> RFC (SYNC) -
    > JDBC INSERT (ASYN) -
    > MAIL (ASYN).
    So Both JDBC INSERT and MAIL using the same data input from RFC response for instance i will named as  MI_RFC_RES_ASYN_ABS. I have problem to configure in the integration directory, how make the xi smart enough to routing in the correct business system.
    JDBC -
    > BS_JDBC and MAIL -
    > BS_MAIL base on the send step in BPM because the interface is the same.
    Cheers
    Fernand

    Hi,
    If you want to send the same mesg to diff systems and also need to have the control on seq,
    then define 2 diff abstract interfaces for messages going out of BPM (with same message type so that structure is same).
    One will be used to define send step for JDBC and other for BPM.
    Define 2 send steps in BPM one for JDBC and other for mail using these abstract interfaces.
    Now you will have 2 receiver determinations.
    Since recr is determined based on sender system interface name and name space,
    system name ( BPM ) and name space will be same for both the messages going out of BPM.
    for JDBC abstract interface BS_JDBC will be recvr.
    and for Mail abstract interface BS_MAIL will be your receiver.
    hope it answers your qn.
    Regards
    Pushkar

  • How to use the List in this case.

    I got sample code from http://developer.java.sun.com/developer/technicalArticles/ThirdParty/WebCrawler/. But when I compiled it, there was error message like "webcrawler.java:16: reference to List is ambiguous, both class java.util.List in java.util and class java.awt.List in java.awt match List listMatches; "
    I think it might be because it was written by JDK1.1.3. I am using JDK1.4 to compile it. Can any body tell me how to make it can be compiled by JDK1.4?
    Thanks a lot.

    Hi olivia16
    There is an interface called java.util.List and a class java.util.List :-)
    To correct source code just put java.util. prefix at lines 16 and 76:
    java.awt.List listMatches; // 16
    listMatches = new java.awt.List(10); // 76
    Regards.

  • How to use the Comparable Interface?

    Now I have a question and I don't quite understand what the book explains. How does the comparable interface work? How can you redefine the equals implementation? How can you implement a compareTo? and how does this works with arrays? Thanks amigos......

    Not sure how to answer your question "how does the Comparable interface work" - what do you mean by "work"? It's purpose is to supply a known method that can be used to define an ordering on lists of objects. To do this you need to know how two objects compare to each other (less than, equal to, greater than) - and that's what the compareTo method gives you.
    You redefine the equals implementation by overriding the equals method - just declare a method in your class that has the same signature as equals and you're good.
    Your implementation of compareTo depends on your class. You just need to define how your classes compare to each other - for instance, assume you have an "Employee" class, that has an employee number and first name and last name fields. You want the natural ordering of lists of Employees to go in order by employee number. Define your compareTo method like:
    public int compareTo(Object o) {
        Employee emp = (Employee)o;
        if (emp.getEmployeeNumber() < this.getEmployeeNumber()) {
            return -1;
        else if (emp.getEmployeeNumber() == this.getEmployeeNumber()) {
            return 0;
        else {
            return 1;
    }You can sort arrays of things via the Arrays.sort method, which takes the array to sort and a Comparator (not Comparable) reference. The Comparator interface provides the same idea as the Comparable interface, but it's a stand-alone object that handles the comparison, as opposed to a method of some particular class. The compareTo method of the Comparator interface takes two Object references and returns how they compare.
    Good luck
    Lee

  • How to use Variable in interface for Mapping in ODI 11g

    Hi,
    I want to use Variable 'Year' in interface mapping. how i can do that? I define a variable YEAR1 = '2001' and in interface i put #YEAR1 but it didn't work for me. is there any other way?
    Example.
    I m using 'Year' column in mapping and it is having different 3 constant values so i was think to define 3 variable Year1= '2001' & Year2= '2005' & Year3= '2010'.
    In interface i just want to put variable name insted giving fix value.
    regards
    Sher

    Thank u
    I m trying with all the options & when i create Variable i and set Default value to ''2001'
    '#YEAR'
    #YEAR
    '#PROJECT_NAME.YEAR'
    #PROJECT_NAM.YEAR
    #PROJECT_NAME.'YEAR'
    and setting to Stagging Area
    But still it is not working out.
    I m suing ODI11.1.1.3
    is it any issue?

  • How to use dropdown list in module pool

    Hi guys,
    I have provided  a dropdown list in my  screen in my module pool program.
    How should I insert values in the dropdown list.
    Regards
    Mac

    HI,
    Check this code.
    PROCESS AFTER INPUT
    PROCESS ON VALUE-REQUEST.
      FIELD ZDEPT-DEPTNO MODULE create_dropdown.
    *** DOUBLE CLICK ON CREATE_DROPDOWN
    MODULE create_dropdown INPUT.
      SELECT EMPNAME
                    DEPTNAME
                    FROM YDEPT
                    INTO CORRESPONDING FIELDS OF TABLE itab_details.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield        = 'DEPTNO'
                value_org       = 'S'
           TABLES
                value_tab       = itab_details
           EXCEPTIONS
                parameter_error = 1
                no_values_found = 2
                OTHERS          = 3.
      IF sy-subrc  0.
      ENDIF.
    ENDMODULE.
    HERE IN PAI DOUBLE CLICK THE MODULE THEN WRITE THE ABOVE CODE IT SHOULD WORK.
    YDEPT IS THE TABLE I CREATED TO STORE DEPARTMENT NUMBERS.
    ZDEPT IS THE STRUCTURE OF THE TABLE.
    IF YOU ARE STILL UNCLEAR
    PLEASE CHECK
    'DEMO_DROPDOWN_LIST_BOX' PROGRAM IN SE51 AND SCREEN NUMBER IS 100
    Regards and Best wishes.

  • How to use functions in interfaces

    Hi.
    I have an interface but one target field has to be filled by a function that converts the source field to date and in case of exceptions returns null.
    I have created the function and grant the correct privileges to the ODI user.
    Then in the interface i wrote - MY_FUNCTION(source_field) - in the definition of the target field like i write for example TO_NUMBER(source_field) but it doesn't work.
    Please help me to know how can i resolve this problem

    I am not sure what you are trying to accomplish , here is the steps ,if you are trying to write a function for to_number .
    Call your Function TO_NUM
    In the implementation syntax write this - TO_NUMBER($(COLUMN_NAME)) and copy the same in
    Implementation ,select the technology Oracle . Apply and
    Call the function in Mapping this way - TO_NUM(<COLUMN_NAME>)
    try this and let me know if you are looking for some thing else.

  • How to use the serial interface to control the oscilloscope tds1012

    The driver for tds1012 we downloaded from the site is not working with the serial interface. And to do the same we have to set the serial settings on the instrument to be the same as the serial settings on the block diagram.Can anyone help me ,how to do the settings?

    Have you referred to the manuals for the oscilloscope, that information is typically contained within them.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    "It’s the questions that drive us.”
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

  • How to use dropdown list in selection screen

    Hi everyone.
    I'm stating a new report and a drop down list is required in initial filtering. I red different articles in google but  istill just don't get it... please help...

    Sample Code:
    TYPE-POOLS: vrm.
    DATA: name TYPE vrm_id, list TYPE vrm_values, value LIKE LINE OF list.
    * List box
    PARAMETERS: ps_parm AS LISTBOX VISIBLE LENGTH 10.
    INITIALIZATION.
    * Populate list box values
      name = 'PS_PARM'.
      value-key = '1'. value-text = 'Line 1'. APPEND value TO list.
      value-key = '2'. value-text = 'Line 2'. APPEND value TO list.
    AT SELECTION-SCREEN OUTPUT.
    * Set list box with value
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id     = name
          values = list.
    START-OF-SELECTION.
      WRITE: / 'Parameter:', ps_parm.
    Regards,
    Angelo.

  • How to use price list in inventory management documents (without SO module)

    Hi all
    I want to setup sales prices for items and I am using inventory management module of jd edwards enterpriseone.
    Is there any possibility in which I can use the sales price items functionality.
    So after I enter the sales price for each items in specific conditions, is there any possibility for these prices to be automatically shown anytime I enter a inventory issue or any other document which has to do with the issuing of the items.
    Please suggest
    thank you and best regards
    Ernest

    Hello,
    You can setup Item Sale price through the P4106 application in inventory management. But since your requirement is quite customised, Inventory Issue dont have such functionality to populate Item Sale Price when you are issuing items eventhough you create/change doctype. It will only be populate Item Cost and Extended cost.
    Deepak P

  • How to use array list with fixed values to insert record in trigger

    I have a list  of number 1,30,40,45,60 . These numbers are not being changed so I  don't need to keep in a table. So have to create a  after insert trigger   for 
    As
    Begin
    @list =  1,30,40,45,60 // Array value 
    for i=1 to @list.count
    Insert into mappingtable(arrayvalue,itemcode) values (list[i],Inserted.Itemcode)
    Next
    End
    Please can you help with a code 
    Regards
    Pol
    polachan

    Be careful what you assume - rarely are lists of values like this truly static.  One thing to keep in mind that arrays in sql server are tables.  So, one example is:
    set nocount on;
    /* represents the virtual inserted table in your trigger */
    declare @inserted table (itemcode char(4));
    insert @inserted (itemcode) values ('ABCD'), ('JJKL');
    select * from @inserted;
    select * from @inserted cross join (values (1), (30), (40), (45), (60)) as arrayx(value);

  • How to use reading list

    After saving to reading list, where do i find the list in the iphone?

    Just posted the same question for iPad. Hope I get more responses than u.

Maybe you are looking for

  • Windows 7 Pro x64 does not detect HP Mobile Data Protection Sensor (accelerometer)

    Hello there. I installed win7pro x64 yesterday and already came across a serious problem that makes my way of using the notebook a bit dangerous for my precious data. When I was working on HP-branded Vista 32bit (from recovery partition etc), there w

  • Problem with Creative Cloud Desktop App in Mavericks

    I have posted a couple of times about this but no one seems to be answering. There seems to be a bug with the Creative Cloud Desktop app and Mac OS Mavericks. I have the newest version of them installed on a brand new MacBook Pro and I have had probl

  • Ios7.1.4 update problems

      I decided to update my phone thursday night to ios7.1.4. After installing it shut off immediately. which is normal since it restarts. The problem though is that my phone refuses to turn on, yet it keeps flashing the apple logo on the screen. this h

  • Release strategy

    Hi all, We have two document types for PO. In one of the document type if user wants to change the PO  once the it is released then system asks user to get the release indicator in Block state & then allows user to change the PO. In another document

  • Custom xmp

    Does the SDK support deep xml meta data like for example (ignoring name spaces here).          data    ...more foo... This is only an example, can I pick any form of xml as my custom application metadata? I'm workin on an app that has rather complex