Interface Neighbourhood<S>

  • Type Parameters:
    S - The type representing the state.
    All Superinterfaces:
    org.refcodes.graphical.Position, org.refcodes.graphical.PosXAccessor, org.refcodes.graphical.PosYAccessor
    All Known Implementing Classes:
    MooreNeighbourhood, VonNeumannNeighbourhood


    public interface Neighbourhood<S>
    extends org.refcodes.graphical.Position
    Methods useful for working with neighborhoods related to cellular automatons, such as the VonNeumannNeighbourhood or the MooreNeighbourhood.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.refcodes.graphical.Position

        org.refcodes.graphical.Position.PositionBuilder<B extends org.refcodes.graphical.Position.PositionBuilder<B>>, org.refcodes.graphical.Position.PositionMutator, org.refcodes.graphical.Position.PositionProperty, org.refcodes.graphical.Position.PositionPropertyBuilder
      • Nested classes/interfaces inherited from interface org.refcodes.graphical.PosXAccessor

        org.refcodes.graphical.PosXAccessor.PosXBuilder<B extends org.refcodes.graphical.PosXAccessor.PosXBuilder<B>>, org.refcodes.graphical.PosXAccessor.PosXMutator, org.refcodes.graphical.PosXAccessor.PosXProperty
      • Nested classes/interfaces inherited from interface org.refcodes.graphical.PosYAccessor

        org.refcodes.graphical.PosYAccessor.PosYBuilder<B extends org.refcodes.graphical.PosYAccessor.PosYBuilder<B>>, org.refcodes.graphical.PosYAccessor.PosYMutator, org.refcodes.graphical.PosYAccessor.PosYProperty
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      S clockwiseNext​()
      Returns the next clockwise state relative to the current state.
      S clockwisePrevious​()
      Returns the next anti-clockwise state relative to the current state.
      default S next​(Rotation aRotation)
      Returns the next neighborhood for the given rotation relative to the current state.
      • Methods inherited from interface org.refcodes.graphical.Position

        equals, toAddTo, toSubFrom
      • Methods inherited from interface org.refcodes.graphical.PosXAccessor

        getPositionX
      • Methods inherited from interface org.refcodes.graphical.PosYAccessor

        getPositionY
    • Method Detail

      • clockwiseNext

        S clockwiseNext​()
        Returns the next clockwise state relative to the current state. Imagine the states as the positions on a clock, next to "12" would be "1", next to "1" would be "2", and so on (clockwise).
        Returns:
        The next state relative to the current state.
      • clockwisePrevious

        S clockwisePrevious​()
        Returns the next anti-clockwise state relative to the current state. Imagine the states as the positions on a clock, next to "12" would be "11", next to "11" would be "10", and so on (anti-clockwise).
        Returns:
        The next state relative to the current state.