001package com.hfg.citation.ncbi; 002 003//------------------------------------------------------------------------------ 004 005import com.hfg.util.CompareUtil; 006 007/** 008 Qualifier term for a Medical Subject Heading (MeSH®) value. MeSH headings are used to characterize 009 the contents of MEDLINE citations. 010 <div> 011 @author J. Alex Taylor, hairyfatguy.com 012 </div> 013 */ 014//------------------------------------------------------------------------------ 015// com.hfg XML/HTML Coding Library 016// 017// This library is free software; you can redistribute it and/or 018// modify it under the terms of the GNU Lesser General Public 019// License as published by the Free Software Foundation; either 020// version 2.1 of the License, or (at your option) any later version. 021// 022// This library is distributed in the hope that it will be useful, 023// but WITHOUT ANY WARRANTY; without even the implied warranty of 024// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 025// Lesser General Public License for more details. 026// 027// You should have received a copy of the GNU Lesser General Public 028// License along with this library; if not, write to the Free Software 029// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 030// 031// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com 032// jataylor@hairyfatguy.com 033//------------------------------------------------------------------------------ 034 035public class MeshQualifier implements Comparable 036{ 037 private String mValue; 038 private String mUniqueIdentifier; 039 private Boolean mIsMajorTopic; 040 041 042 //########################################################################### 043 // CONSTRUCTORS 044 //########################################################################### 045 046 //--------------------------------------------------------------------------- 047 public MeshQualifier(String inValue) 048 { 049 mValue = inValue; 050 } 051 052 //########################################################################### 053 // PUBLIC METHODS 054 //########################################################################### 055 056 //--------------------------------------------------------------------------- 057 @Override 058 public String toString() 059 { 060 return getValue(); 061 } 062 063 //--------------------------------------------------------------------------- 064 @Override 065 public boolean equals(Object inObj2) 066 { 067 return (0 == compareTo(inObj2)); 068 } 069 070 //--------------------------------------------------------------------------- 071 @Override 072 public int hashCode() 073 { 074 int result = 1; 075 076 if (getValue() != null) 077 { 078 result = getValue().hashCode(); 079 } 080 081 return result; 082 } 083 084 //--------------------------------------------------------------------------- 085 @Override 086 public int compareTo(Object inObj2) 087 { 088 int result = -1; 089 090 if (inObj2 != null 091 && inObj2 instanceof MeshQualifier) 092 { 093 result = CompareUtil.compare(getValue(), ((MeshQualifier) inObj2).getValue()); 094 } 095 096 return result; 097 } 098 099 100 101 //--------------------------------------------------------------------------- 102 public String getValue() 103 { 104 return mValue; 105 } 106 107 108 //--------------------------------------------------------------------------- 109 public MeshQualifier setUniqueIdentifier(String inValue) 110 { 111 mUniqueIdentifier = inValue; 112 return this; 113 } 114 115 //--------------------------------------------------------------------------- 116 public String getUniqueIdentifier() 117 { 118 return mUniqueIdentifier; 119 } 120 121 122 //--------------------------------------------------------------------------- 123 public MeshQualifier setIsMajorTopic(boolean inValue) 124 { 125 mIsMajorTopic = inValue; 126 return this; 127 } 128 129 //--------------------------------------------------------------------------- 130 public Boolean isMajorTopic() 131 { 132 return mIsMajorTopic; 133 } 134 135 136}