Interface Neighborhood

  • All Implemented Interfaces:
    java.io.Serializable , java.lang.Cloneable , java.lang.Iterable

    
    public interface Neighborhood<T>
     implements Serializable, Cloneable, Iterable<T>
                        

    The type which describes the concentration of a molecule Interface for a neighborhood. When implementing it in a real class, please remember to correctly implement also the equals method inherited from Object.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Neighborhood<T> add(Node<T> node)
      abstract boolean contains(Node<T> n) Verifies if a node is contained inside a neighborhood.
      abstract Node<T> getCenter() Allows to access the central node.
      abstract ListSet<out Node<T>> getNeighbors() Allows to directly access every node in the neighborhood.
      abstract boolean isEmpty()
      abstract Neighborhood<T> remove(Node<T> node)
      abstract int size()
      • Methods inherited from class java.lang.Iterable

        forEach, iterator, spliterator
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • contains

         abstract boolean contains(Node<T> n)

        Verifies if a node is contained inside a neighborhood.

        Parameters:
        n - the node to be searched
        Returns:

        true if n belongs to this neighborhood

      • getCenter

         abstract Node<T> getCenter()

        Allows to access the central node.

        Returns:

        the central node, namely the node whose neighbors are represented by this structure.

      • getNeighbors

         abstract ListSet<out Node<T>> getNeighbors()

        Allows to directly access every node in the neighborhood. A change of this List will be reflected in the neighborhood.

        Returns:

        the list of the neighbors

      • isEmpty

         abstract boolean isEmpty()
        Returns:

        true if this neighborhood has no neighbors

      • size

         abstract int size()
        Returns:

        the number of neighbors.