Printing a list

Hi
I'm trying to write a method to print a list containing a music records details.an empty string should be used if certain information is not available. this information should then be excluded from the printing i.e. the method should print all non empty strings.
class recordDetailsClass
String recordName;
String recordArtist;
String recordLabel;
public recordDetailsClass(String a, String b, String c)
recordName=a;
recordArtist=b;
recordLabel=c;
public void printDetails()
recordDetailsClass next;
System.out.println("Record Name: " + recordName);
System.out.println("Record Artist: " + recordArtist);
System.out.println("Record Label: " + recordLabel);
} Any ideas?
Thanks
Message was edited by:
jclegs

import java.util.*;
class AssessedPracB1
     public static void printList(List L)
      contactDetailsClass nextContact;     
          for (int i=0; i<L.size(); i++)
          nextContact = (contactDetailsClass) L.get(i);
          System.out.println(nextContact);
          System.out.println("=============");     
     public static void main(String[] args)
          List contacts = new LinkedList();
          contacts.add (new contactDetailsClass("M Collin John", "84 Gleban Close", "Super Parcels LTD, Spain" , "02890376198","",""));
          contacts.add (new contactDetailsClass("J Gilbraithe", "1 Gilford Street", "Ian&Sons Tilers LTD, Vietnam" , "02890376198","",""));
          contacts.add (new contactDetailsClass("K Pressman", "92 Glen Avenue", "Tesco LTD, Belfast" , "","02840987392",""));
          contacts.add (new contactDetailsClass("B Strain", "95 Orchard Close", "Mighty Parcels LTD, Portglnone" , "02890376198","",""));
          contacts.add (new contactDetailsClass("M McCanning", "8 The Square", "Patton Road Services, Crossmaglen" , "02890376198","",""));
          contacts.add (new contactDetailsClass("K O'Hare", "19 The Olde Cuff Links", "" , "02838356118","","07778282738"));
          printList(contacts);
