Public class scheveaset {@field private object elementdata []; private int elementcount; private int at capacityincrement
Public cerors merror; // error message
// @Constructor public SchemaSet (int initialCapacity, int capacityIncrement) {if (initialCapacity <0) {// @@ error handling CError tError = new CError (); tError.moduleName = "SchemaSet"; tError.functionName = "SchemaSet" ; tError.errorMessage = "Illegal Capacity:" initialCapacity; this.mErrors .addOneError (tError);} this.elementData = new Object [initialCapacity]; this.capacityIncrement = capacityIncrement; this.elementCount = 0;
Merrors = new cerars ();
Public Schemaset (INT INITIALCAPACITY) {this (Initialcapacity, 0);
Public Schemaset () {this (10);
// @Method public boolean add (Schema aSchema) {if (aSchema == null) return false; ensureCapacityHelper (elementCount 1); elementData [elementCount] = aSchema; elementCount ; return true;}
Public Boolean Add (SCHEMASET ASET) {if (ASET == Null) Return False; int N = ASET.SIZE (); ENSURECAPACITYHELPER (ELEMENTCANT N); for (int i = 0; i Public Boolean Remove (Schema Aschema) {IF (Aschema == Null) Return False; for (INT I = 0; I Public void clear () {for (int i = 0; i Public Object getobj (int index) {if (INDEX> ElementCount) {@@ error handling CERROR TERROR = New Cerror (); terror.ModulenAme = "scheMaset"; Terror.FunctionName = "get"; terror.errorMessage = " Index Out of Bounds! "; This.merrors .addoneError (TEERROR);} Return ElementData [INDEX - 1]; Public Boolean Set (INDEX, SCHEMA Aschema) {if (Index> ElementCount) {@@ 错 处理 处理 c CERROR TERROR = New Cerror (); Terror.ModulenAMe = "Schemaset"; terror.functionName = "set"; Terror. ErrorMessage = "INDEX OUT OF Bounds!"; this.merrors .addoneError (TEERROR); Return false;} ElementData [index - 1] = aschema; returnography;} public boolean set (Schemaset ASET) {this.clear (); return this.add (ASET); Public int size () {return elementcount;} private void ensureCapacityHelper (int minCapacity) {int oldCapacity = elementData.length; if (minCapacity> oldCapacity) {Object oldData [] = elementData; int newCapacity = (capacityIncrement> 0) (oldCapacity capacityIncrement):? (oldCapacity * 2); IF (newcapacity / * * * / Package com.vschema; Import com.schema.lascriptionschema; import com.utility.schemaset; import com.utility.sysconst; Public class lascriptionSet Extends Schemaset {@Method Public Boolean Add (Laascriptionschema Aschema) {Return Super.Add (Aschema); Public Boolean Add (LaascriptionSet ASET) {Return Super.Add (ASET); Public Boolean Remove (lascriptionschema aschema) {return super.remove (aschema);} Public lascriptionschema get (int index) {lascriptionschema tschema = (lascriptionschema) super.getobj (index); return tschema;} Public Boolean Set (int index, lascriptionschema aschema) {return super.set (index, aschema); Public Boolean Set (LaascriptionSet ASET) {Return Super.Set (ASET);