lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tatu Saloranta <t...@hypermall.net>
Subject Re: Suggestion for Token.java
Date Wed, 14 Apr 2004 02:38:21 GMT
On Tuesday 13 April 2004 15:31, Holger Klawitter wrote:
> Hi Erik,
>
> > What is wrong with simply creating a new token that replaces an
> > incoming one for synonyms?
> > I'm just playing devil's advocate here.... since you can already get
> > the termText() through the public _method_.
>
> Well, you're right; I forgot about cloning, but ... (Lords advocate :-)
>
> 1.) Cloning implies the need to change filters whenever the fields in Token
> change.

On the other hand, one needs to be sure that no other code assumes Tokens are 
immutable. For example, if they weren't one couldn't reliably use tokens in 
Sets or Maps (not sure if it's useful to do that, just an example).

I guess it's really matter of whether tokens were designed as immutable (which 
often makes sense for similar objects), or if they just happen to be, due to 
lack of modifier method(s).

-+ Tatu +-


---------------------------------------------------------------------
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