To use the interface creating a container

Hello,
I read around that is normal thing write Set<String> set = new HashSet<String>() in place of HashSet<String> set = new HasSet<String>(); I read the same with other containers too (Map = new HashMap, List = new ArrayList). I don't understand the real importance. Moreover, If I got something right, the interface "could" not have "few" method of the implementation......(and in this case I suppose I really can't use the interface.....)
thanks.

mickey0 wrote:
I read around that is normal thing write Set<String> set = new HashSet<String>() in place of HashSet<String> set = new HasSet<String>();Just to add to George's good advice, the basic reason is that if you decide later on that your Set is better off as a TreeSet instead of a HashSet, you can simply change the assignement to
Set<String> set = new TreeSet<String>();indeed, since all your methods will likely be coded to take Sets if you used the above method, you could probably change it to
NavigableSet<String> set = new TreeSet<String>();without any problems.
Moreover, If I got something right, the interface "could" not have "few" method of the implementation......(and in this case I suppose I really can't use the interface.....)The only method that HashSet has that Set doesn't is 'clone()'. Obviously, when choosing the interface, it should be as close as possible to to the capabilities you need.
Winston

Similar Messages

  • How to use the dll  created by c++ but not write a jni wrapper around

    how to use the dll created by c++ but not write a jni wrapper around through a java program. now I can't access that dll like this directly from java.

    Your question is unclear. (You haven't said what dll you are talking about.)
    But:
    If you are talking about an existing dll, then the only alternative to writing a wrapper is to use one of the wrapper generators floating around. Do a search on JACE.
    If you are talking about a dll you are writing, then run jah and get the interface to match java right away; then you won't have to write a wrapper.

  • Since upgrading iTunes 10.5.1.42, I have been unable to use the "Advanced - Create iPad or Apple TV Version" to convert movies.

     I have been unable to use the "Advanced - Create iPad or Apple TV Version" to convert my movies for use with my iPad2. The movie will go through the conversion process, and is the correct length, but the video is a black and there is no sound? Has anyone found a similar problem? If so, what can I do to fix the problem? Before I used Handbrake to convert the videos which worked well, but now that is not working either .

    No, there is no direct download link. Those are days of the past, I'm afraid. You may need to reinstall Mavericks.
    Install or Reinstall Yosemite, Mavericks, Mountain Lion, or Lion from Scratch
    Be sure you backup your files to an external drive or second internal drive because the following procedure will remove everything from the hard drive.
    How to Clean Install OS X Yosemite
    OS X Mavericks- Erase and reinstall OS X
    OS X Mountain Lion- Erase and reinstall OS X
    OS X Lion- Erase and reinstall Mac OS X
    Note: You will need an active Internet connection. I suggest using Ethernet if possible
                because it is three times faster than wireless.

  • Execute PL/SQL using the defaul Create button.

    I have created an application and everyting with working fine.
    I have one page where I create a work order. This is saved by using the default create button.
    What I want to do now is, when I save I want to execute some PL/SQL, so essentially kicking off another process.
    Is this possible? Is so how.
    cheers
    James

    James,
    Since you want PL/SQL procedure to be fired after clicking the default create button, create a a conditional PL/SQL process. Please follow the below steps:
    1. Create a page process (Click process create icon under page processing in edit page). Choose process category as 'PL/SQL'. Click 'Next'.
    2. Enter the PL/SQL procedure that should be executed on clicking the button. (In your case, it is the sql insert statement). Click 'Next'
    3. Enter the success and failure message if required. Click 'Next'
    4. For'When Button Pressed' select list, please choose the Default 'Create' Button. Press 'Create Process'.
    Hope this helps.

  • Managed Property in Refinement - why not use the automatically-created site column managed property

    Hi,
    I read that although SharePoint 2013 automatically creates managed property for site column (OWS_Q_TEXT_COLUMNNAME) - in the refinement i should use a managed property and map to the ows_columnname. why?
    what's the difefrence?
    what is best - to create a new managed property (and set it as refinable) or use the OOB Refinementstring0, Refinementstring1 etc.)?
    keren tsur

    You are probably talking about this blog post.
    http://blogs.technet.com/b/tothesharepoint/archive/2013/11/11/how-to-add-refiners-to-your-search-results-page-for-sharepoint-2013.aspx
    The reason you want to use the ows_columnname crawled property is because it is of the correct data type. The other is always text. If the site column is a date or a decimal then using the OWS_Q_TEXT... crawled property,will cause the refiner not to display
    the appropriate control, for example a slider control for a date type refiner.
    http://sharepointfieldnotes.blogspot.com/2013/05/understanding-and-getting-sharepoint.html
    Blog | SharePoint Field Notes Dev Tools |
    SPFastDeploy | SPRemoteAPIExplorer

  • Can we create cursor using the table created dynamically

    Dear all,
    Can we create the cursor using the table which is created dynamically using "Execute immediate" within the same procedure,
    or is there any way to call the table created dynamically ..
    please Do Help me in this
    thanks alot
    Edited by: khaja on Jan 18, 2009 10:57 AM

    Well, I don't think this approach is bad in any possible circumstances. It depends on the requirements we don't know. Yes, usually applications should not be designed in this way. But 'usually' does not mean 'never'. One possible case is described in Oracle's example Referencing Database Objects that Do Not Exist at Compilation. It's possible to assume that tables inv_01_2003, inv_04_2003, etc from the referenced topic What Is Dynamic SQL? are generated automatically by some job using dynamic create table stmt. If the OP has similar requirements tnen this approach is not bad. It may not be the best one but it at least is not so bad as you said.
    I believe that OPs know their requirements much better than me. This is why I always try to answer the exact question. If the approach is really ugly then I don't answer such questions at all.
    Regards,
    Dima
    Message was edited by:
    DimaCit

  • Using the certificate created by keytool in IIS

    Hi,
    I have an issue, I need to use the certificate that I created with keytool (JDK 1.4.1) in IIS, is possible ?
    Please help!,
    carlos

    I'm halfway there.
    1. keytool -genkey // etc
    Where I get stuck:
    2. export the key contents
    3. import the cert into IIS

  • Error while using the interface IWDClientUser

    Hi All,
    Im getting the error while capturing the ESS user by the interface IWDClientUser.
    *ERROR Details:-* This Compilation unit indirectly referencesthe missing type com.sap.security.api.IUser (typically some required class file is referring a type outside the class path)
    Ihave imported following namespaces also
    com.sap.tc.webdynpro.services.sal.um.api.IWDClientUser;
    com.sap.tc.webdynpro.services.sal.um.api.WDClientUser;
    Regards,
    Sumankumar

    Hi,
    To resolve this
    NW04s
    In WebDynpro Explorer Window, select your project->DC Metadata->DCDefinition->Right click on Used DCs and selecte add used DCs
    select SAP-J2E, choose the com.sap.security.api.sda and finish.
    Ce
    Right Click Dc->Dc Properties->ENGINEAPI->choose com.sap.security.api.sda
    If needed do an Organize Import.
    Regards
    Ayyapparaj

  • Can I use the HTML created in Adobe Edge Reflow?

    Can I use the HTML and CSS code generated to create the webpage preview in Adobe Edge Reflow?

    Hi Joseph,
    After creating and saving your Edge Reflow project, you can use View-> Preview In Chrome. This will create your HTML and CSS in your project folder's "assets" directory.  While our goal with this code is to provide a way for you to preview and share your designs in the browser (not to output production quality code), you can do anything you'd like with the output.
    Joan

  • Any one used the interface /RPM/IF_PFS_ITEM and form /RPM/FORM_PFS_ITEM

    Hi Friends,
    Any one used the above interface and form
    Regards,
    sasidhar

    Hi Karen,
    It seems to me that because the decision point happens before the tabular form is rendered (via the tree right?) you don't really need a "On Change" DA.
    I think you either need find the hms field c030, which could be hidden or visible, as depending on that value go hide or show the hms_info field.
    You'll want to do this either on Page Load or After Refresh or both, it depends on how the tabular form gets refreshed.
    Your DA On Load would be
    Event: Page Load
    Action: Javscript Code
    The code:
    $(".hms").each(function(index) {
      if ($v(this) == 'N') {
      var rowTR = $x_UpTill(this, 'TR');
      $(rowTR).find(".hms_info").hide();
    This code will find ALL your hms fields. if the field has a N then we go up to the TR, find the hms_info and hide it.
    If your page refreshes on every row and the Y/N values don't change after the page loads then you're done!
    What do you think?
    Thanks
    -Jorge
    PS.  This is odd... I thought I was replying to the previous thread.  Weird.
    Message was edited by: jrimblas

  • Using the interface printable

    when I want to print a graphics (print(g) in the print method of the interface "printable"), I obtain just one page, and not all the graphic(2 pages).
    How can I do ?

    this response can t help me :
    the object printerJob invocs the method print without use arguments :
    PrinterJob printJob = PrinterJob.getPrinterJob ();
    printJob.setPrintable((Printable)edit);
    if (printJob.printDialog()) {
    try {
    printJob.print();
    } catch (Exception PrintException) {
    PrintException.printStackTrace();
    the method print in the class of the panel I will print :
    public int print (Graphics g, PageFormat pf, int pageIndex) {
    double escala=1;
    int nbPages=0;
    Graphics2D g2 = (Graphics2D)g;
    g2.translate(pf.getImageableX(), pf.getImageableY());
    nbPages=(int)Math.ceil((getHeight())/pf.getImageableHeight());
    System.out.println("nb pages : "+nbPages);
    if (pageIndex > (nbPages-1))
    return NO_SUCH_PAGE;
    else {
    paint(g2);
    return PAGE_EXISTS;
    the number of pages is 2 (correct), but the system print two times the first page, and not one the first page and one the second page

  • How to raise message using the attributes created in Theme

    Hi,
    I have created an attribute in the theme of the internet service.
    I want to raise a message using alert, how can i use this attribute in the javascript method?
    Regards
    Sohit

    Hi,
    try
    <script language="javascript">
    alert('Attribute:' + `yourAttribute`);
    </script>
    mind the backtics `` !!!
    kind regards,
    ralph

  • Every time I reset my password to update my apps, and go back to use the newly created password, it keeps telling me the password is incorrect.

    No matter what I do, I cannot log in to update my apps. I even went to appleid.apple.com to Manage My Account and NOTHING works. I have reset the password a zillion times and it will not work. I called Apple, but they can't even assist me with password help, which is ridiculous! This is so frustrating. I have Signed out of the iPhone store in the General Settings, turned off my phone, reset it, created a new name, and NOTHING will work!
    HELP!!

    Yes, this happens directly on my iPhone. I go to my App Store icon on my phone, try to "Update All" and my username pops up lookng for the password. I type in the password, and it keeps saying it is incorrect. When I follow the prompts to "reset" a password, I create a new, go back, and the NEW password I just created, literally seconds ago, NEVER WORKS! I've gone to the General Settings icon to log out, log back in, then I go to the iTunes store, log out, log in....NOTHING works. It is drving me crazy!! I can purchase apps, just can't update. I have no idea how to fix, since Apple will not assist me. They say I need to purchase the Apple Care Protection, which is so ridiculous that I have to "pay" to get support on a simple task, such as password help! Sigh...

  • ALV display using the fieldcatalog created programatically

    Hi,
    I have created a field catalog to be passed to the FM REUSE_ALV_GRID_DISPLAY, without calling the FM REUSE_ALV_FIELDCATALOG_MERGE.
    The result is being displayed properly. But the problem is that, when I try to export the alv into a spreadsheet by clicking on the button 'Local File..', the data is saved in random manner in the excel file.(data is being placed in saome other column).
    How to rectify this.
    Please help.
    Regards
    s.a.k

    Hi,
    data:
    l_tbl_fieldcat    TYPE          slis_t_fieldcat_alv,
    lv_fcat           LIKE LINE OF   l_tbl_fieldcat.
    *********************Prepare field catalog***********************
    *Column: Role Name
      CLEAR lv_fcat.
      lv_fcat-fieldname       =   'AGR_NAME'.
      lv_fcat-ref_fieldname   =   'AGR_NAME'.
      lv_fcat-tabname         =   'AGR_1251'.
      lv_fcat-col_pos         =   1.
      lv_fcat-seltext_s       =   text-003.
      lv_fcat-seltext_m       =   text-003.
      lv_fcat-seltext_l       =   text-003.
      INSERT lv_fcat INTO TABLE l_tbl_fieldcat.
    *Column: Role Description
      CLEAR lv_fcat.
      lv_fcat-fieldname       =   'TEXT'.
      lv_fcat-ref_fieldname   =   'AGR_TITLE'.
      lv_fcat-tabname         =   'AGR_TEXTS'.
      lv_fcat-col_pos         =   2.
      lv_fcat-seltext_s       =   text-004.
      lv_fcat-seltext_m       =   text-004.
      lv_fcat-seltext_l       =   text-004.
      INSERT lv_fcat INTO TABLE l_tbl_fieldcat.
    *Column: Transaction Code
      CLEAR lv_fcat.
      lv_fcat-fieldname       =   'LOW'.
      lv_fcat-ref_fieldname   =   'TCODE'.
      lv_fcat-tabname         =   'TSTCT'.
      lv_fcat-col_pos         =   3.
      lv_fcat-seltext_s       =   text-005.
      lv_fcat-seltext_m       =   text-005.
      lv_fcat-seltext_l       =   text-005.
      INSERT lv_fcat INTO TABLE l_tbl_fieldcat.
    Display ALV****
    CLEAR l_wa_layout.
      l_wa_layout-colwidth_optimize = lc_true.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          it_fieldcat   = l_tbl_fieldcat
          is_layout     = l_wa_layout
        TABLES
          t_outtab      = l_tbl_role_res
        EXCEPTIONS
          program_error = 1
          OTHERS        = 2.
    Regards
    s.a.k

  • Converting a PDF to a word document using the online "create PDF" tool.

    So, the title of this message is what I am trying to do.  However, when I do this it acts like it is uploading a file and then nothing ever happens.  I have been waiting hours to see if it was just taking a long time.  Is there a size limit to this service?  My file is 43 MB.

    Hi, could you share a screenshot of what your page looks like immediately after you upload a file? It could be that it just is taking a long time to upload. Do you have a high-speed internet connection?
    This page shows you how to post a screenshot: http://forums.adobe.com/message/4721586

Maybe you are looking for