diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-04-21 18:37:12 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-04-21 18:37:12 +0000 |
commit | dcd3547448a632a81d83cce87165ecad057c7550 (patch) | |
tree | 62b65d723a722b772b903915fadcdc8960100dd7 /java/com/xagasoft | |
parent | e3ec42a38b8590a189454ed879badc72d0fc015e (diff) | |
download | libgats-dcd3547448a632a81d83cce87165ecad057c7550.tar.gz libgats-dcd3547448a632a81d83cce87165ecad057c7550.tar.bz2 libgats-dcd3547448a632a81d83cce87165ecad057c7550.tar.xz libgats-dcd3547448a632a81d83cce87165ecad057c7550.zip |
List may actually work!
Diffstat (limited to '')
-rw-r--r-- | java/com/xagasoft/gats/GatsList.java | 204 |
1 files changed, 87 insertions, 117 deletions
diff --git a/java/com/xagasoft/gats/GatsList.java b/java/com/xagasoft/gats/GatsList.java index 304549e..7f04db6 100644 --- a/java/com/xagasoft/gats/GatsList.java +++ b/java/com/xagasoft/gats/GatsList.java | |||
@@ -17,180 +17,150 @@ public class GatsList extends GatsObject implements List<GatsObject> | |||
17 | { | 17 | { |
18 | } | 18 | } |
19 | 19 | ||
20 | 20 | public GatsList( Collection<? extends GatsObject> c ) | |
21 | { | ||
22 | lValue = new LinkedList<GatsObject>( c ); | ||
23 | } | ||
21 | 24 | ||
22 | public int getType() | 25 | public int getType() |
23 | { | 26 | { |
24 | return GatsObject.LIST; | 27 | return GatsObject.LIST; |
25 | } | 28 | } |
26 | 29 | ||
27 | public void read( InputStream is, char cType ) | 30 | public void read( InputStream is, char cType ) throws java.io.IOException |
28 | { | 31 | { |
32 | for(;;) | ||
33 | { | ||
34 | GatsObject obj = GatsObject.read( is ); | ||
35 | if( obj == null ) | ||
36 | break; | ||
37 | add( obj ); | ||
38 | } | ||
29 | } | 39 | } |
30 | 40 | ||
31 | public void write( OutputStream os ) throws java.io.IOException | 41 | public void write( OutputStream os ) throws java.io.IOException |
32 | { | 42 | { |
43 | os.write( (int)'l' ); | ||
44 | for( GatsObject obj : this ) | ||
45 | { | ||
46 | obj.write( os ); | ||
47 | } | ||
48 | os.write( (int)'e' ); | ||
33 | } | 49 | } |
34 | 50 | ||
35 | 51 | public boolean add( GatsObject arg0 ) | |
36 | 52 | { | |
37 | public boolean add(GatsObject arg0) { | 53 | return lValue.add( arg0 ); |
38 | // TODO Auto-generated method stub | ||
39 | return false; | ||
40 | } | 54 | } |
41 | 55 | ||
42 | 56 | public void add( int arg0, GatsObject arg1 ) | |
43 | 57 | { | |
44 | public void add(int arg0, GatsObject arg1) { | 58 | lValue.add( arg0, arg1 ); |
45 | // TODO Auto-generated method stub | ||
46 | |||
47 | } | 59 | } |
48 | 60 | ||
49 | 61 | public boolean addAll( Collection<? extends GatsObject> arg0 ) | |
50 | 62 | { | |
51 | public boolean addAll(Collection<? extends GatsObject> arg0) { | 63 | return lValue.addAll( arg0 ); |
52 | // TODO Auto-generated method stub | ||
53 | return false; | ||
54 | } | 64 | } |
55 | 65 | ||
56 | 66 | public boolean addAll( int arg0, Collection<? extends GatsObject> arg1 ) | |
57 | 67 | { | |
58 | public boolean addAll(int arg0, Collection<? extends GatsObject> arg1) { | 68 | return lValue.addAll( arg0, arg1 ); |
59 | // TODO Auto-generated method stub | ||
60 | return false; | ||
61 | } | 69 | } |
62 | 70 | ||
63 | 71 | public void clear() | |
64 | 72 | { | |
65 | public void clear() { | 73 | lValue.clear(); |
66 | // TODO Auto-generated method stub | ||
67 | |||
68 | } | 74 | } |
69 | 75 | ||
70 | 76 | public boolean contains( Object arg0 ) | |
71 | 77 | { | |
72 | public boolean contains(Object arg0) { | 78 | return lValue.contains( arg0 ); |
73 | // TODO Auto-generated method stub | ||
74 | return false; | ||
75 | } | 79 | } |
76 | 80 | ||
77 | 81 | public boolean containsAll( Collection<?> arg0 ) | |
78 | 82 | { | |
79 | public boolean containsAll(Collection<?> arg0) { | 83 | return lValue.containsAll( arg0 ); |
80 | // TODO Auto-generated method stub | ||
81 | return false; | ||
82 | } | 84 | } |
83 | 85 | ||
84 | 86 | public GatsObject get( int arg0 ) | |
85 | 87 | { | |
86 | public GatsObject get(int arg0) { | 88 | return lValue.get( arg0 ); |
87 | // TODO Auto-generated method stub | ||
88 | return null; | ||
89 | } | 89 | } |
90 | 90 | ||
91 | 91 | public int indexOf( Object arg0 ) | |
92 | 92 | { | |
93 | public int indexOf(Object arg0) { | 93 | return lValue.indexOf( arg0 ); |
94 | // TODO Auto-generated method stub | ||
95 | return 0; | ||
96 | } | 94 | } |
97 | 95 | ||
98 | 96 | public boolean isEmpty() | |
99 | 97 | { | |
100 | public boolean isEmpty() { | 98 | return lValue.isEmpty(); |
101 | // TODO Auto-generated method stub | ||
102 | return false; | ||
103 | } | 99 | } |
104 | 100 | ||
105 | 101 | public Iterator<GatsObject> iterator() | |
106 | 102 | { | |
107 | public Iterator<GatsObject> iterator() { | 103 | return lValue.iterator(); |
108 | // TODO Auto-generated method stub | ||
109 | return null; | ||
110 | } | 104 | } |
111 | 105 | ||
112 | 106 | public int lastIndexOf( Object arg0 ) | |
113 | 107 | { | |
114 | public int lastIndexOf(Object arg0) { | 108 | return lValue.lastIndexOf( arg0 ); |
115 | // TODO Auto-generated method stub | ||
116 | return 0; | ||
117 | } | 109 | } |
118 | 110 | ||
119 | 111 | public ListIterator<GatsObject> listIterator() | |
120 | 112 | { | |
121 | public ListIterator<GatsObject> listIterator() { | 113 | return lValue.listIterator(); |
122 | // TODO Auto-generated method stub | ||
123 | return null; | ||
124 | } | 114 | } |
125 | 115 | ||
126 | 116 | public ListIterator<GatsObject> listIterator( int arg0 ) | |
127 | 117 | { | |
128 | public ListIterator<GatsObject> listIterator(int arg0) { | 118 | return lValue.listIterator( arg0 ); |
129 | // TODO Auto-generated method stub | ||
130 | return null; | ||
131 | } | 119 | } |
132 | 120 | ||
133 | 121 | public GatsObject remove( int arg0 ) | |
134 | 122 | { | |
135 | public GatsObject remove(int arg0) { | 123 | return lValue.remove( arg0 ); |
136 | // TODO Auto-generated method stub | ||
137 | return null; | ||
138 | } | 124 | } |
139 | 125 | ||
140 | 126 | public boolean remove( Object arg0 ) | |
141 | 127 | { | |
142 | public boolean remove(Object arg0) { | 128 | return lValue.remove( arg0 ); |
143 | // TODO Auto-generated method stub | ||
144 | return false; | ||
145 | } | 129 | } |
146 | 130 | ||
147 | 131 | public boolean removeAll( Collection<?> arg0 ) | |
148 | 132 | { | |
149 | public boolean removeAll(Collection<?> arg0) { | 133 | return lValue.removeAll( arg0 ); |
150 | // TODO Auto-generated method stub | ||
151 | return false; | ||
152 | } | 134 | } |
153 | 135 | ||
154 | 136 | public boolean retainAll( Collection<?> arg0 ) | |
155 | 137 | { | |
156 | public boolean retainAll(Collection<?> arg0) { | 138 | return lValue.retainAll( arg0 ); |
157 | // TODO Auto-generated method stub | ||
158 | return false; | ||
159 | } | 139 | } |
160 | 140 | ||
161 | 141 | public GatsObject set( int arg0, GatsObject arg1 ) | |
162 | 142 | { | |
163 | public GatsObject set(int arg0, GatsObject arg1) { | 143 | return lValue.set( arg0, arg1 ); |
164 | // TODO Auto-generated method stub | ||
165 | return null; | ||
166 | } | 144 | } |
167 | 145 | ||
168 | 146 | public int size() | |
169 | 147 | { | |
170 | public int size() { | 148 | return lValue.size(); |
171 | // TODO Auto-generated method stub | ||
172 | return 0; | ||
173 | } | 149 | } |
174 | 150 | ||
175 | 151 | public List<GatsObject> subList( int arg0, int arg1 ) | |
176 | 152 | { | |
177 | public List<GatsObject> subList(int arg0, int arg1) { | 153 | return new GatsList( lValue.subList( arg0, arg1 ) ); |
178 | // TODO Auto-generated method stub | ||
179 | return null; | ||
180 | } | 154 | } |
181 | 155 | ||
182 | 156 | public Object[] toArray() | |
183 | 157 | { | |
184 | public Object[] toArray() { | 158 | return lValue.toArray(); |
185 | // TODO Auto-generated method stub | ||
186 | return null; | ||
187 | } | 159 | } |
188 | 160 | ||
189 | 161 | public <T> T[] toArray( T[] arg0 ) | |
190 | 162 | { | |
191 | public <T> T[] toArray(T[] arg0) { | 163 | return lValue.toArray( arg0 ); |
192 | // TODO Auto-generated method stub | ||
193 | return null; | ||
194 | } | 164 | } |
195 | }; | 165 | }; |
196 | 166 | ||