lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject cvs commit: jakarta-lucene/src/java/org/apache/lucene/search PhrasePrefixQuery.java
Date Fri, 17 Sep 2004 19:24:14 GMT
dnaber      2004/09/17 12:24:14

  Modified:    src/java/org/apache/lucene/search PhrasePrefixQuery.java
  Log:
  use the same amount of whitespace everywhere, no functional change
  
  Revision  Changes    Path
  1.17      +21 -21    jakarta-lucene/src/java/org/apache/lucene/search/PhrasePrefixQuery.java
  
  Index: PhrasePrefixQuery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/PhrasePrefixQuery.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- PhrasePrefixQuery.java	17 Sep 2004 19:21:14 -0000	1.16
  +++ PhrasePrefixQuery.java	17 Sep 2004 19:24:14 -0000	1.17
  @@ -66,11 +66,11 @@
      * @see PhraseQuery#add(Term)
      */
     public void add(Term[] terms) {
  -      int position = 0;
  -      if(positions.size() > 0)
  -          position = ((Integer) positions.lastElement()).intValue() + 1;
  -      
  -      add(terms, position);
  +    int position = 0;
  +    if (positions.size() > 0)
  +      position = ((Integer) positions.lastElement()).intValue() + 1;
  +
  +    add(terms, position);
     }
     
     /**
  @@ -81,29 +81,29 @@
      * @param position
      */
     public void add(Term[] terms, int position) {
  -      if (termArrays.size() == 0)
  -          field = terms[0].field();
  -        
  -        for (int i=0; i<terms.length; i++) {
  -          if (terms[i].field() != field) {
  -            throw new IllegalArgumentException
  -              ("All phrase terms must be in the same field (" + field + "): "
  -               + terms[i]);
  -          }
  -        }
  +    if (termArrays.size() == 0)
  +      field = terms[0].field();
  +
  +    for (int i = 0; i < terms.length; i++) {
  +      if (terms[i].field() != field) {
  +        throw new IllegalArgumentException(
  +            "All phrase terms must be in the same field (" + field + "): "
  +                + terms[i]);
  +      }
  +    }
   
  -        termArrays.add(terms);
  -        positions.addElement(new Integer(position));
  +    termArrays.add(terms);
  +    positions.addElement(new Integer(position));
     }
     
     /**
      * Returns the relative positions of terms in this phrase.
      */
     public int[] getPositions() {
  -      int[] result = new int[positions.size()];
  -      for(int i = 0; i < positions.size(); i++)
  -          result[i] = ((Integer) positions.elementAt(i)).intValue();
  -      return result;
  +    int[] result = new int[positions.size()];
  +    for (int i = 0; i < positions.size(); i++)
  +      result[i] = ((Integer) positions.elementAt(i)).intValue();
  +    return result;
     }
   
     private class PhrasePrefixWeight implements Weight {
  
  
  

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


Mime
View raw message