class contactDetailsClass
     String name;
     String home;
     String workAddress;
     String homeTel;
     String workTel;
     String mobileTel;
     public contactDetailsClass(String a, String b, String c, String d, String e, String f)
          name=a;
          home=b;
          workAddress=c;
          homeTel=d;
          workTel=e;
          mobileTel=f;
     public void printDetails()
     if(name != null && name.length() >0){
    System.out.println("Name: " + name);
     if(home != null && home.length() >0){
    System.out.println("Home: " + home);
     if(workAddress != null && workAddress.length() >0){
    System.out.println("Work Address: " + workAddress);
     if(homeTel != null && homeTel.length() >0){
    System.out.println("Home Tel: " + homeTel);
     if(workTel != null && workTel.length() >0){
    System.out.println("Work Tel: " + workTel);
     if(mobileTel != null && mobileTel.length() >0){
    System.out.println("Mobile Tel: " + mobileTel);
}This is another one i need to fix which gives the same error, more detailed code so could be easier to fix
Message was edited by:
jclegs

Similar Messages

  • In Ical, can you print a list view calendar without notes?

    In Ical, can you print a list view calendar without notes?

    cj,
    After selecting Calendar>File>Print...> I am presented with a Print selection pane which offers among other choices, a "List" selection:
    What do you see?

  • In Mail, is there a way to print the list of mail activity in a folder without actually printing each email?

    In Mail, is there a way to print the list of mail activity in a folder without actually printing each email?
    Thanks to all.

    Actually, I noticed in "More Like This" questions similar to mine.  One of the suggestions worked perfectly.
    Command Shift 4 turns the arrow into a target scope.  Use it to take a screen shot of the area you want printed.  Thanks to all.

  • When printing a list in Address Book, how can I select more than the default Attributes and keep them selected when I print again? I want to print ALL information for contacts so I have email address, notes, phone, company, title, etc all on one page.

    When printing a list in Address Book, how can I select more than the default Attributes and keep them selected when I print again? I want to print ALL information for contacts so I have email address, notes, phone, company, title, etc all on one page. I don't want to have to check off an additional 5 or 6 attributes each time I print out contact information. Is there a way to change the default setting for printing lists, so it is not just "phone," "photo," and "job title?"

    I have a user who wants to do this same thing. I did not find any way either to default the attributes to anything other than what you see the first time. Seems like such a trivial thing, hard to believe they do not allow it. I did find a program for this called iDress but I can't seem to download it from any links on the Internet. Not sure if it is free or not, but it was recommended by a link on the Mac support site.

  • How do I print a list of only the album names I have in Itunes.

    I am new to I Tunes.
    I am using Windows 7 on a Dell laptop.
    I would like to print a list of only the album titles I have loaded onto my Ipod Nano.
    Thanks for any and all help.

    trvlnmny wrote:
    Thank you for your reply.
    In ITunes I have gone to Music.
    I then did File >  Print and selected Album Listing.
    When I did this it did display the albums but also all the songs on each album.
    I would like to have the album names only
    After you click "Album Listing," you will see a "Theme" pulldown menu that gives you the choice of "Songs by Album" or "List of Albums."  Choose the latter.

  • How can I print a list of the songs I have in my iTunes library?

    I have iTunes 6.0.2 installed in my iMac. There are now about 300 songs in my iTunes library. I've tried to print a list of these songs, but only one page will print. How can I get my printer to print as many pages as it takes to print all of the song titles?
    iMac DV (Special Edition) Mac OS X (10.3.9)

    "Page setup" not do anything for you? Are you
    selecting all the songs in your library before you
    try to print?
    I never knew what "Page Setup" was for nor have I ever used it. Nevertheless, it did the trick, and I was able to print all six pages. I'll have to confess, though, that I still don't understand what "Page setup" is for, even though it helped me this time. I don't like to print many pages but I have, sometimes even over 100 at a time, and I never had to use "Page setup". I just said to print ALL, and that was all that was necessary. All I can say about "Page setup" is that it should be tried if the usual methods don't work. Thanks for bringing it to my attention, and thanks for your help.
    iMac DV (Special Edition) Mac OS X (10.3.9)

  • How can I print a list of all folders/directories on my MacBook Pro?

    I need to print a list of all directories on my MacBook Pro.  Is there a way to do this already on my Mac, or can anyone recommend the best software to do this?

    And if you pipe the result of Charlie's suggestion to a file, you have it printed out:
    in the Terminal you enter following command first:
    cd <enter>
    now you are in the root folder ... and then:
    sudo ls -R */ | grep '/$' | cat > ~/Desktop/folders.txt <enter>
    to explain:
    certain folders are only readable by the administrator. That means, we precede this command by sudo; you have to enter your password
    ls means list, the switch -R means recursive
    | means pipe the command to an other command and grep is taking only the entries finishing with a / (that means folders only, not the files
    then we | pipe everything to the command cat, which puts the found folders into a file on the desktop ...
    hope this helps

  • Is there a way the "i" can be forced on all songs in your list that are broken, then print a list of every song? thx

    I posted a similar question about a half hour ago, but I have no idea where it went. Sorry for the redundancy.
    Hopefully the title says it all. Without clicking on each darn song I would like EVERY song in my library to show the "i" exclamation mark, and then I would like to be able to print a list of all my songs so I can figure out which I need to re-install. I lost connection to a bunch of songs after a Windows 7 update.
    Thank you,

    Your other post is here.
    This happens if the file is no longer where iTunes expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, or that the drive it lives on has had a change of drive letter. It is also possible that iTunes has changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout, or vice versa, and so is looking in slightly the wrong place.
    Select a track with an exclamation mark, use Ctrl-I to get info, then cancel when asked to try to locate the track. Look on the summary tab for the location that iTunes thinks the file should be. Now take a look around your hard drive(s). Hopefully you can locate the track in question. If a section of your library has simply been moved, or a drive letter has changed, it should be possible to reverse the actions.
    Alternatively, as long as you can find a location holding the missing files, then you should be able to use my FindTracks script to reconnect them to iTunes .
    If you just want a list of what is currently broken use this technique...
    Lost & Found
    Create a playlist called Found, select everything in Music and drag it into the Found playlist. Create a smart playlist called Lost matching All the rules Playlist is Music and Playlist is not Found. Your lost tracks will be in this playlist.
    tt2

  • How do I view my subfolders so I can print a list of my directory (main folders and internal subfolders) without clicking the triangle to expand each main folder?

    In VIEWING (to print) my iTunes music (in finder), how can i view subfolders without clicking on the  triangle of each main folder?
    I am trying to print a list of all my music. For example, main folder is BEATLES.  Subfolders are Magical Mystery Tour, Yellow Submarine, Abbey Road, etc...
    and I want to view and print all the subfolders. This is a recovery project after my hard drive failed. I know this is truly a "finder" question and will double post there.
    Thanks.
    Amy

    Try PrintWindow:
    http://www.macupdate.com/app/mac/6465/print-window
    Regards.

  • Can't print a list of calendar events?

    Unable to print a list of calendar events in recent update to iCal.
    Is there some way of doing this

    cj,
    After selecting Calendar>File>Print...> I am presented with a Print selection pane which offers among other choices, a "List" selection:
    What do you see?

  • Printing in list form , appointments ONLY in ical, not the whole month.

    Hi there, I have already done a quick scan of the net and I am unable to come up with a solution.
    All I want to do is be able to print out a list of appointments (with date etc) that I have made, not in month view, but just the dates with appointments in.
    Is there an App to do this? I have found ICalPrint but it wont let me try it as a demo.
    Please help, any help would be greatly appreciated.

    I just tried this for the first time lastnight and cannot believe how something so simple does not work. I have a calendar just for birthdays because I was working on a new iPhoto calendar. I wanted to print the list of birthdays and dates so I went to Print in iCal and saw the 'Print List' selection and thought that would work great.
    I selected 1/1/08 as the start date and then selected for 365 days expecting just a list of upcoming events in the calendar. Instead it wants to print page after page with every date on it for the next year even if there is nothing scheduled for that day. It just prints 'None'. How hard would it be to have it just print what is in your calendar for the next xx days. I think it would be handy to have a list of upcoming events printed out to glance at or mark up.
    I am glad I am not the only one that thought this was so simple, yet impossible to do. I hope it gets changed. Maybe with Leopard it will be different.
    - James

  • How to print a list of the folders and files in a higher level folder?

    I want to print out a list of the files that I have in a folder. It contains a nested series of folders with files in each. I want to print a list of folders and files in the same order that I see them on the screen. I'm seeing them in the finder in List format.
    If I select all, copy, then paste into a word processor, I get all the files and folder names reorganized alphabetically, which I don't want. Also, I don't get the file size or date modified when I do this.
    I'd prefer not doing 30+ screen shots then having to print them all individually.
    Any suggestions?
    Thanks,
    Brad

    There is also DiskCatalogMaker (http://diskcatalogmaker.com/) even better than PrintWindow in my estimation

  • How can I print a list of iTunes albums only, without  songs?

    Itunes offers printing of albums but, what I get is a list of my 500 classical music albums and all the songs/tracks therein. Whereas I want to print only an alphabetical list of my albums, no songs. Better yet I would like to print a list of all my playlists (left column) which no longer seems possible.

    baoluo wrote:
    Thank you for the reply. Yes, I had tried that but, with my Albums showing, when I selecrt File, Print (and pdf), it shows all the song titles in each album and I want only the album titles.
    Make sure you have set the pulldown to "List of Albums" as pictured by Mr. McBlob.  It is working fine on iTunes 11.1 on my machine.
    It should give you a list of albums.  The printout will indicate the "# Items" for each album, but will not list song titles.

  • Can I print a list of the clips I've captured?

    OK, obvious newbie questions:
    I've captured about 300 clips from source video tapes (basketball games). As I captured, I renamed each clip for tracking. All clips show in the browser, but I'd like to print the list (since it's pretty long) to plan the timeline/storyboard. How do I do this?
    Also, I went out to the file where the clips are stored (in the capture scratch folder), but the files have the original names (untitled, untitled 1, etc.). What happened to my names?

    Yes, a bit of a round about way versus Avid print function but possible.
    1. First set up your bin view as you want it. Best to hide everything you don't need.
    2. Double click your bin open (this is important unless your browser view is the same as your bin view setup) and then from the top menu select File>Export>Batch list. You can keep tab delimited on and save using your bin name.
    3. Use Word or similar that gives you the option to convert text to table, select all your text and convert. This seperates your columns out neatly.
    4. Print.
    G5 dual   Mac OS X (10.4.2)  

  • How can i print a list of bookmarks or extract bookmarks with number paper to print?

    How can i print a list of bookmarks or extract bookmarks with number paper to print?

    I have created a tool which can create a summary of the bookmarks structure of a file in either PDF format or as a plain text file, and you can also choose whether or not to include the matching page number for each bookmark. Have a look here: http://try67.blogspot.com/2008/11/acrobat-export-bookmarks-to-pdf-txt.html

  • Print event list from iCal

    I manage different calendars, private, work, hobby etc.
    Now, I would like to print a list of upcoming events from one of those calendars.
    My iPhone has a "list" option that does exactly what I want, but I can't print that.
    I have tried File/Print selecting only the wanted calendar and a date span, but I don't get the expected result.
    iCal will print ALL the days within the time span, including dates with no entry. I would like to see only a list with events...
    Is this possible in iCal?

    The only way I have found takes a few steps, but it is not too complex.
    - It requires the desired events to have a common set of characters in each event so the Search function will pull them out together (e.g., xxx, day, class, etc.).
    - These common characters can be in the main event text box at the top of the event, or they can be anywhere in the event (in the location field, in the note section of the event at the bottom, etc.)
    - Next, be sure the Calendar is selected on which these events are listed (top left corner click on Calendars and put check in the appropriate box(es).
    - Next, click in the Search box in the top right of the main Calendar window and type the common characters set you entered in all the events (e.g., day).
    - This opens a window pane at the bottom of the Calendar window.  To make the window pane larger click on the top of the window pane and drag it towards the top of the screen.
    - In the window pane is a list of all the events that meet your search criteria.
    - Click on all the events you want to print (<shift>mouse click on a range and <command>mouse click work here)
    - Select print Calendar (File/Print, <cmd>P, ...)
    - In the print window, first select or unselect the Calendars to print (so only the desired Calendar keys print)
    - Next, in print window, at top in View, select "Selected Events"
    - Select the print options you want
    - Click on Continue, with takes you to the Printer window, and select the print and click Print (or PDF)
    Done!
    I believe this is much harder than it should be. I haven't yet found a 3rd party app that makes this any easier.

Maybe you are looking for

  • Bug in screensaver OR graphic card? Help me figure this out

    I have a 15" MacBook Pro 2.66 GHz purchased in late September 2009. There is an odd bug that shows up in the mosaic screensaver (the one that represents one of your iPhoto pictures using a mosaic of your other photos) when I use the "Better Graphics"

  • Emailed unknown images of a person in an unknown apple store.

    Today I received several emails of Video and Images taken from an iPod in a Apple store from the email address [email protected] Why have I been emailed these?

  • Profit Center Details?

    Hi All, Can anyone please tell me that how to check the Profit Center details like location, region, etc.? I am using the ERP SAP 6.0 version. Thank you very much in advance!!! Regards, Mohan

  • Why does the down arrow button scroll content up?

    The new logic/behavior with swiping up/down is now: "you are moving the content, not the scrollbar" I can accept this as a somewhat good logic. It makes sense.. But should'nt the arrow keys behave the same way to make this behavior/logic consistent?

  • No startup and no display

    hello there i have an i mac with sudden no startup and no display? I tried to fix that problem such as holding (command,option,P, & R) together while restarting. My device still under warranty so please i need to know how can i fix that problem.