net.ajaest.lib.data
Class ListEntry<Key,E>

java.lang.Object
  extended by net.ajaest.lib.data.ListEntry<Key,E>
Type Parameters:
Key - Key common to all stored elements.
E - Elements to be stored.

public class ListEntry<Key,E>
extends java.lang.Object

Generic class that stores a list of elements associated to a key.

Author:
Luis Alfonso Arce González

Field Summary
private  java.util.Set<E> elements
           
private  Key key
           
 
Constructor Summary
ListEntry(Key key)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.util.Set<E> getElements()
          Returns the list of elements.
 Key getKey()
          Returns the key.
 int hashCode()
           
 void setElements(java.util.Set<E> elements)
          Sets the list pf elements overriding the previous one.
 void setKey(Key key)
          Sets the key overriding the previous one.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

key

private Key key

elements

private java.util.Set<E> elements
Constructor Detail

ListEntry

public ListEntry(Key key)
Method Detail

getKey

public Key getKey()
Returns the key. Read the constructor or class info for further information about the meaning of "key".


setKey

public void setKey(Key key)
Sets the key overriding the previous one. Read the constructor or class info for further information about the meaning of "key".

Parameters:
key -

getElements

public java.util.Set<E> getElements()
Returns the list of elements. Read the constructor or class info for further information about the meaning of "elements".


setElements

public void setElements(java.util.Set<E> elements)
Sets the list pf elements overriding the previous one. Read the constructor or class info for further information about the meaning of "elements".

Parameters:
elements - List of elements

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object