Re: Field.java -> STORED, NOT_STORED, etc...

2004-07-12 Thread Kevin A. Burton
Doug Cutting wrote: It would be best to get the compiler to check the order. If we change this, why not use type-safe enumerations: http://www.javapractices.com/Topic1.cjp The calls would look like: new Field("name", "value", Stored.YES, Indexed.NO, Tokenized.YES); Stored could be implemented as th

Re: Field.java -> STORED, NOT_STORED, etc...

2004-07-12 Thread Gerard Sychay
I think this is a great idea. I've never used the Field.Keyword and Field.Text type methods because I can never remember what their 3-boolean-argument equivalents are. I always stick the constructor format in a comment somewhere and use it. >>> Doug Cutting <[EMAIL PROTECTED]> 07/11/04 12:03PM >>

RE: Field.java -> STORED, NOT_STORED, etc...

2004-07-12 Thread wallen
I have 2 suggestions: 1) use Eclipse, or an IDE that references the javadoc with mouseovers 2) if you are going to create constants, consider using a bitflag. Then your constants can have a 2's value, ie STORED = 1 INDEXED = 2 TOKENIZED = 4 Then you can have the constructor look like: new Fiel

Re: Field.java -> STORED, NOT_STORED, etc...

2004-07-11 Thread Tatu Saloranta
On Sunday 11 July 2004 10:03, Doug Cutting wrote: > Doug Cutting wrote: > > The calls would look like: > > > > new Field("name", "value", Stored.YES, Indexed.NO, Tokenized.YES); > > . > Actually, while we're at it, Indexed and Tokenized are confounded. A > single entry would be better, something l

Re: Field.java -> STORED, NOT_STORED, etc...

2004-07-11 Thread Doug Cutting
Doug Cutting wrote: The calls would look like: new Field("name", "value", Stored.YES, Indexed.NO, Tokenized.YES); Stored could be implemented as the nested class: public final class Stored { private Stored() {} public static final Stored YES = new Stored(); public static final Stored NO = new

Re: Field.java -> STORED, NOT_STORED, etc...

2004-07-11 Thread Doug Cutting
Kevin A. Burton wrote: So I added a few constants to my class: new Field( "name", "value", NOT_STORED, INDEXED, NOT_TOKENIZED ); which IMO is a lot easier to maintain. Why not add these constants to Field.java: public static final boolean STORED = true; public static final boolean NOT_STORED