Thilo Goetz wrote:
Adam Lally wrote:
On 7/12/07, Thilo Goetz <[EMAIL PROTECTED]> wrote:
What's unclear about this method?

You can get a Type object that represents a typed-array, but there is
no way to create an instance of such an array.  What good is it then
to get the Type object?

-Adam

:-) So the whole concept is useless.  Remind me why we
have parametric arrays?
Two uses currently: One is XMI serialization - it makes use of this info for a much more compact serialized form. The second: JCasGen uses this info when generating cover functions to do compile-time checking of arguments, and returning the right class of result. So, if you have an FSArray of Foo objects, defined as the type:feature MyType:FooArray, the setters and getters for elements of this type, anInstanceOfMyType.setFooArray(index, value) has the method parameter type for "value" be of class Foo, rather than of class Top, and anInstanceOfMyType.getFooArray(index) returns an instance of Foo class.

Perhaps there are other uses, but those come to mind right now. -Marshall
--Thilo




Reply via email to