001package org.biopax.paxtools.model;
002
003import java.io.Serializable;
004import java.util.Map;
005
006/**
007 * This class represents a general BioPAXElement, regardless of Level.
008 */
009public interface BioPAXElement extends Serializable, Cloneable
010{
011// ------------------------------ FIELDS ------------------------------
012
013    /**
014     * Constant for representing unknown doubles. This is required
015     * as by default java would assign 0.
016     */
017    public static final Double UNKNOWN_DOUBLE = Double.MIN_VALUE;
018
019    /**
020     * Constant for representing unknown floats. This is required
021     * as by default java would assign 0.
022     */
023        public static final Float UNKNOWN_FLOAT = Float.MIN_VALUE;
024
025    /**
026     * Constant for representing unknown integers. This is required
027     * as by default java would assign 0.
028     */
029        public static final Integer UNKNOWN_INT = Integer.MIN_VALUE;
030        
031        
032    /**
033     * This method returns the actual model interface that a class implements.
034     * @return an interface from {@link org.biopax.paxtools.model} package
035     * corresponding to a BioPAX class.
036     */
037    Class<? extends BioPAXElement> getModelInterface();
038
039    /**
040     * This method returns the full URI of the element
041     * (despite it is called RDFId). 
042     * BioPAX data providers are responsible 
043     * for generating globally unique and standard URIs
044     * for their BioPAX elements.
045     * 
046     * @return the unique URI for this object.
047     */
048    String getRDFId();
049
050
051    /**
052     * This method compares the given element for equivalency. This is different
053     * from equals(), as BioPAX elements resolve equality based on RDF ID.
054     * Equivalent returns true if elements are equal or if
055     *  <ul>
056     *   <li> both elements implement the same model interface AND
057     *   <li> both elements have equivalent key properties
058     *  </ul>
059     *  These key properties vary from class to class.
060     *
061     * @param element to be compared for equivalency
062     * @return true if the element equals to this, or has equivalent critical
063     * properties.
064     */
065    boolean isEquivalent(BioPAXElement element);
066
067    /**
068     * If two elements are equivalent, then their equivalence code should be the
069     * same.
070     * @return an integer that is same across all equivalent entities.
071     */
072    int equivalenceCode();
073
074
075    /**
076     * A general-purpose map to optionally 
077     * store additional application-specific information 
078     * about the BioPAX element, such as statistics,
079     * inferred fields, etc.
080     * 
081     * @return additional (not BioPAX standard) annotations
082     */
083    public Map<String, Object> getAnnotations();
084        
085}