Interface Frame<P extends FramePosition>

All Known Implementing Classes:
DefaultFrame

public interface Frame<P extends FramePosition>

Frame: a pair of the AlgART matrix and its position; in other words, an n-dimensional matrix, placed by some way in n-dimensional space. The matrix position is represented by FramePosition interface and specifies, what area of n-dimensional space corresponds to this matrix. In the simplest case, the position is just coordinates of the starting element (0,0,...) of the matrix in the space. See comments to FramePosition interface for more details.

A set of frames is the basic data structure that is possible to be stitched by this package, i.e. transformed to a united matrix, corresponding to any rectangular area in n-dimensional space, probably containing all matrices, placed in the space at their positions.

Implementations of this interface are usually immutable and always thread-safe. All implementations of this interface from this package are immutable.

Author:
Daniel Alievsky
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    The number of space dimensions.
    boolean
    Indicates whether some other object is also a Frame, containg the matrix and position, equal to the matrix and position in this frame.
    void
    Calls Matrix.freeResources(null) for the matrix, contained in this frame.
    int
    Returns the hash code of this object.
    Matrix<? extends PArray>
    The matrix, contained in this frame.
    The position in n-dimensional space, where the given matrix is placed.
  • Method Details

    • dimCount

      int dimCount()
      The number of space dimensions.
      Returns:
      the number of space dimensions
    • matrix

      Matrix<? extends PArray> matrix()
      The matrix, contained in this frame. There is a guarantee that thisInstance.matrix().dimCount()==thisInstance.dimCount().
      Returns:
      matrix contained in this frame.
    • position

      P position()
      The position in n-dimensional space, where the given matrix is placed. There is a guarantee that thisInstance.position().area().coordCount()==thisInstance.dimCount().
      Returns:
      position in n-dimensional space, where the given matrix is placed.
    • freeResources

      void freeResources()
      Calls Matrix.freeResources(null) for the matrix, contained in this frame.
    • hashCode

      int hashCode()
      Returns the hash code of this object. The result depends both on the matrix and the frame position.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code of this frame.
    • equals

      boolean equals(Object obj)
      Indicates whether some other object is also a Frame, containg the matrix and position, equal to the matrix and position in this frame.

      Note: this method should return true even the class of the passed frame is different than this class. This method checks only the built-in matrices and positions.

      Overrides:
      equals in class Object
      Parameters:
      obj - the object to be compared for equality with this frame.
      Returns:
      true if the specified object is a frame containing the equal matrix and position.