@@ -0,0 +1,1105 @@
+package com.model.implementation;%0A%0A/**%0A * @author kamontat%0A * @version 1.0%0A * @since Sun 05/Mar/2017 - 3:29 AM%0A */%0Apublic class Pair%3CK, V%3E %7B%0A%09private K key;%0A%09private V value;%0A%09%0A%09/**%0A%09 * easy create the pair.%0A%09 *%0A%09 * @param key%0A%09 * %09%09key or first element.%0A%09 * @param value%0A%09 * %09%09value or second element.%0A%09 * @param %3CK%3E%0A%09 * %09%09key type/class.%0A%09 * @param %3CV%3E%0A%09 * %09%09value type/class.%0A%09 * @return Pair that contains key and value.%0A%09 */%0A%09public static %3CK, V%3E Pair%3CK, V%3E create(K key, V value) %7B%0A%09%09return new Pair%3CK, V%3E(key, value);%0A%09%7D%0A%09%0A%09public Pair() %7B%0A%09%09key = null;%0A%09%09value = null;%0A%09%7D%0A%09%0A%09public Pair(K key, V value) %7B%0A%09%09this.key = key;%0A%09%09this.value = value;%0A%09%7D%0A%09%0A%09public K getKey() %7B%0A%09%09return key;%0A%09%7D%0A%09%0A%09public void setKey(K key) %7B%0A%09%09this.key = key;%0A%09%7D%0A%09%0A%09public V getValue() %7B%0A%09%09return value;%0A%09%7D%0A%09%0A%09public void setValue(V value) %7B%0A%09%09this.value = value;%0A%09%7D%0A%09%0A%09public boolean isKeyContains(K key) %7B%0A%09%09return this.key.equals(key);%0A%09%7D%0A%09%0A%09public boolean isValueContains(V value) %7B%0A%09%09return this.value.equals(value);%0A%09%7D%0A%09%0A%09public boolean isContains(Object obj) %7B%0A%09%09return obj.equals(key) %7C%7C obj.equals(value);%0A%09%7D%0A%7D%0A

add new data-structure (Pair)