lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gregor Heinrich <gre...@arbylon.net>
Subject contrib/fast-vector-highlighter classes: package-private fields
Date Fri, 19 Nov 2010 06:20:32 GMT
Dear list -- I was wondering why in the fast-vector-highlighter some fields are 
set package-private and at the same time don't have accessor methods. Are 
subclasses supposed to be put in the same package then?

Example: Subclassing ScoreOrderFragmentsBuilder with a new method like this:

@Override
public List<WeightedFragInfo> getWeightedFragInfoList(List<WeightedFragInfo> src)
{
     Collections.sort(src, new ScoreComparator());
     super(src);
     for (int i = 0; i < src.size(); i++) {
         // ??? every field package private in FieldFragList.WeightedFragInfo
         WeightedFragInfo u = src.get(i);
         u.startOffset -= 20;
         u.endOffset += 20;
         src.set(i, u);
     }
     return src;
}

I'd vote for protected access for all those fields in the 11 classes where this 
issue applies. IMO, the package is worth having this extra flexibility. Then it 
really deserves its attribute "fast" also in terms of developing with it.

Best wishes

gregor





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


Mime
View raw message