Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > BOOK: Beginning Visual C# 2005
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning Visual C# 2005
This is the forum to discuss the Wrox book Beginning Visual C# 2005 by Karli Watson, Christian Nagel, Jacob Hammer Pedersen, Jon D. Reid, Morgan Skinner, Eric White; ISBN: 9780764578472
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old December 8th, 2007, 09:25 AM
Registered User
Join Date: Dec 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch11CardLib InnerList.Contains vs List.Contains

In the book on page 284 you add a new class, named Cards, to the Ch11CardLib. In the function Contains(Card card) you make use of the Contains method of the ArrayList for the collection accessed through the InnerList property. I've noticed that the List property also has a contains method. Is the InnerList.Contains just slightly more efficient than the List.Contains or is there another difference between the two?

  #2 (permalink)  
Old December 8th, 2007, 03:51 PM
Friend of Wrox
Points: 793, Level: 10
Points: 793, Level: 10 Points: 793, Level: 10 Points: 793, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: May 2005
Location: OKC, OK, USA.
Posts: 227
Thanks: 1
Thanked 7 Times in 7 Posts

My response is based solely on your question verbiage.
================================================== =====
I would not say one list is more efficient than the other, but rather both lists are equally efficient and important based on which list references the information needed. In other words, I look at the "CardLib" as a Card Catalogue, with the "List.Contains" as defining the Types of Cards/Subsections in the Card Catalogue, i.e. Birthday, Graduation, Holiday etc. Finally the "InnerList.Contains", the Arraylist, contains all the cards within the subsection within the card catalogue. The InnerList defines the granular level. You will be able to access the entire Card Catalogue or the catalogue by sections or a single card.

Hope this helps.

Disclaimer: The above comments are solely the opinion of one person and not to be construed as a directive or an incentive to commit fraudulent acts.
  #3 (permalink)  
Old December 12th, 2007, 07:50 AM
Registered User
Join Date: Dec 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

Sorry but this isn't making things any clearer. Do you mean that the List and the InnerList property both contain different values? The way I understand it is that both properties contain an identical list of references to some Card objects.
So what is practically the difference between adding or removing stuff to the List and InnerList property and will InnerList.Contains(cardref) and List.Contains(cardref) not always return the same value?

Thanks in advance.

Similar Threads
Thread Thread Starter Forum Replies Last Post
multi-column list box values moved to 2nd list box sbmvr Access VBA 1 May 14th, 2007 01:58 PM
Populating master table with list from list table sburgess Access 7 September 1st, 2006 06:03 AM
fill dropdown list with items when parent list isaac_cm Pro PHP 1 July 10th, 2006 05:41 AM
List tablesname from database & list databasename ittorget MySQL 3 September 10th, 2005 03:06 AM
creat a list and sub list helmekki Excel VBA 0 May 23rd, 2004 02:32 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.