From e3efaf2a9ad82deb1644ccab8c1469719a0c5b65 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 16 Jan 2012 02:31:34 +0000 Subject: Lots of documentation, an example program, and also some visibility cleanup. --- java/com/xagasoft/gats/GatsList.java | 78 +++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 36 deletions(-) (limited to 'java/com/xagasoft/gats/GatsList.java') diff --git a/java/com/xagasoft/gats/GatsList.java b/java/com/xagasoft/gats/GatsList.java index 35b2a4c..27c4c11 100644 --- a/java/com/xagasoft/gats/GatsList.java +++ b/java/com/xagasoft/gats/GatsList.java @@ -10,6 +10,12 @@ import java.util.List; import java.util.LinkedList; import java.util.ListIterator; +/** + * Represents an ordered list of Gats objects. The order of the objects in the + * list is always preserved, unlike the values in a + * com.xagasoft.gats.GatsDictionary. This class implements all java List + * interface features, and is implemented internally as a LinkedList. + */ public class GatsList extends GatsObject implements List { private LinkedList lValue = new LinkedList(); @@ -28,7 +34,7 @@ public class GatsList extends GatsObject implements List return GatsObject.LIST; } - public void read( InputStream is, char cType ) throws java.io.IOException + void read( InputStream is, char cType ) throws java.io.IOException { for(;;) { @@ -39,7 +45,7 @@ public class GatsList extends GatsObject implements List } } - public void write( OutputStream os ) throws java.io.IOException + void write( OutputStream os ) throws java.io.IOException { os.write( (int)'l' ); for( GatsObject obj : this ) @@ -54,24 +60,24 @@ public class GatsList extends GatsObject implements List return lValue.toString(); } - public boolean add( GatsObject arg0 ) + public boolean add( GatsObject value ) { - return lValue.add( arg0 ); + return lValue.add( value ); } - public void add( int arg0, GatsObject arg1 ) + public void add( int iPos, GatsObject value ) { - lValue.add( arg0, arg1 ); + lValue.add( iPos, value ); } - public boolean addAll( Collection arg0 ) + public boolean addAll( Collection src ) { - return lValue.addAll( arg0 ); + return lValue.addAll( src ); } - public boolean addAll( int arg0, Collection arg1 ) + public boolean addAll( int iPos, Collection src ) { - return lValue.addAll( arg0, arg1 ); + return lValue.addAll( iPos, src ); } public void clear() @@ -79,24 +85,24 @@ public class GatsList extends GatsObject implements List lValue.clear(); } - public boolean contains( Object arg0 ) + public boolean contains( Object value ) { - return lValue.contains( arg0 ); + return lValue.contains( value ); } - public boolean containsAll( Collection arg0 ) + public boolean containsAll( Collection src ) { - return lValue.containsAll( arg0 ); + return lValue.containsAll( src ); } - public GatsObject get( int arg0 ) + public GatsObject get( int iPos ) { - return lValue.get( arg0 ); + return lValue.get( iPos ); } - public int indexOf( Object arg0 ) + public int indexOf( Object value ) { - return lValue.indexOf( arg0 ); + return lValue.indexOf( value ); } public boolean isEmpty() @@ -109,9 +115,9 @@ public class GatsList extends GatsObject implements List return lValue.iterator(); } - public int lastIndexOf( Object arg0 ) + public int lastIndexOf( Object value ) { - return lValue.lastIndexOf( arg0 ); + return lValue.lastIndexOf( value ); } public ListIterator listIterator() @@ -119,34 +125,34 @@ public class GatsList extends GatsObject implements List return lValue.listIterator(); } - public ListIterator listIterator( int arg0 ) + public ListIterator listIterator( int iPos ) { - return lValue.listIterator( arg0 ); + return lValue.listIterator( iPos ); } - public GatsObject remove( int arg0 ) + public GatsObject remove( int iPos ) { - return lValue.remove( arg0 ); + return lValue.remove( iPos ); } - public boolean remove( Object arg0 ) + public boolean remove( Object value ) { - return lValue.remove( arg0 ); + return lValue.remove( value ); } - public boolean removeAll( Collection arg0 ) + public boolean removeAll( Collection src ) { - return lValue.removeAll( arg0 ); + return lValue.removeAll( src ); } - public boolean retainAll( Collection arg0 ) + public boolean retainAll( Collection src ) { - return lValue.retainAll( arg0 ); + return lValue.retainAll( src ); } - public GatsObject set( int arg0, GatsObject arg1 ) + public GatsObject set( int iPos, GatsObject src ) { - return lValue.set( arg0, arg1 ); + return lValue.set( iPos, src ); } public int size() @@ -154,9 +160,9 @@ public class GatsList extends GatsObject implements List return lValue.size(); } - public List subList( int arg0, int arg1 ) + public List subList( int iBegin, int iEnd ) { - return new GatsList( lValue.subList( arg0, arg1 ) ); + return new GatsList( lValue.subList( iBegin, iEnd ) ); } public Object[] toArray() @@ -164,9 +170,9 @@ public class GatsList extends GatsObject implements List return lValue.toArray(); } - public T[] toArray( T[] arg0 ) + public T[] toArray( T[] src ) { - return lValue.toArray( arg0 ); + return lValue.toArray( src ); } }; -- cgit v1.2.3