package com.xagasoft.gats; import java.io.InputStream; import java.io.OutputStream; import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.LinkedList; import java.util.ListIterator; public class GatsList extends GatsObject implements List { private LinkedList lValue = new LinkedList(); public GatsList() { } public GatsList( Collection c ) { lValue = new LinkedList( c ); } public int getType() { return GatsObject.LIST; } public void read( InputStream is, char cType ) throws java.io.IOException { for(;;) { GatsObject obj = GatsObject.read( is ); if( obj == null ) break; add( obj ); } } public void write( OutputStream os ) throws java.io.IOException { os.write( (int)'l' ); for( GatsObject obj : this ) { obj.write( os ); } os.write( (int)'e' ); } public String toString() { return lValue.toString(); } public boolean add( GatsObject arg0 ) { return lValue.add( arg0 ); } public void add( int arg0, GatsObject arg1 ) { lValue.add( arg0, arg1 ); } public boolean addAll( Collection arg0 ) { return lValue.addAll( arg0 ); } public boolean addAll( int arg0, Collection arg1 ) { return lValue.addAll( arg0, arg1 ); } public void clear() { lValue.clear(); } public boolean contains( Object arg0 ) { return lValue.contains( arg0 ); } public boolean containsAll( Collection arg0 ) { return lValue.containsAll( arg0 ); } public GatsObject get( int arg0 ) { return lValue.get( arg0 ); } public int indexOf( Object arg0 ) { return lValue.indexOf( arg0 ); } public boolean isEmpty() { return lValue.isEmpty(); } public Iterator iterator() { return lValue.iterator(); } public int lastIndexOf( Object arg0 ) { return lValue.lastIndexOf( arg0 ); } public ListIterator listIterator() { return lValue.listIterator(); } public ListIterator listIterator( int arg0 ) { return lValue.listIterator( arg0 ); } public GatsObject remove( int arg0 ) { return lValue.remove( arg0 ); } public boolean remove( Object arg0 ) { return lValue.remove( arg0 ); } public boolean removeAll( Collection arg0 ) { return lValue.removeAll( arg0 ); } public boolean retainAll( Collection arg0 ) { return lValue.retainAll( arg0 ); } public GatsObject set( int arg0, GatsObject arg1 ) { return lValue.set( arg0, arg1 ); } public int size() { return lValue.size(); } public List subList( int arg0, int arg1 ) { return new GatsList( lValue.subList( arg0, arg1 ) ); } public Object[] toArray() { return lValue.toArray(); } public T[] toArray( T[] arg0 ) { return lValue.toArray( arg0 ); } };