net.sourceforge.cilib.util.selection
Class Selection.Entry<E>

java.lang.Object
  extended by net.sourceforge.cilib.util.selection.Selection.Entry<E>
Type Parameters:
E - The Comparable type.
Enclosing class:
Selection<E>

public static final class Selection.Entry<E>
extends Object

This class provides the notion of an entry within a list for the selection process.

This class is is final and non-instantiable to ensure that the operations are allowed to be applied, however, additional metadata can be recored and used during the selection process.


Method Summary
 boolean equals(Object obj)
          Determine if the provided obj is equal to the currently decorated element within this Entry.
 E getElement()
          Get the element that this Entry represents.
 double getWeight()
          Obtain the weight value associated with this Entry.
 int hashCode()
          Obtain the hash of the decorated element.
 void setWeight(double weight)
          Set the weight value for the current Entry within the Selection.
 String toString()
          Obtain the String of the decorated element.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getElement

public E getElement()
Get the element that this Entry represents.

Returns:
The decorated element.

getWeight

public double getWeight()
Obtain the weight value associated with this Entry.

The weight value need not be set. It is not always used.

Returns:
The weight value.

setWeight

public void setWeight(double weight)
Set the weight value for the current Entry within the Selection.

Parameters:
weight - The weight value to set.

equals

public boolean equals(Object obj)
Determine if the provided obj is equal to the currently decorated element within this Entry.

Overrides:
equals in class Object
Parameters:
obj - The object instance to compare.
Returns:
true if the objects are equal, false otherwi

hashCode

public int hashCode()
Obtain the hash of the decorated element.

Overrides:
hashCode in class Object
Returns:
The decorated instance's hash value.

toString

public String toString()
Obtain the String of the decorated element.

Overrides:
toString in class Object
Returns:
The toString() of the decorated element.


Copyright © 2009 CIRG. All Rights Reserved.