Sounds reasonable, we sure be sure to doc that the list is not mutable too.

--jason


On Thursday, August 14, 2003, at 07:28 PM, James Strachan wrote:


On Thursday, August 14, 2003, at 01:25 pm, Jason Dillon wrote:

If the list should not be mutable, then it makes more sense to return an Iterator (or ListIterator as mentioned), else someone could violate the contract and insert random fluff into the list instead of using the add/remove methods.

If its gonna be immutable then we could just return a Collections.unmodifiableList(list); Then folks can use the full List API (bar modifications).


Also if we ever decide to allow a mutable List later on its not a change to the API :)

James
-------
http://radio.weblogs.com/0112098/




Reply via email to