001/* 002 * BioJava development code 003 * 004 * This code may be freely distributed and modified under the 005 * terms of the GNU Lesser General Public Licence. This should 006 * be distributed with the code. If you do not have a copy, 007 * see: 008 * 009 * http://www.gnu.org/copyleft/lesser.html 010 * 011 * Copyright for this code is held jointly by the individual 012 * authors. These should be listed in @author doc comments. 013 * 014 * For more information on the BioJava project and its aims, 015 * or to join the biojava-l mailing list, visit the home page 016 * at: 017 * 018 * http://www.biojava.org/ 019 * 020 */ 021 022package org.biojavax; 023import org.biojava.utils.ChangeType; 024import org.biojava.utils.ChangeVetoException; 025import org.biojava.utils.Changeable; 026import org.biojavax.ontology.ComparableTerm; 027 028/** 029 * Note is a generic class intended to hold a term describing the note, 030 * a value to associate with that term, and a rank. It is a generic representation 031 * of the various qualifier_value tables in BioSQL. It is used inside RichAnnotation 032 * objects to represent annotations. 033 * @author Richard Holland 034 * @see RichAnnotation 035 * @since 1.5 036 */ 037public interface Note extends Comparable,Changeable { 038 039 public static final ChangeType TERM = new ChangeType( 040 "This note's term has changed", 041 "org.biojavax.Note", 042 "TERM" 043 ); 044 public static final ChangeType RANK = new ChangeType( 045 "This note's rank has changed", 046 "org.biojavax.Note", 047 "RANK" 048 ); 049 public static final ChangeType VALUE = new ChangeType( 050 "This note's value has changed", 051 "org.biojavax.Note", 052 "VALUE" 053 ); 054 055 /** 056 * Gets the term that defines this note. 057 * @return a ComparableTerm object that is the key to this note. 058 */ 059 public ComparableTerm getTerm(); 060 061 /** 062 * Sets the term for this note. It cannot be null. 063 * @param term the term to use. 064 * @throws ChangeVetoException if it doesn't like the term. 065 */ 066 public void setTerm(ComparableTerm term) throws ChangeVetoException; 067 068 /** 069 * Gets the value that defines this note. 070 * @return a String object that is the value to this note. 071 */ 072 public String getValue(); 073 074 /** 075 * Sets the value for this note, or null for no value. 076 * @param value the value to use. 077 * @throws ChangeVetoException if it doesn't like the value. 078 */ 079 public void setValue(String value) throws ChangeVetoException; 080 081 /** 082 * Gets the rank that defines this note. 083 * @return an int that is the rank to this note. 084 */ 085 public int getRank(); 086 087 /** 088 * Sets the rank for this note. 089 * @param value the rank to use. 090 * @throws ChangeVetoException if it doesn't like the rank. 091 */ 092 public void setRank(int value) throws ChangeVetoException; 093 094}