aboutsummaryrefslogtreecommitdiff
path: root/java/com/xagasoft/gats/GatsList.java
blob: 35b2a4c7484c1371121fdccb813d7a2d973d7a6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
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<GatsObject>
{
	private LinkedList<GatsObject> lValue = new LinkedList<GatsObject>();

	public GatsList()
	{
	}

	public GatsList( Collection<? extends GatsObject> c )
	{
		lValue = new LinkedList<GatsObject>( 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<? extends GatsObject> arg0 )
	{
		return lValue.addAll( arg0 );
	}

	public boolean addAll( int arg0, Collection<? extends GatsObject> 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<GatsObject> iterator()
	{
		return lValue.iterator();
	}

	public int lastIndexOf( Object arg0 )
	{
		return lValue.lastIndexOf( arg0 );
	}

	public ListIterator<GatsObject> listIterator()
	{
		return lValue.listIterator();
	}

	public ListIterator<GatsObject> 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<GatsObject> subList( int arg0, int arg1 )
	{
		return new GatsList( lValue.subList( arg0, arg1 ) );
	}

	public Object[] toArray()
	{
		return lValue.toArray();
	}

	public <T> T[] toArray( T[] arg0 )
	{
		return lValue.toArray( arg0 );
	}
};