MESSAGE
DATE | 2016-02-15 |
FROM | Ruben Safir
|
SUBJECT | Subject: [Learn] why do I need this
|
From learn-bounces-at-nylxs.com Mon Feb 22 10:58:23 2016 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: from www.mrbrklyn.com (www.mrbrklyn.com [96.57.23.82]) by mrbrklyn.com (Postfix) with ESMTP id 0F24C163D9B; Mon, 22 Feb 2016 10:58:23 -0500 (EST) X-Original-To: learn-at-nylxs.com Delivered-To: learn-at-nylxs.com Received: from [10.0.0.19] (stat13.mrbrklyn.com [10.0.0.19]) by mrbrklyn.com (Postfix) with ESMTP id 1832416249E; Mon, 15 Feb 2016 02:23:16 -0500 (EST) To: Christopher League From: Ruben Safir Message-ID: <56C17CE4.3040904-at-mrbrklyn.com> Date: Mon, 15 Feb 2016 02:23:16 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 22 Feb 2016 10:35:27 -0500 Subject: [Learn] why do I need this X-BeenThere: learn-at-nylxs.com X-Mailman-Version: 2.1.17 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: learn-bounces-at-nylxs.com Sender: "Learn"
package pico;
import java.util.ArrayList;
public class TokenListSource implements TokenSource { ArrayList list; int nextIndex = 0;
public TokenListSource(ArrayList list) { this.list = list; }
-at-Override public Token nextToken() { if(nextIndex < list.size()) { return list.get(nextIndex++); } else { return new Token(Token.Type.EOF); } } }
If all I'm doing is creating an interface that walks through a linked list? then why do I need all this useless complexity. Java already has a library that does that.
We are not creating the list. We are not abstracting the list as a new data type or implementing it within a new data type, Java has NO templates, or we are not using any templates here, so we are not making this an usable interface that serves multiple types... We are adding NOTHING with this other than to confuse the student and creating useless overhead.
If I am wrong, please explain.
Ruben
-- So many immigrant groups have swept through our town that Brooklyn, like Atlantis, reaches mythological proportions in the mind of the world - RI Safir 1998 http://www.mrbrklyn.com
DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002 http://www.nylxs.com - Leadership Development in Free Software http://www2.mrbrklyn.com/resources - Unpublished Archive http://www.coinhangout.com - coins! http://www.brooklyn-living.com
Being so tracked is for FARM ANIMALS and and extermination camps, but incompatible with living as a free human being. -RI Safir 2013 _______________________________________________ Learn mailing list Learn-at-nylxs.com http://lists.mrbrklyn.com/mailman/listinfo/learn
|
|