001// BiblioCriterion.java 002// 003// senger@ebi.ac.uk 004// April 2001 005// 006 007/* 008 * BioJava development code 009 * 010 * This code may be freely distributed and modified under the 011 * terms of the GNU Lesser General Public Licence. This should 012 * be distributed with the code. If you do not have a copy, 013 * see: 014 * 015 * http://www.gnu.org/copyleft/lesser.html 016 * 017 * Copyright for this code is held jointly by the individual 018 * authors. These should be listed in @author doc comments. 019 * 020 * For more information on the BioJava project and its aims, 021 * or to join the biojava-l mailing list, visit the home page 022 * at: 023 * 024 * http://www.biojava.org/ 025 * 026 */ 027package org.biojava.bibliography; 028 029/** 030 * The criteria define how the matching or ordering should be done 031 * during queries. 032 * 033 * @author <A HREF="mailto:senger@ebi.ac.uk">Martin Senger</A> 034 * @version $Id$ 035 * @since 1.3 036 */ 037 038public class BiblioCriterion { 039 /** 040 * A query criterion. 041 */ 042 public static final int QUERY_CRITERION = 0; 043 044 /** 045 * A sort criterion. 046 */ 047 public static final int SORT_CRITERION = 1; 048 049 /** 050 * <p> 051 * Each Criterion is identified by its name. 052 * A list of criteria names is used in methods for querying and sorting 053 * (see {@link BibRefQuery} interface). 054 * </p> 055 * 056 * <p> 057 * The implementations are advised to use descriptive names. 058 * For example, the names for matching can be: 059 * <pre> 060 * match all words 061 * match any word 062 * case insensitive 063 * case sensitive 064 * partial word match 065 * full word match 066 * </pre> 067 * and the names for ordering can be: 068 * <pre> 069 * ascending 070 * descending 071 * </pre> 072 * Another example of how to use Criteria is to allow regular expressions in queries. 073 * Not every implementation is supposed to have the capability of matching by regular 074 * expressions but those who have can specify (and document), for example, criterion 075 * with name <tt>regular expression</tt>. 076 * </p> 077 */ 078 public String name; 079 080 /** 081 * The criteria can be used for defining rules for matching 082 * (type {@link #QUERY_CRITERION}), or for ordering (type {@link #SORT_CRITERION}). 083 */ 084 public int type = QUERY_CRITERION; 085 086 /** 087 * <p> 088 * A list of other criteria names that this criterion is mutually exclusive with. 089 * </p> 090 * 091 * <p> 092 * For example, a sort criterion <tt>ascending</tt> will probably have 093 * <tt>descending</tt> in this list. 094 * </p> 095 */ 096 public String[] mutuallyExclusiveWith; 097 098 /** 099 * A name of a repository subset which this criterion is valid/used for. 100 * @see BiblioEntryStatus#repositorySubset 101 */ 102 public String forSubset; 103 104}