AbstractDocumentsBasedTermsQuery.java

  1. /*
  2.  *  AbstractDocumentsBasedTermsQuery.java
  3.  *
  4.  *  Copyright (c) 2007-2011, The University of Sheffield.
  5.  *
  6.  *  This file is part of GATE Mímir (see http://gate.ac.uk/family/mimir.html),
  7.  *  and is free software, licenced under the GNU Lesser General Public License,
  8.  *  Version 3, June 2007 (also included with this distribution as file
  9.  *  LICENCE-LGPL3.html).
  10.  *
  11.  *  Valentin Tablan, 28 Nov 2012
  12.  *
  13.  *  $Id: AbstractDocumentsBasedTermsQuery.java 16583 2013-03-12 13:07:53Z valyt $
  14.  */
  15. package gate.mimir.search.terms;


  16. /**
  17.  * Abstract base class for term queries that use document IDs to specify the
  18.  * search.
  19.  */
  20. public abstract class AbstractDocumentsBasedTermsQuery
  21.     implements DocumentsBasedTermsQuery {

  22.   /**
  23.    * Serialization ID.
  24.    */
  25.   private static final long serialVersionUID = -8782894544193518215L;
  26.  
  27.   /**
  28.    * The IDs for the documents used by this query.
  29.    */
  30.   protected long[] documentIds;
  31.  
  32.   public AbstractDocumentsBasedTermsQuery(long[] documentIds) {
  33.     this.documentIds = documentIds;
  34.   }

  35.   /* (non-Javadoc)
  36.    * @see gate.mimir.search.terms.DocumentsBasedTermsQuery#getDocumentIds()
  37.    */
  38.   @Override
  39.   public long[] getDocumentIds() {
  40.     return documentIds;
  41.   }

  42.   /* (non-Javadoc)
  43.    * @see gate.mimir.search.terms.DocumentsBasedTermsQuery#setDocumentIds(long[])
  44.    */
  45.   @Override
  46.   public void setDocumentIds(long... newDocIds) {
  47.     this.documentIds = newDocIds;
  48.   }
  49.  
  50.   @Override
  51.   public Object clone() throws CloneNotSupportedException {
  52.     return super.clone();
  53.   }
  54. }