Quick Index
Code Explanation


Hello, my name is Association

Association concept is here....

I'm a utility class that associates a key with a value.

My key and value are generic type params (K and V) meaning you can use any types you like.

Read more about me below.

I have two ivars:
public class Association<K, V> {
	private K key;
	private V value;

	//etc (more code follows)

}
This constructor assigns the passed
values to my two ivars. The param types
match the ivar types (typical).
	public Association(K aKey, V aValue)  {
		this.key = aKey;
		this.value = aValue;
	}
Standard getter method
that returns the ivar "key"
(generic type K)
	public K getKey()  {
		return this.key;
	}
Standard setter method
that returns the ivar "value"
(generic type V)
	public V getValue()  {
		return this.value;
	}

Complete Source Code


Here is all my code.

Have Fun.

Your friend,
Association

package assoc.model;


public class Association<K, V> {

	private K key;
	private V value;

	//--------------------------
	//Constructors Here

	public Association(K aKey, V aValue) {
		this.key = aKey;
		this.value = aValue;
	}

	//--------------------------
	//Getters

	public K getKey() {
		return this.key;
	}

	public V getValue() {
		return this.value;
	}

}