src/share/classes/java/awt/image/DataBufferUShort.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1997, 2008, 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 --- 1,7 ---- /* ! * 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
*** 172,182 **** if (dataArray[i] == null) { throw new NullPointerException("dataArray["+i+"] is null"); } } ! bankdata = (short[][]) dataArray.clone(); data = bankdata[0]; } /** * Constructs an unsigned-short based <CODE>DataBuffer</CODE> with specified arrays, --- 172,182 ---- if (dataArray[i] == null) { throw new NullPointerException("dataArray["+i+"] is null"); } } ! bankdata = dataArray.clone(); data = bankdata[0]; } /** * Constructs an unsigned-short based <CODE>DataBuffer</CODE> with specified arrays,
*** 211,221 **** "] is less than size+"+ "offsets["+i+"]."); } } ! bankdata = (short[][]) dataArray.clone(); data = bankdata[0]; } /** * Returns the default (first) unsigned-short data array. --- 211,221 ---- "] is less than size+"+ "offsets["+i+"]."); } } ! bankdata = dataArray.clone(); data = bankdata[0]; } /** * Returns the default (first) unsigned-short data array.
*** 258,268 **** * * @return All of the data arrays. */ public short[][] getBankData() { theTrackable.setUntrackable(); ! return (short[][]) bankdata.clone(); } /** * Returns the requested data array element from the first (default) bank. * --- 258,268 ---- * * @return All of the data arrays. */ public short[][] getBankData() { theTrackable.setUntrackable(); ! return bankdata.clone(); } /** * Returns the requested data array element from the first (default) bank. *
*** 270,280 **** * @return The requested data array element as an integer. * @see #setElem(int, int) * @see #setElem(int, int, int) */ public int getElem(int i) { ! return (int)(data[i+offset]&0xffff); } /** * Returns the requested data array element from the specified bank. * --- 270,280 ---- * @return The requested data array element as an integer. * @see #setElem(int, int) * @see #setElem(int, int, int) */ public int getElem(int i) { ! return data[i+offset]&0xffff; } /** * Returns the requested data array element from the specified bank. *
*** 283,293 **** * @return The requested data array element as an integer. * @see #setElem(int, int) * @see #setElem(int, int, int) */ public int getElem(int bank, int i) { ! return (int)(bankdata[bank][i+offsets[bank]]&0xffff); } /** * Sets the requested data array element in the first (default) bank * to the specified value. --- 283,293 ---- * @return The requested data array element as an integer. * @see #setElem(int, int) * @see #setElem(int, int, int) */ public int getElem(int bank, int i) { ! return bankdata[bank][i+offsets[bank]]&0xffff; } /** * Sets the requested data array element in the first (default) bank * to the specified value.