lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: Why is Field.java final?
Date Sun, 11 Jul 2004 15:20:24 GMT
Kevin A. Burton wrote:
> I was going to create a new IDField class which just calls super( name, 
> value, false, true, false) but noticed I was prevented because 
> Field.java is final?

You don't need to subclass to do this, just a static method somewhere.

> Why is this?  I can't see any harm in making it non-final...

Field and Document are not designed to be extensible.  They are 
persisted in such a way that added methods are not available when the 
field is restored.  In other words, when a field is read, it always 
constructs an instance of Field, not a subclass.

Doug

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message