DynArrayImplpublic class DynArrayImpl extends DynAnyCollectionImpl implements DynArray
Methods Summary |
---|
protected void | checkValue(java.lang.Object[] value)
if (value == null || value.length != getBound()) {
throw new InvalidValue();
}
| protected boolean | initializeComponentsFromAny()
// This typeCode is of kind tk_array.
TypeCode typeCode = any.type();
int length = getBound();
TypeCode contentType = getContentType();
InputStream input;
try {
input = any.create_input_stream();
} catch (BAD_OPERATION e) {
return false;
}
components = new DynAny[length];
anys = new Any[length];
for (int i=0; i<length; i++) {
// _REVISIT_ Could use read_xxx_array() methods on InputStream for efficiency
// but only for primitive types
anys[i] = DynAnyUtil.extractAnyFromStream(contentType, input, orb);
try {
// Creates the appropriate subtype without copying the Any
components[i] = DynAnyUtil.createMostDerivedDynAny(anys[i], orb, false);
} catch (InconsistentTypeCode itc) { // impossible
}
}
return true;
| protected boolean | initializeComponentsFromTypeCode()
// This typeCode is of kind tk_array.
TypeCode typeCode = any.type();
int length = getBound();
TypeCode contentType = getContentType();
components = new DynAny[length];
anys = new Any[length];
for (int i=0; i<length; i++) {
createDefaultComponentAt(i, contentType);
}
return true;
|
|