Class TileBlock


  • public class TileBlock
    extends java.lang.Object
    This class is responsible for breaking up a block of tiles into a set of smaller requests that are as large as possible without rerequesting significant numbers of tiles that are already available.
    Version:
    $Id: TileBlock.java 1831630 2018-05-15 12:56:55Z ssteiner $
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int benefit  
      (package private) int h  
      (package private) int occH  
      (package private) boolean[] occupied  
      (package private) int occW  
      (package private) int occX  
      (package private) int occY  
      (package private) int w  
      (package private) int xOff  
      (package private) int yOff  
    • Constructor Summary

      Constructors 
      Constructor Description
      TileBlock​(int occX, int occY, int occW, int occH, boolean[] occupied, int xOff, int yOff, int w, int h)
      Construct a tile block this represents a block of contigous tiles.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) int getBenefit()
      Return the number of new tiles computed.
      (package private) TileBlock[] getBestSplit()
      Returnes an optimized list of TileBlocks to generate that tries to minimize the work to benefit ratio, for the set of blocks defined by this block.
      (package private) int getHeight()
      Return the height of this block of tiles
      (package private) int getWidth()
      Return the width of this block of tiles
      (package private) int getWork()
      Return the approximate amount of work required to compute those tiles.
      (package private) static int getWork​(TileBlock[] blocks)
      Returns the total amount of work for the array of tile blocks
      (package private) int getXLoc()
      Return the x location of this block of tiles
      (package private) int getYLoc()
      Return the y location of this block of tiles
      boolean simplify()  
      TileBlock[] splitOneGo()  
      java.lang.String toString()
      Really nice to string that outlines what tiles are filled and what region this block covers.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • occX

        int occX
      • occY

        int occY
      • occW

        int occW
      • occH

        int occH
      • xOff

        int xOff
      • yOff

        int yOff
      • w

        int w
      • h

        int h
      • benefit

        int benefit
      • occupied

        boolean[] occupied
    • Constructor Detail

      • TileBlock

        TileBlock​(int occX,
                  int occY,
                  int occW,
                  int occH,
                  boolean[] occupied,
                  int xOff,
                  int yOff,
                  int w,
                  int h)
        Construct a tile block this represents a block of contigous tiles.
        Parameters:
        xOff - The x index of left edge of the tile block.
        yOff - The y index of top edge of the tile block.
        w - The number of tiles across in the block
        h - The number of tiles down the block
        occupied - Which entries in the block are already computed.
    • Method Detail

      • toString

        public java.lang.String toString()
        Really nice to string that outlines what tiles are filled and what region this block covers. Really useful for debugging the TileBlock stuff.
        Overrides:
        toString in class java.lang.Object
      • getXLoc

        int getXLoc()
        Return the x location of this block of tiles
      • getYLoc

        int getYLoc()
        Return the y location of this block of tiles
      • getWidth

        int getWidth()
        Return the width of this block of tiles
      • getHeight

        int getHeight()
        Return the height of this block of tiles
      • getBenefit

        int getBenefit()
        Return the number of new tiles computed.
      • getWork

        int getWork()
        Return the approximate amount of work required to compute those tiles.
      • getWork

        static int getWork​(TileBlock[] blocks)
        Returns the total amount of work for the array of tile blocks
      • getBestSplit

        TileBlock[] getBestSplit()
        Returnes an optimized list of TileBlocks to generate that tries to minimize the work to benefit ratio, for the set of blocks defined by this block.
      • splitOneGo

        public TileBlock[] splitOneGo()
      • simplify

        public boolean simplify()