Class GeneralGridCoordinates

    • Constructor Detail

      • GeneralGridCoordinates

        public GeneralGridCoordinates​(int dimension)
        Creates a grid coordinates of the specified dimension. All coordinates are initially set to 0.
        Parameters:
        dimension - The number of dimension.
      • GeneralGridCoordinates

        public GeneralGridCoordinates​(int[] coordinates)
        Creates a grid coordinates initialized to the specified values.
        Parameters:
        coordinates - The grid coordinates to copy.
      • GeneralGridCoordinates

        public GeneralGridCoordinates​(int[] coordinates,
                                      int lower,
                                      int upper)
        Creates a grid coordinates initialized to the specified values in the specified range.
        Parameters:
        coordinates - The coordinates to copy.
        lower - Index of the first value to copy, inclusive.
        upper - Index of the last value to copy, exclusive.
        Since:
        2.5
      • GeneralGridCoordinates

        public GeneralGridCoordinates​(GridCoordinates coordinates)
        Creates a grid coordinates which is a copy of the specified one.
        Parameters:
        coordinates - The grid coordinates to copy.
        Since:
        2.5
    • Method Detail

      • getDimension

        public int getDimension()
        Returns the number of dimensions. This method is equivalent to getCoordinateValues().length. It is provided for efficienty.
        Specified by:
        getDimension in interface GridCoordinates
        Returns:
        The number of dimensions.
      • getCoordinateValues

        public int[] getCoordinateValues()
        Returns one integer value for each dimension of the grid. The ordering of these coordinate values shall be the same as that of the elements of Grid#getAxisNames. The value of a single coordinate shall be the number of offsets from the origin of the grid in the direction of a specific axis.
        Specified by:
        getCoordinateValues in interface GridCoordinates
        Returns:
        A copy of the coordinates. Changes in the returned array will not be reflected back in this GeneralGridCoordinates object.
      • toString

        public String toString()
        Returns a string representation of this grid coordinates.
        Overrides:
        toString in class Object
      • hashCode

        public int hashCode()
        Returns a hash code value for this object.
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object object)
        Compares this grid coordinates with the specified object for equality.
        Overrides:
        equals in class Object
        Parameters:
        object - The object to compares with this grid coordinates.
        Returns:
        true if the given object is equals to this grid coordinates.