Iterate through List and return (the names) of all the classes

Hi,
I've got a List and want to see what kind of classes are in this List.
List list = getList();
Iterator it = list.iterator();
while (it.hasNext()) {
     Object ob = it.next(); // get the next item. Is this the right approach for my problem?
        // Her I want to check the Object what classses it holds,
        // assuming that this is the right approach for my problem
}Thanks
Jonny

Hi,
that's what I did:
List list = getList();
Iterator it = list.iterator();
while (it.hasNext()) {
     Object ob = it.next(); // get the next item. Is this the right approach for my problem?
         Class cLass = ob.getClass();
         System.out.println("\t" + cLass.getName());
}This returned java.lang.Object as mentioned.
Question:
- Can an Object hold several types of classes? If so, how can I iterate them?
Mabe this makes things a little clearer:
Why am asking this? I'm returning a List from a (Hibernate)-query. I can access one Class without problems. Another class that should be returned, I can't access. Thats why I want to know what I'm dealing with.
Thanks
Jonny

Similar Messages

  • Function module to get the name of all the function module used

    I want to populate a internal table with the name of all function module used in the submitted program?? Is there any function module which return the name of all the function module used?

    Hi Priya
    Try this one RPY_FUNCTIONMODULE_READ.
    Ranga

  • Is there a Button menu option that will allow one view the names of all the buttons already created?

    Is there a Button menu option in InDesign CS 5.5 that will allow one view the names of all the buttons already created?

    Thanks for your prompt feedback! However, this option does not work for me -- and I'm not sure exactly why.
    Originally, when I tried your suggestion, I got the unsatisfactory result illustrated in the following help request: https://support.mozilla.com/en-US/questions/758172
    Now I am in the process of testing several new add-ons to fix this problem, and I am getting a very different (and even more unsatisfying) result illustrated in the attached image -- so I realize the problem may now be compounded by one or more of the new add-ons.
    (See the attached image that illustrates what happens now when I click on the MyDocs URL after is has been added to my Bookmarks tree.)
    UPDATE: I'm going to try the LocalLinks add-on to see if this will help me open local links using my FireFox bookmarks: https://addons.mozilla.org/en-US/firefox/addon/locallink/
    Will let you know if it works....

  • Can't access title inspector. I can only see the left half that lists the names of all the settings but cannot see or adjust any of the settings like font size or color. I can click on a triangle and expand a setting but can't see setting or change it.

    This screen grab actually cuts off the right side a little bit but this is basically my issue. I can move the whole window but I still can't see or access the parameters for each of the title settings. Is this just a bug I have to live with until Apple fixes it or does anyone have a solution?

    I'm on a MacBook Pro with a 15.4" screen. Resolution = 1024x768 (stretched).
    I've tried moving the window but it cuts off the inspector in the same place and I am unable to resize the width of the window.

  • Apple tv2 stops streaming music and returns to menu page all the time

    why does my apple 2tv stop constantly while playing music and returns to the menu page. Sometimes i have to unplug it to make it work properly

    I'm having a similar problesm with Movies streamed from my Mac.

  • TS1424 I downloaded an album off of the itunes store that had the names of all the actual artists in the artists column but the songs that were downloaded are clearly not being performed by the right people, how can I get my money back?

    Is there a way I can get a refund for this purchase?

    Thanks very much I have contacted them via this. Just hope they respond quickly- rather annoing! Greatly appreciated though

  • Getting the names of all classes

    Hi,
    I want to write a Java editor with code completion. Is there a way to get all the class names available in the installed Java run time environment.
    Does the reflection API provides a way to do it.
    Thanks a lot,
    Chamal.

    You can also look at JPDA (should be documented as part of your JDK under 'Tool Support' of the documents index), and the JDI api VirtualMachine.allClasses() method.
    That will return the name of all loaded classes, which will not be the same as all classes on the path, as it includes any dynamically created classes, and excludes any classes on the path not loaded.
    Pete

  • Names of all the interface elements?

    In iMovie help, it will say such things as “in the project browser” or “in the clip browser” but it does not identify these areas of the interface. I looked at the opening screens of iMovie help, and I cannot find a section where the various interface elements are identified.
    It would be nice if, when it mentioned a certain interface element, you could click on that text and instantly see an image of the element and where it is located, but I have submitted a suggestion to Apple.
    In the meantime, is there an area in iMovie help where it identifies the names of all the interface elements?

    iMovie 11 tutorials:
    http://help.apple.com/imovie/
    http://www.apple.com/ilife/tutorials/#imovie
    and also this:
    http://www.kenstone.net/fcp_homepage/imovie_09_stone.html

  • How to get he names of all the local drives that are present in hdd

    Hi ABAP Experts,
    I want to get the names of all the local drives that are present in hdd on local system using
    ABAP. Is this technically possible. If so how.
    Thanks & Regards,
    Aexandr Ciunchik

    Hi Alexandr,
    My workaround.
    REPORT zztest.
    DATA : len          TYPE i,
           off          TYPE i,
           directory    TYPE string,
           result(1).
    len = STRLEN( sy-abcde ).
    DO len TIMES.
      off = sy-index - 1.
      CONCATENATE sy-abcde+off(1) ':' INTO directory.
      CONDENSE directory NO-GAPS.
      CALL METHOD cl_gui_frontend_services=>directory_exist
        EXPORTING
          directory            = directory
        RECEIVING
          result               = result
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          wrong_parameter      = 3
          not_supported_by_gui = 4
          OTHERS               = 5.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      IF result EQ 'X'.
        WRITE : / 'Drive : ',
                  directory.
      ENDIF.
    ENDDO.
    Regards,
    AS

  • How can i find the label of all the tabs of a tab navigator??

    I have a tab navigator which has three fixed tabs and dynamically i am creating few tabs. Before creating a tab i wanted to know which all tabs are currently open, basically the name of all the tabs which are open.
    Please let me know how can i achieve this.
    Thanks

    extended from the TabNavigator example in the API docs
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                           xmlns:s="library://ns.adobe.com/flex/spark"
                           xmlns:mx="library://ns.adobe.com/flex/mx"
                           minWidth="955" minHeight="600"
                           creationComplete="init()">
        <fx:Script>
            <![CDATA[
                private function init():void
                    for (var i:int = 0; i < tn.numElements; i++)
                        var btn:Button = tn.getTabAt(i);
                        trace(btn.label);
            ]]>
        </fx:Script>
        <s:layout>
            <s:VerticalLayout/>
        </s:layout>
        <s:Panel title="TabNavigator Container Example"
                 width="75%" height="75%"
                 horizontalCenter="0" verticalCenter="0">
            <s:VGroup left="10" right="10" top="10" bottom="10">
                <s:Label width="100%" color="blue"
                         text="Select the tabs to change the panel."/>
                <mx:TabNavigator id="tn"  width="100%" height="100%">
                    <!-- Define each panel using a VBox container. -->
                    <mx:VBox label="Panel 1">
                        <mx:Label text="TabNavigator container panel 1"/>
                    </mx:VBox>
                    <mx:VBox label="Panel 2">
                        <mx:Label text="TabNavigator container panel 2"/>
                    </mx:VBox>
                    <mx:VBox label="Panel 3">
                        <mx:Label text="TabNavigator container panel 3"/>
                    </mx:VBox>
                </mx:TabNavigator>
                <s:Label width="100%" color="blue"
                         text="Programmatically select the panel using a Button control."/>
                <s:HGroup>
                    <mx:Button label="Select Tab 1" click="tn.selectedIndex=0"/>
                    <mx:Button label="Select Tab 2" click="tn.selectedIndex=1"/>
                    <mx:Button label="Select Tab 3" click="tn.selectedIndex=2"/>
                </s:HGroup>
            </s:VGroup>
        </s:Panel>
    </s:WindowedApplication>

  • Iterate Through Lists Instead of Document Libraries, Or both

    System Info: SharePoint 2010 Enterprise w DEC 2013 CU. 2 WFEs (load balanced), App Server, SSRS Server, Dedicated CA Server (All running Win 2k8 R2).
    Background:I have a large (5,000 user) application that is completely customized on top of SP2010. I am the admin, and have been on the team for many years. Previously, we had a development team,
    but client has scaled costs back, and now its just me on the technical side. We have a Web app that houses multiple Site Collections, and each site collection has various subsites.
    My Problem: We have increased the LVT to 10k items (system has plenty of HP, although we do see performance degradation). Each subsite in the Site Collection holds data specific to an organization
    wtihin the Line of Business. There are two lists that frequently approach the 10k mark, and we have mitigation steps in place (essentially, we just create a new SubSite for them once they reach 10k). What I need is a single script that will traverse ALL subsites
    and return a count of their lists, perhaps I can work a couple of if statements in there to have specific data written to a SP List (if count is greater than 5000), and other wise everything gets written to the output file.
    I am trying to iterate through all lists and return a count of folders + items ... The script below works just fine, but it goes through Document Libraries only (per the baseType eq tag).
    I've tried changing baseType from DocumentLibrary to GenericList, but I continually get an error.
    I've also removed the where baseType = DocLib clause completely, and this has the desired results (all lists and doclibs are listed), except the 'WebUrl' field in the csv output is blank.
    Any thoughts on how I can make a small tweak to this script to get my desired results?
    Start-SPAssignment -Global
    $OutputFile ="D:\folder\DocCount3.csv"
    $results = @()
    $webApps = Get-SPWebApplication http://WebAppURL
    foreach($webApp in $webApps)
    foreach($siteColl in $webApp.Sites)
    foreach($web in $siteColl.AllWebs)
    $webUrl = $web.url
    $docLibs = $web.Lists | Where-Object {$_.baseType -eq "DocumentLibrary"}
    $docLibs | Add-Member -MemberType ScriptProperty -Name WebUrl -Value {$webUrl}
    $results += ($docLibs | Select-Object -Property WebUrl, Title, ItemCount)
    $results | Export-Csv -Path $OutputFile -NoTypeInformation
    Stop-SPAssignment –Global

    You guys won't believe this ... But, the script actually works as intended if I change the baseType tag to "GenericList"... I had been getting errors (about 14 of them) through PowerShell and
    assuming the script didn't process, but after looking at the output CSV, it seems that everything worked properly. I think the 14 errors MAY have been corrupted sites (or something?) as it gives me NullValueNotAllowed when trying to "Add-Member" and points
    to $WebUrl as being null.
    Next up -- working on getting this script to write specific objects to a SP list!

  • I can't update iPhoto after installing OSX 10.9.2, it has the name otto@**** in the apple ID box and will not let me change it. Any thoughts?

    Hello people,
    I can't update iPhoto after installing OSX 10.9.2, it has the name otto@**** in the apple ID box and will not let me change it. Any thoughts?
    Thanks
    <Email Edited By Host>

    You installed a hacked app, originally from the Mac App Store. It contains the receipt for a different app, downloaded using an account that you don't control. You need to identify and remove the hacked app.
    Important: The app you need to remove is not necessarily the one named in the App Store alert. For example, the App Store may prompt you to update "Angry Birds" or "Twitter," but the hacked app may be something else entirely. Don't make any assumptions about which app you're looking for. To find it, you must carry out a systematic search with Spotlight.
    1. Triple-click anywhere in the line of text below on this page to select it:
    kMDItemAppStoreHasReceipt=1
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    2. In the Finder, press command-F to open a search window, or select
    File ▹ Find
    from the menu bar. In the search window, select
    Search: This Mac
    from the row of tokens below the toolbar. Below that is a popup menu of search criteria, initially showing Kind. From that menu, select
    Other...
    A sheet will drop down. In that sheet, select
    Raw Query
    as the criterion, then click OK or press return.
    Now there will be a text box to the right of the menu of search criteria. That's where you enter the raw search query. Click in that box and paste the text you copied earlier by pressing command-V.
    4. The search window will now show all the App Store products that are installed. Compare those search results with the list of your purchases from the App Store. To see the complete list, you may need to unhide hidden purchases. If any apps were download from the App Store using other Apple ID accounts that you control, sign in to the store under each of those ID's and check the purchases.
    At least one of the apps in the Spotlight search results is not among your purchases in the App Store. Move each such item to the Trash, after quitting it if it's running. You may be prompted for your administrator password. Empty the Trash.
    Quit and relaunch the App Store. Test.
    If you find these instructions confusing, ask for an alternative method.

  • When I cull through my images in the filmstrip everytime I use my right arrow and rate a photo it jumps back to the first thumbnail and i have to arrow all the way back to where I left off.  Is this a setting issue

    When I cull through my images in the filmstrip everytime I use my right arrow and rate a photo it jumps back to the first thumbnail and i have to arrow all the way back to where I left off.  Is this a setting issue

    Art,
    I am trying to follow your very precise steps, and in my case (PSE11 also, Win7), the focus stays on the edited picture after I return from the editor to the Organizer. I am pretty sure that in the previous post describing your situation, I was able to reproduce the problem, but I don't remember on which version. I just tried in 'Folders' view mode to edit in a selected folder, then I clicked 'All media' so that no folder was selected. Same result in both cases.
    Even if you prefer to work in folders view, you could take advantage of the ability to use 'albums'. It's a misleading word to describe a selection, a 'collection' of pictures, which you can sort as you want. It's a kind of  'playlist' like with music items. In the organizer, you can select a folder and create an album (even a temporary one) just by choosing 'create instant album'. Suppose you have made an album from a folder or a selection of highlighted pictures to edit. You can order them in date order, import batch or 'custom' order'. Since PSE12 you can also sort them in filename order. You should never lose the 'focus' on your last edited picture when coming back from the editor to the organizer. If the purpose of that album is only to help in organizing an editing session, you simply delete the album (the playlist) if you don't want to keep the list afterward.
    I hope someone will be able to confirm how that can happen...
    Edit;
    I have just read Brian's post.
    That may be the difference...

  • TS1398 till 2 days back I was able to use facetime but now I can call through facetime and ring is also there but the thing is while connecting it is showing FACETIME FAILED..plz tell me a solution for this

    till 2 days back I was able to use facetime but now I can call through facetime and ring is also there but the thing is while connecting it is showing FACETIME FAILED..plz tell me a solution for this

    you have a ps cs4 license for mac and you have some way of finding your serial number.
    if yes, download an install the installation file.  if you already have the installation file, what is its name and file extension?  (eg, if it's one file, it should be a dmg file.)
    if you need the installation file,
    Downloads available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4 | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  13 | 12 | 11, 10 | 9, 8, 7 win | 8 mac | 7 mac
    Photoshop Elements:  13 |12 | 11, 10 | 9,8,7 win | 8 mac | 7 mac
    Lightroom:  5.6| 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • Add an item into announcement list in site collec. and repeat the same in all the sub webs' announcement list without using event receiver

    hi,
    I have a requirement: in my site collection i have an announcement list. and in my site collection  some 600+ sub sites exist. sharepoint admin uploads an announcement into this rootweb's announcement list. now is there any way
    i can add the same announcement -which has title, description, date time etc .- to all the 600+ sub sites' announcement list?
    i know , if i write a list item event receiver i will be able to iterate through eacha nd every subweb of my site collec and add this item into those sub web's  announcement list. But, without writing an event receiver and creating and deploying
    another wsp and avoiding all those headache, is it possible to achieve this requirement?
    any other approaches are highly appreciated!

    Hi,
    As a workaround, we can create a winform application for admin use only to add the item to all the sub web's announcement list.
    Developing Sharepoint Windows Forms
    http://www.codeproject.com/Tips/566370/Developing-Sharepoint-Windows-Forms
    Best Regards,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

Maybe you are looking for

  • How do I transfert my domain name from the first registrar to business catalyst ?

    Hey, I don't find where (on the Admin Console) I have to put the EEP Key of my domain name I want to use for the website on BC. This EPP Key  come from the registrar of my  site that I want to transfer to BC. I want use this name domain. Can you help

  • Itunes wont burn SD 11 anymore

    I am on panther and did an update of my Logic 7 QT and Itunes the other day. I would always bounce my Logic 7 files to an SD11 file and burn through Itunes but since I did the update Itunes wont burn sd11 it just has a message saying itunes cant reco

  • Command-TAB - How does this build the application list???

    I have a need to enumerate the applications that have "windows", "icons", whether if they are minimized to the dock or not. I need basically the list of applications that Command-TAB brings you. How do you do this programmatically? Everything I tried

  • Difference with Crystal Reports?

    HI We are looking at Business Objects now I am downloading the trial edition Edge. I am interested in how this Bus,Objects is different from Crystal Reports, that is, what does Business Objects give that is lacking in the other? Thanks, Phil

  • What is the Count function in formula of Query Design?

    What is the Count function in formula of Query Design?  Could someone gives an example? Thanks!