For fun I'm making a generic implementation of the
Boyer Moore Algorithm which can search any random access list for a given sublist.
I'm having trouble with the abstraction of a MatchResult. A MatchResult can either be a Match or a Failure, but I'd like a Failure to store additional information about the what index and element caused the failure.
Here's the solution I came up with but I am having doubts about its Javaishness (OK, so I made that
word up).
Particularly, I think I may just be overlooking a more common solution or refactoring trick in favor of this bit of strangeness.
[ July 28, 2007: Message edited by: Garrett Rowe ]