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
014import java.util.ArrayList;
015import java.util.List;
016
017public class Concept {
018
019        private ConceptKind kind;
020        /**
021         * case sensitive code for this concept
022         */
023        private String code;
024        
025        /**
026         * case insensitive code for this concept
027         */
028        private String codeUC;
029        
030        /**
031         * print symbol for this code 
032         */
033        private String printSymbol;
034        
035        /**
036         * names for the concept
037         */
038        private List<String> names = new ArrayList<String>();
039        
040        
041        /**
042         * @param code
043         * @param codeUC
044         */
045        public Concept(ConceptKind kind, String code, String codeUC) {
046                super();
047                this.kind = kind;
048                this.code = code;
049                this.codeUC = codeUC;
050        }
051
052        /**
053         * @return the code
054         */
055        public String getCode() {
056                return code;
057        }
058
059        /**
060         * @param code the code to set
061         */
062        public void setCode(String code) {
063                this.code = code;
064        }
065
066        /**
067         * @return the codeUC
068         */
069        public String getCodeUC() {
070                return codeUC;
071        }
072
073        /**
074         * @param codeUC the codeUC to set
075         */
076        public void setCodeUC(String codeUC) {
077                this.codeUC = codeUC;
078        }
079
080        /**
081         * @return the printSymbol
082         */
083        public String getPrintSymbol() {
084                return printSymbol;
085        }
086
087        /**
088         * @param printSymbol the printSymbol to set
089         */
090        public void setPrintSymbol(String printSymbol) {
091                this.printSymbol = printSymbol;
092        }
093
094        /**
095         * @return the name
096         */
097        public List<String> getNames() {
098                return names;
099        }
100
101        /**
102         * @return the kind
103         */
104        public ConceptKind getKind() {
105                return kind;
106        }
107
108        public String getDescription() {
109                return  kind.toString().toLowerCase()+" "+code+" ('"+names.get(0)+"')";
110        }
111        
112        @Override
113        public String toString() {
114                return this.getCode() + " = " + getDescription();
115        }
116}