Ejemplo n.º 1
0
 public synchronized boolean equals(java.lang.Object obj) {
   if (!(obj instanceof Weight)) return false;
   Weight other = (Weight) obj;
   if (obj == null) return false;
   if (this == obj) return true;
   if (__equalsCalc != null) {
     return (__equalsCalc == obj);
   }
   __equalsCalc = obj;
   boolean _equals;
   _equals =
       true
           && ((this.units == null && other.getUnits() == null)
               || (this.units != null && this.units.equals(other.getUnits())))
           && ((this.value == null && other.getValue() == null)
               || (this.value != null && this.value.equals(other.getValue())));
   __equalsCalc = null;
   return _equals;
 }
 public ConstantScorer(Similarity similarity, IndexReader reader, Weight w) throws IOException {
   super(similarity);
   this.reader = reader;
   theScore = w.getValue();
   DocIdSet docIdSet = filter.getDocIdSet(reader);
   if (docIdSet == null) {
     _innerIter = DocIdSet.EMPTY_DOCIDSET.iterator();
   } else {
     DocIdSetIterator iter = docIdSet.iterator();
     if (iter == null) {
       _innerIter = DocIdSet.EMPTY_DOCIDSET.iterator();
     } else {
       _innerIter = iter;
     }
   }
 }
 public ConstantScorer(Similarity similarity, DocIdSetIterator docIdSetIterator, Weight w)
     throws IOException {
   super(similarity, w);
   theScore = w.getValue();
   this.docIdSetIterator = docIdSetIterator;
 }
Ejemplo n.º 4
0
 public ConstantScorer(Similarity similarity, IndexReader reader, Weight w) throws IOException {
   super(similarity);
   theScore = w.getValue();
   docIdSetIterator = filter.getDocIdSet(reader).iterator();
 }
 @Override
 public float getValue() {
   return w.getValue();
 }