From: Brian S O'N. <bro...@ea...> - 2004-06-26 19:39:39
|
Its just that I feel creating a new array of fields on every new TimeOfDay instance is a waste of time and memory. In practice, the array will always contain the exact same elements. A reference to a cached instance helps slightly, but that is a bit complicated. Stephen Colebourne wrote: >>One thing that concerns me with AbstractPartialInstant is that it >>contains an array of fields, which I don't think is needed, except for a >>generic partial instant. For TimeOfDay, it can take on a bit more >>responsibility in mapping fields to indexes and indexes to fields. I'm >>trying out some changes. >> >> >I tried this approach, but found it didn't save any code. The abstract >superclass is very functional now, and makes creating new subclasses a snap. >I'm not that worried about the array of fields. I was going to work on >adding DayOfWeek tonight, so the abstract class will look less lonely. > > > |