net.sourceforge.cilib.type.types
Interface Type

All Superinterfaces:
Cloneable, Serializable
All Known Subinterfaces:
Fitness, Graph<E>, ItemLocation, NNError, StructuredType<E>, Tree<E>
All Known Implementing Classes:
AbstractList, AbstractTree, BinaryTree, Bit, Blackboard, ClassificationErrorReal, CoevolutionCompetitorList, EntityScoreboard, GeneralTree, GridLocation, InferiorFitness, Int, Long, MaximisationFitness, MinimisationFitness, MOFitness, MSEErrorFunction, NaryTree, Numeric, Real, RNAConformation, RNAStem, Set, StandardGraph, StringType, TypeList, Vector

public interface Type
extends Cloneable

Type interface for all type-objects that are used within CIlib. The types are built on an extend the Java Collections Framework.


Method Summary
 boolean equals(Object o)
          Compare the specified object with this type for equality.
 Type getClone()
          Create a cloned copy of the current object and return it.
 int hashCode()
          Returns the hash code value for this list.
 

Method Detail

getClone

Type getClone()
Create a cloned copy of the current object and return it. In general the created copy will be a deep copy of the provided instance. As a result this operation an be quite expensive if used incorrectly.

Specified by:
getClone in interface Cloneable
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

equals

boolean equals(Object o)
Compare the specified object with this type for equality. Returns true if and only if the specified object is also an instance of the same type.

Overrides:
equals in class Object
Parameters:
o - The object to compare.
Returns:
true if equality exists, false otherwise.
See Also:
Object.equals(Object)

hashCode

int hashCode()
Returns the hash code value for this list. The hash code of a list is defined to be the result of the following calculation:
  int hashCode = 7;
  Iterator<E> i = list.iterator();
  while (i.hasNext()) {
      E obj = i.next();
      hashCode = 31*hashCode + (obj==null ? 0 : obj.hashCode());
  }
 
This ensures that type1.equals(type2) implies that type1.hashCode()==type2.hashCode() for any two types, type1 and type2, as required by the general contract of Object.hashCode().

Overrides:
hashCode in class Object
Returns:
the hash code value for this list
See Also:
Object.equals(Object), equals(Object)


Copyright © 2009 CIRG. All Rights Reserved.