From: Henri Yandell <[EMAIL PROTECTED]> > > > What is the point of the wrap method? > > > > > > Can I do: > > > List list = TypedList(new LinkedList()); ???? > > > > Yes, but the syntax is > > List list = TypedList.wrap(new LinkedList()); > > However, as noted above, the iterator is based on AbstractList - not much > > use for LinkedList. I'll see if I can fix this ;-) > > Little unsure what you're saying. Sounds like the only difference is that > you use a factory method where I tend to use a constructor. I love doing: > > List list = new LimitedList( new SortedList( new LinkedList() ) );
The specification for List (and other collections) 'requests' that all implementations should have a constructor that takes in a Collection object (to do an addAll). I was respecting this by not confusing the constructors. Also, I may need constructors to do the simple instanceof check, thus named statics work more easily. > I don't recall how to use reflection on static methods, only problem I > could think of with 'wrap'. Simply specify null, where you would specify the object in the invoke. Stephen > > Hen > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>