Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 2005 > BOOK: Beginning Visual C# 2005
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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?

Reply With Quote
  #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
Default

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.
Reply With Quote
  #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
Default

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.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 08:51 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.