lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Babak Farhang <>
Subject Redundant fields Token class?
Date Fri, 13 Nov 2009 22:50:17 GMT
I'm writing a TokenFilter and am confused about why class Token has
both an *endOffset* and a *termLength* field.  It would appear that
the following invariant should always hold for a Token instance:

    termLength() == endOffset() - startOffset()

If so, then

1) Why 2 fields, instead of 1?
2) Why isn't the invariant enforced in the class?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message