I want to have objects that define partial dates / times similar to the entries in Unix crontabs, i. e. "every first day in any month" etc.
These objects are going to be compared to Calendar objects to see if they match.
I was about to write my own "TimePattern" class but it would have to contain a lot of logic like checking if the field values were inside legal bounds (hour between 0 and 23 etc) that I felt would be inside classes like Calendar anyway.
So, now I'm just using a (nonlenient) Calendar object with some fields unset and I want to compare them with fully set Calendar objects that represent a fixed point in time. Should I
- write my own method that goes through the relevant fields and checks for "equal or unset"
- extend a (Gregorian)Calendar class to contain a "matchWith" method
- use some comparison mechanism that's already there (in the Calendar class), but that I've overlooked so far