001 /*************************************************************************************************** 002 * MODULE DESCRIPTION 003 **************************************************************************************************** 004 * 005 * NAME: StringPair.java 006 * LANGUAGE: Java2 007 * DATE: 20.11.2002 008 * AUTHOR: Miika Nurminen, University of Jyväskylä 009 * 010 **************************************************************************************************** 011 * COPYRIGHT (C) KIURU -PROJECT GROUP 012 * Limited rights granted. Please refer to license 013 **************************************************************************************************** 014 * 015 **************************************************************************************************** 016 * UPDATES 017 **************************************************************************************************** 018 * 019 * 20.11.2002: Initial release / mn 020 * 021 ****************************************************************************************************/ 022 package kiurubeans; 023 024 /** Encapsulates orderer pair of two strings. 025 * @author Miika Nurminen 026 */ 027 public class StringPair { 028 029 /** First string in the ordered pair. Used as search key. */ 030 private String key=null; 031 /** Second string of the ordered pair. Presents the actual value for the search key. */ 032 private String value=null; 033 034 /** Creates a new instance of StringPair */ 035 public StringPair() {} 036 037 /** Constructor with <CODE>key</CODE>. <CODE>value</CODE> remains <CODE>null</CODE>. 038 * @param key String key 039 */ 040 public StringPair(String key) { 041 setKey(key); 042 } 043 044 /** Constructor with two parameters: <CODE>key</CODE> and <CODE>value</CODE>. 045 * @param key Key 046 * @param desc Value 047 */ 048 public StringPair(String key,String desc) { 049 setKey(key); 050 setValue(desc); 051 } 052 053 /** Sets the key of the stringpair 054 * @param s New key 055 */ 056 public void setKey(String s) { 057 this.key = s; 058 } 059 /** Sets the value of the stringPair 060 * @param s New value 061 */ 062 public void setValue(String s) { 063 this.value = s; 064 } 065 /** Returns the key 066 * @return key 067 */ 068 public String getKey() { 069 return this.key; 070 } 071 /** Returns the value of StringPair 072 * @return Value 073 */ 074 public String getValue() { 075 return this.value; 076 } 077 078 } 079 /*************************************************************************************************** 080 * COPYRIGHT (C) KIURU -PROJECT GROUP 081 * Limited rights granted. Please refer to license. 082 **************************************************************************************************/