Code example for PriorityQueue

0
	 * Abstract default constructor that must be called by subclasses. 
	 */ 
	MapGenerator() { 
		super(); 
		this.jobQueue1 = new PriorityQueue<MapGeneratorJob>(64);
		this.jobQueue2 = new PriorityQueue<MapGeneratorJob>(64);
	} 
 
	@Override 
	public final void run() { 
		setName(getThreadName());
		// create the currentTileBitmap for the tile content 
		Bitmap currentTileBitmap = Bitmap.createBitmap(Tile.TILE_SIZE, Tile.TILE_SIZE,
				Bitmap.Config.RGB_565);
		setupMapGenerator(currentTileBitmap);
 
		MapGeneratorJob currentMapGeneratorJob;
		while (!isInterrupted()) {
			prepareMapGeneration(); 
 
			synchronized (this) {