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 * Created on 01-21-2010 021 */ 022package org.biojava.nbio.core.sequence.location.template; 023 024/** 025 * Holds a single point part of a location 026 */ 027public interface Point extends Comparable<Point> { 028 029 /** 030 * Used to resolve a position about a point 031 */ 032 public interface Resolver<T extends Point> { 033 int resolve(T point); 034 } 035 036 /** 037 * Returns the position held by this object 038 */ 039 Integer getPosition(); 040 041 /** 042 * Returns true if the current position is unknown but is 043 * beyond the position encoded for. This is the same as the position 044 * <pre>>80</pre> as encoded by UniProt. 045 */ 046 boolean isUnknown(); 047 048 /** 049 * Returns a true if the exact point is unknown. Equivalent position 050 * from UniProt is <pre>?80</pre>. 051 */ 052 boolean isUncertain(); 053 054 /** 055 * Returns the equivalent position on the reverse strand 056 * 057 * @param length Length of the sequence to translate to 058 */ 059 Point reverse(int length); 060 061 /** 062 * Returns a new point offset by the given distance 063 */ 064 Point offset(int distance); 065 066 /** 067 * Returns true if the current point is at a lower position than the 068 * point given. 069 */ 070 boolean isLower(Point point); 071 072 /** 073 * Returns true if the point is higher in value to the current point 074 */ 075 boolean isHigher(Point point); 076 077 /** 078 * Returns a copy of this point 079 */ 080 Point clonePoint(); 081}