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 014 015public class DefinedUnit extends Unit{ 016 017 /** 018 * whether this is a metric unit or not 019 */ 020 private boolean metric; 021 022 /** 023 * special means? 024 */ 025 private boolean isSpecial; 026 027 /** 028 * The class of this unit 029 */ 030 private String class_; 031 032 /** 033 * Value details 034 */ 035 private Value value; 036 037 038 039 040 /** 041 * @param code 042 * @param codeUC 043 */ 044 public DefinedUnit(String code, String codeUC) { 045 super(ConceptKind.UNIT, code, codeUC); 046 } 047 048 049 /** 050 * @return the metric 051 */ 052 public boolean isMetric() { 053 return metric; 054 } 055 056 057 /** 058 * @param metric the metric to set 059 */ 060 public void setMetric(boolean metric) { 061 this.metric = metric; 062 } 063 064 065 /** 066 * @return the isSpecial 067 */ 068 public boolean isSpecial() { 069 return isSpecial; 070 } 071 072 073 /** 074 * @param isSpecial the isSpecial to set 075 */ 076 public void setSpecial(boolean isSpecial) { 077 this.isSpecial = isSpecial; 078 } 079 080 081 /** 082 * @return the class_ 083 */ 084 public String getClass_() { 085 return class_; 086 } 087 088 089 /** 090 * @param class_ the class_ to set 091 */ 092 public void setClass_(String class_) { 093 this.class_ = class_; 094 } 095 096 097 /** 098 * @return the value 099 */ 100 public Value getValue() { 101 return value; 102 } 103 104 105 /** 106 * @param value the value to set 107 */ 108 public void setValue(Value value) { 109 this.value = value; 110 } 111 112 113 /* (non-Javadoc) 114 * @see org.eclipse.ohf.ucum.model.BaseUnit#getDescription() 115 */ 116 @Override 117 public String getDescription() { 118 return super.getDescription()+" = "+value.getDescription(); 119 } 120 121 122 123 124}