01: package simpleorm.core;
02:
03: /**
04: * JAVA implementation of SArrayList.
05: */
06:
07: public class SArrayList extends java.util.ArrayList {
08: public SArrayList() {
09: super ();
10: }
11:
12: public SArrayList(int aSize) {
13: super (aSize);
14: }
15:
16: public SArrayList(java.util.ArrayList anArrayList) {
17: super (anArrayList);
18: }
19: }
20:
21: /**
22: * J# implementation of SArrayList.
23: */
24: /*
25:
26: import System.Collections.ArrayList;
27:
28: public class SArrayList extends java.util.AbstractList {
29:
30: private ArrayList m_ArrayList = null;
31:
32: public SArrayList() {
33: this(0);
34: }
35: public SArrayList(int aSize) {
36: this.m_ArrayList = new ArrayList(aSize);
37: }
38: public SArrayList(System.Collections.ArrayList anArrayList) {
39: this.m_ArrayList = anArrayList;
40: }
41: public Object get(int anIndex) {
42: return this.m_ArrayList.get_Item(anIndex);
43: }
44: public void clear() {
45: this.m_ArrayList.Clear();
46: }
47: public boolean add(Object anObject) {
48: return this.m_ArrayList.Add(anObject) >= 0;
49: }
50: public Object set(int anIndex,Object aValue) {
51: this.m_ArrayList.set_Item(anIndex, aValue);
52: return aValue;
53: }
54: public int size() {
55: return this.m_ArrayList.get_Count();
56: }
57: public java.util.Iterator iterator() {
58: return new SIterator(((System.Collections.ArrayList)this.m_ArrayList.Clone()).GetEnumerator());
59: }
60: public Object clone() {
61: return new SArrayList((ArrayList) this.m_ArrayList.Clone());
62: }
63: public class SIterator implements java.util.Iterator {
64: private System.Collections.IEnumerator m_IEnumerator= null;
65: public SIterator(System.Collections.IEnumerator anEnumerator) {
66: this.m_IEnumerator = anEnumerator;
67: }
68: public boolean hasNext() {
69: return this.m_IEnumerator.MoveNext();
70:
71: }
72: public Object next() {
73: return this.m_IEnumerator.get_Current();
74: }
75: public void remove() {
76: System.Console.WriteLine("WArrayList.WIterator.remove not implemented yet.");
77: }
78: }
79: }
80: */
|