001    /**
002     * Copyright (C) 2010 The Roslin Institute <contact andy.law@roslin.ed.ac.uk>
003     *
004     * This file is part of the Ensembl Java API demonstration project developed by the
005     * Bioinformatics Group at The Roslin Institute, The Royal (Dick) School of
006     * Veterinary Studies, University of Edinburgh.
007     *
008     * This is free software: you can redistribute it and/or modify
009     * it under the terms of the GNU General Public License (version 3) as published by
010     * the Free Software Foundation.
011     *
012     * This software is distributed in the hope that it will be useful,
013     * but WITHOUT ANY WARRANTY; without even the implied warranty of
014     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
015     * GNU General Public License for more details.
016     *
017     * You should have received a copy of the GNU General Public License
018     * in this software distribution. If not, see <http://www.gnu.org/licenses/gpl-3.0.html/>.
019     */
020    
021    package uk.ac.roslin.ensembl.datasourceaware.core;
022    
023    import uk.ac.roslin.ensembl.model.core.CoordSystemType;
024    import uk.ac.roslin.ensembl.model.core.CoordinateSystem;
025    import uk.ac.roslin.ensembl.config.EnsemblCoordSystemType;
026    
027    /**
028     *
029     * @author paterson
030     */
031    public class DACoordinateSystem implements CoordinateSystem {
032    
033        protected Integer id = null;
034        protected Integer speciesID = null;
035        protected EnsemblCoordSystemType type;
036        protected Integer rank;
037        protected String version;
038        protected Boolean defaultVersion = false;
039        protected Boolean sequenceLevel = false;
040    
041        public DACoordinateSystem() {
042            
043        }
044    
045        @Override
046        public Boolean isTopLevel() {
047    
048            return (rank !=null) ? this.rank.equals(1) : false;
049        }
050    
051        /**
052         * Get the value of speciesID
053         *
054         * @return the value of speciesID
055         */
056        @Override
057        public Integer getSpeciesID() {
058            return speciesID;
059        }
060    
061        /**
062         * Set the value of speciesID
063         *
064         * @param speciesID new value of speciesID
065         */
066        @Override
067        public void setSpeciesID(Integer speciesID) {
068            this.speciesID = speciesID;
069        }
070    
071    
072        /**
073         * Get the value of id
074         *
075         * @return the value of id
076         */
077        @Override
078        public Integer getId() {
079            return id;
080        }
081    
082        /**
083         * Set the value of id
084         *
085         * @param id new value of id
086         */
087        @Override
088        public void setId(Integer id) {
089            this.id = id;
090        }
091    
092        /**
093         * Get the value of type
094         *
095         * @return the value of type
096         */
097        @Override
098        public EnsemblCoordSystemType getType() {
099            return type;
100        }
101    
102        /**
103         * Set the value of type
104         *
105         * @param type new value of type
106         */
107        @Override
108        public void setType(CoordSystemType type) {
109            this.type = (EnsemblCoordSystemType) type;
110        }
111        /**
112         * Get the value of version
113         *
114         * @return the value of version
115         */
116        @Override
117        public String getVersion() {
118            return version;
119        }
120    
121        /**
122         * Set the value of version
123         *
124         * @param version new value of version
125         */
126        @Override
127        public void setVersion(String version) {
128            this.version = version;
129        }
130    
131        /**
132         * Get the value of rank
133         *
134         * @return the value of rank
135         */
136        @Override
137        public Integer getRank() {
138            return rank;
139        }
140    
141        /**
142         * Set the value of rank
143         *
144         * @param rank new value of rank
145         */
146        @Override
147        public void setRank(Integer rank) {
148            this.rank = rank;
149        }
150    
151        @Override
152        public Boolean isDefaultVersion() {
153            return defaultVersion;
154        }
155    
156        @Override
157        public void setDefaultVersion(Boolean defaultVersion) {
158            this.defaultVersion = defaultVersion;
159        }
160    
161        @Override
162        public Boolean isSequenceLevel() {
163            return sequenceLevel;
164        }
165    
166        @Override
167        public void setSequenceLevel(Boolean sequenceLevel) {
168            this.sequenceLevel = sequenceLevel;
169        }
170    
171    }