001/*******************************************************************************
002 * Crown Copyright (c) 2006 - 2014, Copyright (c) 2006 - 2014 Kestral Computing P/L.
003 * All rights reserved. This program and the accompanying materials
004 * are made available under the terms of the Eclipse Public License v1.0
005 * which accompanies this distribution, and is available at
006 * http://www.eclipse.org/legal/epl-v10.html
007 * 
008 * Contributors:
009 *    Kestral Computing P/L - initial implementation
010 *******************************************************************************/
011
012package org.fhir.ucum;
013
014public class Term extends Component {
015
016        // op-term where op = /
017        // component
018        // component-op-term
019        private Component comp;
020        private Operator op;
021        private Term term;
022        /**
023         * 
024         */
025        public Term() {
026                super();
027        }
028        /**
029         * @return the comp
030         */
031        public Component getComp() {
032                return comp;
033        }
034        /**
035         * @param comp the comp to set
036         */
037        public void setComp(Component comp) {
038                this.comp = comp;
039        }
040        /**
041         * @return the op
042         */
043        public Operator getOp() {
044                return op;
045        }
046        /**
047         * @param op the op to set
048         */
049        public void setOp(Operator op) {
050                this.op = op;
051        }
052        /**
053         * @return the term
054         */
055        public Term getTerm() {
056                return term;
057        }
058        /**
059         * @param term the term to set
060         */
061        public void setTerm(Term term) {
062                this.term = term;
063        }
064        
065        public boolean hasComp() {
066                return comp != null;
067        }
068
069        public boolean hasOp() {
070                return op != null;
071        }
072        
073        public boolean hasTerm() {
074                return term != null;
075        }
076        public void setTermCheckOp(Term term) {
077                setTerm(term);
078                if (term == null)
079                        setOp(null);
080        }
081
082        
083}