Code example for SparseArray

Methods: get, indexOfKey

0
	 *  
	 * @param blockID 
	 * @return 
	 */ 
	public BlockHeader getBlockByID(int blockID) {
		if (blockDataList.indexOfKey(blockID) < 0)
			throw new RuntimeException("Block parsing referenced non existant id: " + blockID);
 
		return blockDataList.get(blockID);
	} 
 
	/** 
	 * Get the compression level set in the AWD header. 
	 *  
	 * @return 
	 */ 
	public Compression getCompression() { 
		try { 
			return Compression.values()[awdHeaderCompression];
		} catch (Exception e) {
			throw new RuntimeException("Unknown compression setting detected!");