Help of the ArrayList.

Hello.

I have a little trouble looking for my arraylist.

I have 3 classes, books, painting and music, genres and artists in them, which then extends the WorksOfArt class. It is then added to an ArrayList in a new class called ArtCollections. Now, what I need, is for example, extract songs with 2 or more artists.

How would I go to do this? I have the vague feeling that I have to use instanceof or something similar.

Thanks in advance.

Moopz wrote:
Where exactly should I use?

In the composition class, as you have already said. And you wouldn't 'use' it, you would ignore it.

Try to put this in your class Komposition:

public String toString() {
  return "I have not implemented this method correctly.":
}

Run the code that you complain again. See what's happening. Then, implement the method correctly, that is to go back to what you want to see.

Tags: Java

Similar Questions

  • How to refresh the arraylist on MAF UI

    Hello

    I'm developing an application of MAF with Jdev 12.1.3.0.0.

    I have a listView on my page of amx. This is value bound to an arraylist (ArrayList < String >) in the bean support. There is an event of action on the page, which adds items to the ArrayList instance.

    My problem is, I'm not able to update the display of the list on my user interface.

    Newspapers, I am able to see the event method called as well as a list of Board action is changed.

    But that updated the arraylist reflects not on my user interface.

    Here is my code snippets:

    ---------------------------

    the amx page:

    < amx:listView var = value ' row' = "#{TripsBacking.refreshtimelist}" showMoreStrategy = 'autoScroll' bufferStrategy "viewport" id = "listView1" = > "

    < amx:listItem id = "SDp" showLinkIcon = "false" >

    < amx:outputText value = "#{line}" id = "ot1" / >

    < amx:actionListener id = binding = "#{TripsBacking.pullToRefresh"al1"}" type = "swipeDown" / > "

    < / amx:listItem >

    < / amx:listView >

    ---------------------------

    Backing bean:

    public class TripsBacking {}

    ArrayList < String > refreshtimelist;

    Transitional public PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport (this);

    Transitional public ProviderChangeSupport providerChangeSupport = new ProviderChangeSupport (this);

    {} public void setRefreshtimelist (ArrayList < String > refreshtimelist)

    ArrayList < String > old_value = this.refreshtimelist;

    This.refreshtimelist = refreshtimelist;

    propertyChangeSupport.firePropertyChange (old_value, "refreshtimelist", refreshtimelist);

    providerChangeSupport.fireProviderRefresh ("refreshtimelist");

    }

    public ArrayList < String > getRefreshtimelist() {}

    Return refreshtimelist;

    }

    public TripsBacking() {}

    refreshtimelist = new ArrayList < String > ();

    refreshtimelist. Add (Calendar.GetInstance () .getTime (). ToString());

    }

    {} public void pullToRefresh (ActionEvent actionEvent)

    Calendar c = Calendar.GetInstance ();

    Date d = c.getTime ();

    ArrayList < String > templist = getRefreshtimelist ();

    System.out.println ("date:" + d);

    templist. Add (d.ToString ());

    setRefreshtimelist (templist);

    }

    {} public void addPropertyChangeListener (PropertyChangeListener l)

    propertyChangeSupport.addPropertyChangeListener (l);

    }

    {} public void removePropertyChangeListener (PropertyChangeListener l)

    propertyChangeSupport.removePropertyChangeListener (l);

    }

    }

    ------------------------------

    I will surely provide more information if necessary.

    Ask for your help to solve this problem. Thank you.

    Thank you

    Tejas desrousseaux

    Hi Tejas,

    you declare a variable of providerChangeSupport, but you need to add public methods to support:

        public void addProviderChangeListener(ProviderChangeListener l) {
            providerChangeSupport.addProviderChangeListener(l);
        }
    
        public void removeProviderChangeListener(ProviderChangeListener l) {
            providerChangeSupport.removeProviderChangeListener(l);
        }
    

    You must move the providerChangeSupport.fireProviderRefresh ("refreshtimelist"); calling the method "pullToRefresh" (after the call to the set method).

    If you trigger the refresh, the entire list is reloaded. If you want to refresh only new posts, you must use the method providerChangeSupport.fireProviderCreate (Oracle Fusion Middleware Java QAnywhere for Oracle Mobile Application Framework).

  • I want you to help because the phone asking me to become a frequent and annoying enter a password to calculate the icloud

    Hello

    I want you to help because the phone ask me for becoming a frequent and annoying password to calculate the icloud, and I do not know because I bought a phone from someone else is not new Hama is on the phone (*) No. account. IMEI (*) Please help me soon thank you

    < post branched out by host >

    < personal information under the direction of the host >

    Robert Odamat says:

    Hello

    I want you to help because the phone ask me for becoming a frequent and annoying password to calculate the icloud, and I do not know because I bought a phone from someone else is not new Hama is on the phone (*) No. account. IMEI (*) Please help me soon thank you

    < post branched out by host >

    < personal information under the direction of the host >

    Find my iPhone Activation Lock - Apple Support

    There is nothing you can do to get around activation icloud blocking without recovering the former owners information.

    Communicate with the person that you bought the phone.

  • What is the correct way to ask for help with the forum, rather than product, questions?

    I can't find the right way to ask a question about the forums themselves.

    PAGulley said

    I can't find the right part of the forum to ask questions about the forum itself and its features. I wonder what the right place and the way is to get help with the forum system itself. I can find the place to ask questions about specific Mozilla products very well.

    Look up where it says contributor tools and select Contributor Forums. Make sure that you scroll to the top or you'll get a bar with different links instead,

    The forum is https://support.mozilla.org/forums where you question would be better in the SUMO community discussions.

  • Speed/performance of my mac mini (mid-2010) is very slow. Need help, consolidate the files, software updates, etc. in order to improve the speed and performance.

    My mac mini (mid-2010) speed/performance is very slow - think of it as a result of letting my kids do "whatever" about it in recent years.  Need help, consolidate the files, software updates, etc. in order to improve the speed and performance.  You will also need to get data out of old PowerBook G4.

    < object edited by host >

    We are users like you.  Search locally by using something like Yelp or similar

    http://www.Yelp.com/search?find_desc=Apple+repair & find_loc = Chicago, + IT & start = 0 & ortby = rating s

    or read a few links which may be relevant on this forum about the slow mac mini

    http://BFY.tw/5C63

  • I have a complaint on my Mac Book Pro. I bought my computer in January 2016 and it has two problems: the first is the display of the retina that has many traces of the keyboard and as many times it freezes. I have looked for help on the local Apple Store

    I have a complaint on my Mac Book Pro. I bought my computer in January 2016 and it has two problems: the first is the display of the retina that has many traces of the keyboard and as many times it freezes. I have looked for help on the local Apple Store and support too, but it did not help. I would like you help me solve this problem.

    Thank you.

    Kelly

    Your machine is still under warranty, so you should take it to your local Apple store for repairs. Function late in January, you bought it, you still have phone without support. If you can't find any help on the Apple Store, then I don't know what you expect to find here. We have no way to check for problems you have described or any additional hardware, etc.

  • Jerky mouse mouseover function for all while the menu (file, options, help) and the key back/forward/home too. More scrolling is choppy every Web site.

    Jerky mouse mouseover function for all while the menu (file, options, help) and the key back/forward/home too. More scrolling is choppy every Web site since the update to version 3.6 to 4 RC1.

    Gel mouse pointer when it comes across objects that use some sort of animation or gradual highlighting when hovering on (which is basically all the Firefox 4 items menu, tabs, etc.) But also a lot of things on the Web pages as the green buttons on this page that change color when you hover over them).

    After rebooting my system, however, the problem seems to have disappeared!

    [, WinXP SP3 - 4 GB RAM, Core i5 M520, driver Nvidia NVS3100M 6.14.12.5738, Firefox 4.0]

  • iPhone iOS 9.2.1 5 c screen flickers once in a while. It's okay if I use an app or text my screen flickers and is based on an application or if I TEXT it random characters of text. Help solve the problem

    Title says it all. I need help with the issue fixed.

    Making a reservation at your nearest Genius Bar - Apple Store - analysis is free

    If no Apple store nearby, take it to the Apple authorized service provider - they establish their own assessment policies > https://locate.apple.com/

    Apple does NOT endorse them, but there are folk of 'independent' service which can do a very good job (caveat emptor)

  • Need help with the installation of an adapter of Palit GeForce 9500GT Super chart - 512 MB in a M2N68 (narrated

    Need help with the installation of an adapter of graphics Super Palit GeForce 9500GT - 512 MB - DDR2 SDRAM in a M2N68 motherboard (narra6). Should I disable the onboard graphics in the bios? When the card is installed, no VGA work outs and the PC does not start. Checked and recontroler implementation of the card in the PCI slot. PC is a desktop HP G5200uk PC. Windows 7 operating system.

    Hello

    The link below is a guige to install a video card in your Pc.  In particular, it seems that you will have to perhaps specify the location of the new card in the bios and save this change before you install the new card - see step 4 in the guide on the link below.  If your new card fits into the PCI Express x 16 slot, you will need to define PCI Express in the bios and save the changes.

    http://support.HP.com/us-en/document/c01700855

    Kind regards

    DP - K

  • Satellite Pro A300-15V, I need help in the Organization of my startup list

    Hello everyone!

    I need help in the Organization of my startup list:

    (Why should Toshiba button support I this program if my laptop doesn't have multimedia keys? OR maybe this program for something else?)
    ItSecMng (although I have disabled the Bluetooth Manager to run when starting from this point still remains in the startup)
    Agent of filtering of Audio Conexant high definition (what is this program? Do I really need to start?)
    TOSHIBA Power Saver
    Toshiba Flash Cards
    RAID event monitor

    So, my friends. Could you give a valuable suggestion whether or not it is prudent to disable startup above entries? I want to speed up my laptop at the highest possible level.

    Thanks a lot for your time!

    Kind regards
    Osman.

    My laptop:

    Toshiba Satellite Pro A300-15V (PSAJ5E) => NOT have multimedia keys except the FN keys.

    > Toshiba Button support (why should I this program if my laptop doesn't have multimedia keys? OR maybe this program for something else?)
    You can disable it. If your mobile phone does not support the multimedia buttons then this tool is useless.

    > ItSecMng (although I have disabled the Bluetooth Manager to run when starting from this point still remains in the startup)
    I don't know what would make this process, but you can disable this in msconfig-> tab start Mr. If it would take in the future, then you could turn it on again.

    > Agent of filtering the Conexant high definition Audio (what is this program? Do I really need to start?)
    I think that this is necessary. It could improve your audio

    > Toshiba Power Saver
    This is important. It s an additional saving of Toshiba option for Win 7

    > Toshiba Flash Cards
    This tool controls the FN keys.

    > RAID Event Monitor
    Hmm so you don t have two hard disks, then you can try to disable it too.

  • help with the beats on my envy 17-3270nr, n key

    help with the beats on my envy 17-3270nr key. recent Smart hard disk crash, replaced with exact same hitachi drive, same care extended warranty repairs covered of the Frys. Windows 7 Edition home premium w / service PAC 1 installed, drivers installed, except that now there is no volume of beats on screen graphic dial button, click the button on top button on the page does not call the beat of the application settings. Futhermore; the motion sensors of laser to activate the keyboard backlit keyboard do not work.  Are there drivers hp software to enable the missing features?

    Hello

    Download and install the following.

    HP OSD utility.

    Proximity sensor driver.

    Once completed, restart the laptop.

    Kind regards

    DP - K

  • I need help to the new photo of my photos from iphoto on El Capitan. Any help would be appreciated.

    I need help to the new photo of my photos from iphoto on El Capitan. Any help would be appreciated.

    To migrate your iPhoto library to Photos for Mac, drag it in the Photos icon in the Dock.  Photos will read the iPhoto library and create a new library of pictures of him.

    Is your photo library in iPhoto on an external drive? The migration will work that if the external hard drive Mac OS extended (journaled) file system.  If the library is on a disk with a different file system, Ministry of the environment of the library of a correctly formatted disk.

  • I need help with the program of Photos on my macbook pro

    I use a Macbook Pro with OS of Yosemite. I really need help with the Photo program. I never really got the hang of IPhoto and now that it's a new program, I'm really confused. Where can I go to learn this without waiting for the next workshop in a local store?

    Hi, I'm fighting to open same mine, making a new software update

  • Help reduce the partial wakelocks

    Hey guys,.

    Recently, I noticed that my phone is wake a lot more then it helps when the screen is off and I'm in stand by mode. attached a few screenshots show what I got. It seems that the first three next annex espeically alarm and synchronization loop are the culprits.

    Someone at - it no indication as to what I can change the settings to reduce these locks specifically wake?

    Thanks in advance for any help.

    There are a few ideas I've read on this particular suite lock. Most agree that it is strongly associated with the grille and gnow. I would check your sync on your calendar options if you use it. Otherwise, you could just turn off. Another thought was that this could be attributed to a music player/blue tooth. Using the power control widget can be an easy way to toggle Bluetooth, GPS, WiFi, etc... on and off quickly. This is particularly useful if you are trying to save the battery. As Quentin stressed XDA can really be helpful when you're investigating specific processes.

  • There is no help for the usrp blocks screens

    For power, where are the docs for help for the USRP & USRP related blocks (host side & lvfpga blocks)? Help is dimmed in the menus. If they came with the driver, they should be grouped in with something not obvious & has not installed. Where are they?

    BTW, I use NU-USRP 15.00.

    Thank you.

    apchar,

    Try to use context-sensitive help on the pilot of the USRP RIO screw Either click on the "?" in the upper right corner of the block diagram, or press Ctrl-H and hover over the screws of RIO USRP. You should see the additional help documentation.

Maybe you are looking for