Class Grid3Dobject<T>

  • All Implemented Interfaces:
    Grid3D, java.io.Serializable

    public class Grid3Dobject<T>
    extends java.lang.Object
    implements Grid3D, java.io.Serializable
    a 3D Grid of objects
    See Also:
    Serialized Form
    • Field Detail

      • xDim

        public final int xDim
      • yDim

        public final int yDim
      • zDim

        public final int zDim
      • length

        public final int length
      • wrapX

        public boolean wrapX
      • wrapY

        public boolean wrapY
      • wrapZ

        public boolean wrapZ
    • Constructor Detail

      • Grid3Dobject

        public Grid3Dobject​(int xDim,
                            int yDim,
                            int zDim,
                            boolean wrapX,
                            boolean wrapY,
                            boolean wrapZ)
        creates a new Grid3Dobject of dimensions xDim by yDim by zDim without wraparound
      • Grid3Dobject

        public Grid3Dobject​(int xDim,
                            int yDim,
                            int zDim)
        creates a new Grid3Dojbect of dimensions xDim by yDim by zDim with optional wraparound
    • Method Detail

      • Get

        public T Get​(int i)
        gets the field value at the specified index
      • Get

        public T Get​(int x,
                     int y,
                     int z)
        gets the field value at the specified coordinates
      • Set

        public void Set​(int i,
                        T val)
        sets the current field value at the specified index
      • Set

        public void Set​(int x,
                        int y,
                        int z,
                        T val)
        sets the current field value at the specified coordinates
      • GetField

        public T[] GetField()
        returns the complete field as an array
      • SetAll

        public void SetAll​(T val)
        sets all squares in current the field to the specified value
      • Xdim

        public int Xdim()
        Specified by:
        Xdim in interface Grid3D
      • Ydim

        public int Ydim()
        Specified by:
        Ydim in interface Grid3D
      • Zdim

        public int Zdim()
        Specified by:
        Zdim in interface Grid3D
      • Length

        public int Length()
        Specified by:
        Length in interface Grid3D
      • IsWrapX

        public boolean IsWrapX()
        Specified by:
        IsWrapX in interface Grid3D
      • IsWrapY

        public boolean IsWrapY()
        Specified by:
        IsWrapY in interface Grid3D
      • IsWrapZ

        public boolean IsWrapZ()
        Specified by:
        IsWrapZ in interface Grid3D