src/share/classes/java/awt/image/DataBufferInt.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -152,11 +152,11 @@
* @param dataArray The integer arrays for the <CODE>DataBuffer</CODE>.
* @param size The size of the banks in the <CODE>DataBuffer</CODE>.
*/
public DataBufferInt(int dataArray[][], int size) {
super(UNTRACKABLE, TYPE_INT, size, dataArray.length);
- bankdata = (int [][]) dataArray.clone();
+ bankdata = dataArray.clone();
data = bankdata[0];
}
/**
* Constructs an integer-based <CODE>DataBuffer</CODE> with the specified arrays, size,
@@ -177,11 +177,11 @@
* @param size The size of the banks in the <CODE>DataBuffer</CODE>.
* @param offsets The offsets into each array.
*/
public DataBufferInt(int dataArray[][], int size, int offsets[]) {
super(UNTRACKABLE, TYPE_INT, size, dataArray.length, offsets);
- bankdata = (int [][]) dataArray.clone();
+ bankdata = dataArray.clone();
data = bankdata[0];
}
/**
* Returns the default (first) int data array in <CODE>DataBuffer</CODE>.
@@ -224,11 +224,11 @@
*
* @return All of the data arrays.
*/
public int[][] getBankData() {
theTrackable.setUntrackable();
- return (int [][]) bankdata.clone();
+ return bankdata.clone();
}
/**
* Returns the requested data array element from the first (default) bank.
*
@@ -276,9 +276,9 @@
* @param val The integer value to which you want to set the specified data array element.
* @see #getElem(int)
* @see #getElem(int, int)
*/
public void setElem(int bank, int i, int val) {
- bankdata[bank][i+offsets[bank]] = (int)val;
+ bankdata[bank][i+offsets[bank]] = val;
theTrackable.markDirty();
}
}