Revision 5484
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.buffer/org.gvsig.raster.lib.buffer.impl/src/main/java/org/gvsig/raster/lib/buffer/impl/DefaultBandDouble.java | ||
---|---|---|
1 | 1 |
package org.gvsig.raster.lib.buffer.impl; |
2 | 2 |
|
3 |
import java.util.Arrays; |
|
4 |
|
|
3 | 5 |
import org.gvsig.raster.lib.buffer.api.Band; |
4 | 6 |
import org.gvsig.raster.lib.buffer.api.Band.BandDouble; |
5 | 7 |
import org.gvsig.raster.lib.buffer.api.BufferManager; |
6 | 8 |
import org.gvsig.raster.lib.buffer.api.NoData; |
7 | 9 |
import org.gvsig.raster.lib.buffer.impl.exceptions.CopyFromBandException; |
8 | 10 |
|
9 |
|
|
10 | 11 |
/** |
11 | 12 |
* @author fdiaz |
12 | 13 |
* |
13 | 14 |
*/ |
14 |
public class DefaultBandDouble extends AbstractBand implements BandDouble{ |
|
15 |
public class DefaultBandDouble extends AbstractBand implements BandDouble {
|
|
15 | 16 |
|
16 | 17 |
double[] data; |
17 | 18 |
|
18 |
|
|
19 | 19 |
/** |
20 | 20 |
* @param rows |
21 | 21 |
* @param columns |
... | ... | |
32 | 32 |
public DefaultBandDouble(int rows, int columns, NoData noData) { |
33 | 33 |
this.rows = rows; |
34 | 34 |
this.columns = columns; |
35 |
data = new double[rows*columns];
|
|
35 |
data = new double[rows * columns];
|
|
36 | 36 |
this.noData = noData; |
37 | 37 |
} |
38 | 38 |
|
... | ... | |
48 | 48 |
|
49 | 49 |
@Override |
50 | 50 |
public void set(int row, int column, Object value) { |
51 |
setValue(row, column, (double)value); |
|
51 |
setValue(row, column, (double) value);
|
|
52 | 52 |
} |
53 | 53 |
|
54 | 54 |
@Override |
55 | 55 |
public void fill(Object value) { |
56 |
double aux = (double) getNoData().getValue(); |
|
57 |
if(value != null){ |
|
58 |
aux = (double)value; |
|
56 |
if (value == null) { |
|
57 |
if (getNoData().isDefined()) { |
|
58 |
value = getNoData().getValue(); |
|
59 |
} else { |
|
60 |
// Do nothing, no data value is defined |
|
61 |
return; |
|
62 |
} |
|
59 | 63 |
} |
60 |
for (int i = 0; i < data.length; i++) { |
|
61 |
data[i] = aux; |
|
62 |
} |
|
64 |
Arrays.fill(data, (double) value); |
|
63 | 65 |
} |
64 | 66 |
|
65 |
double[] getData(){ |
|
67 |
double[] getData() {
|
|
66 | 68 |
return data; |
67 | 69 |
} |
68 | 70 |
|
69 | 71 |
@Override |
70 | 72 |
public void copyFrom(Band source) throws CopyFromBandException { |
71 |
if(this.getColumns()!=source.getColumns() || this.getRows()!=source.getRows() || !(source instanceof DefaultBandDouble)){ |
|
72 |
throw new CopyFromBandException(source,this); |
|
73 |
if (this.getColumns() != source.getColumns() || this.getRows() != source.getRows() |
|
74 |
|| !(source instanceof DefaultBandDouble)) { |
|
75 |
throw new CopyFromBandException(source, this); |
|
73 | 76 |
} |
74 |
System.arraycopy(((DefaultBandDouble)source).getData(), 0, this.data, 0, this.getRows()*this.getColumns()); |
|
77 |
System.arraycopy(((DefaultBandDouble) source).getData(), 0, this.data, 0, this.getRows() |
|
78 |
* this.getColumns()); |
|
75 | 79 |
} |
76 | 80 |
|
77 | 81 |
@Override |
78 | 82 |
public double getValue(int row, int column) { |
79 |
return data[row+column*getColumns()];
|
|
83 |
return data[row + column * getColumns()];
|
|
80 | 84 |
} |
81 | 85 |
|
82 | 86 |
@Override |
83 | 87 |
public void setValue(int row, int column, double value) { |
84 |
data[row+column*getColumns()] = value;
|
|
88 |
data[row + column * getColumns()] = value;
|
|
85 | 89 |
} |
86 | 90 |
|
87 | 91 |
@Override |
... | ... | |
91 | 95 |
|
92 | 96 |
@Override |
93 | 97 |
public void fetchRow(int row, Object rowBuffer) { |
94 |
System.arraycopy(data, row*getColumns(), (double[])rowBuffer, 0, getColumns());
|
|
98 |
System.arraycopy(data, row * getColumns(), (double[]) rowBuffer, 0, getColumns());
|
|
95 | 99 |
|
96 | 100 |
} |
97 | 101 |
|
98 | 102 |
@Override |
99 | 103 |
public void putRow(int row, Object rowBuffer) { |
100 |
System.arraycopy((double[])rowBuffer, 0, data, row*getColumns(), getColumns());
|
|
104 |
System.arraycopy((double[]) rowBuffer, 0, data, row * getColumns(), getColumns());
|
|
101 | 105 |
|
102 | 106 |
} |
103 | 107 |
|
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.buffer/org.gvsig.raster.lib.buffer.impl/src/main/java/org/gvsig/raster/lib/buffer/impl/DefaultBandInt.java | ||
---|---|---|
1 | 1 |
package org.gvsig.raster.lib.buffer.impl; |
2 | 2 |
|
3 |
import java.util.Arrays; |
|
4 |
|
|
3 | 5 |
import org.gvsig.raster.lib.buffer.api.Band; |
4 | 6 |
import org.gvsig.raster.lib.buffer.api.BufferManager; |
5 | 7 |
import org.gvsig.raster.lib.buffer.api.NoData; |
... | ... | |
10 | 12 |
* @author fdiaz |
11 | 13 |
* |
12 | 14 |
*/ |
13 |
public class DefaultBandInt extends AbstractBand implements BandInt{ |
|
15 |
public class DefaultBandInt extends AbstractBand implements BandInt {
|
|
14 | 16 |
|
15 | 17 |
int[] data; |
16 | 18 |
|
17 |
|
|
18 | 19 |
/** |
19 | 20 |
* @param rows |
20 | 21 |
* @param columns |
... | ... | |
31 | 32 |
public DefaultBandInt(int rows, int columns, NoData noData) { |
32 | 33 |
this.rows = rows; |
33 | 34 |
this.columns = columns; |
34 |
data = new int[rows*columns];
|
|
35 |
data = new int[rows * columns];
|
|
35 | 36 |
this.noData = noData; |
36 | 37 |
} |
37 | 38 |
|
... | ... | |
47 | 48 |
|
48 | 49 |
@Override |
49 | 50 |
public void set(int row, int column, Object value) { |
50 |
setValue(row, column, (int)value); |
|
51 |
setValue(row, column, (int) value);
|
|
51 | 52 |
} |
52 | 53 |
|
53 | 54 |
@Override |
54 | 55 |
public void fill(Object value) { |
55 |
int aux = (int) getNoData().getValue(); |
|
56 |
if(value != null){ |
|
57 |
aux = (int)value; |
|
56 |
if (value == null) { |
|
57 |
if (getNoData().isDefined()) { |
|
58 |
value = getNoData().getValue(); |
|
59 |
} else { |
|
60 |
// Do nothing, no data value is defined |
|
61 |
return; |
|
62 |
} |
|
58 | 63 |
} |
59 |
for (int i = 0; i < data.length; i++) { |
|
60 |
data[i] = aux; |
|
61 |
} |
|
64 |
Arrays.fill(data, (int) value); |
|
62 | 65 |
} |
63 | 66 |
|
64 |
int[] getData(){ |
|
67 |
int[] getData() {
|
|
65 | 68 |
return data; |
66 | 69 |
} |
67 | 70 |
|
68 | 71 |
@Override |
69 | 72 |
public void copyFrom(Band source) throws CopyFromBandException { |
70 |
if(this.getColumns()!=source.getColumns() || this.getRows()!=source.getRows() || !(source instanceof DefaultBandInt)){ |
|
71 |
throw new CopyFromBandException(source,this); |
|
73 |
if (this.getColumns() != source.getColumns() || this.getRows() != source.getRows() |
|
74 |
|| !(source instanceof DefaultBandInt)) { |
|
75 |
throw new CopyFromBandException(source, this); |
|
72 | 76 |
} |
73 |
System.arraycopy(((DefaultBandInt)source).getData(), 0, this.data, 0, this.getRows()*this.getColumns()); |
|
77 |
System.arraycopy(((DefaultBandInt) source).getData(), 0, this.data, 0, this.getRows() |
|
78 |
* this.getColumns()); |
|
74 | 79 |
} |
75 | 80 |
|
76 | 81 |
@Override |
77 | 82 |
public int getValue(int row, int column) { |
78 |
return data[row+column*getColumns()];
|
|
83 |
return data[row + column * getColumns()];
|
|
79 | 84 |
} |
80 | 85 |
|
81 | 86 |
@Override |
82 | 87 |
public void setValue(int row, int column, int value) { |
83 |
data[row+column*getColumns()] = value;
|
|
88 |
data[row + column * getColumns()] = value;
|
|
84 | 89 |
} |
85 | 90 |
|
86 | 91 |
@Override |
... | ... | |
90 | 95 |
|
91 | 96 |
@Override |
92 | 97 |
public void fetchRow(int row, Object rowBuffer) { |
93 |
System.arraycopy(data, row*getColumns(), (int[])rowBuffer, 0, getColumns());
|
|
98 |
System.arraycopy(data, row * getColumns(), (int[]) rowBuffer, 0, getColumns());
|
|
94 | 99 |
|
95 | 100 |
} |
96 | 101 |
|
97 | 102 |
@Override |
98 | 103 |
public void putRow(int row, Object rowBuffer) { |
99 |
System.arraycopy((int[])rowBuffer, 0, data, row*getColumns(), getColumns());
|
|
104 |
System.arraycopy((int[]) rowBuffer, 0, data, row * getColumns(), getColumns());
|
|
100 | 105 |
|
101 | 106 |
} |
102 | 107 |
} |
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.buffer/org.gvsig.raster.lib.buffer.impl/src/main/java/org/gvsig/raster/lib/buffer/impl/DefaultBandShort.java | ||
---|---|---|
1 | 1 |
package org.gvsig.raster.lib.buffer.impl; |
2 | 2 |
|
3 |
import java.util.Arrays; |
|
4 |
|
|
3 | 5 |
import org.gvsig.raster.lib.buffer.api.Band; |
4 | 6 |
import org.gvsig.raster.lib.buffer.api.BufferManager; |
5 | 7 |
import org.gvsig.raster.lib.buffer.api.NoData; |
... | ... | |
10 | 12 |
* @author fdiaz |
11 | 13 |
* |
12 | 14 |
*/ |
13 |
public class DefaultBandShort extends AbstractBand implements BandShort{ |
|
15 |
public class DefaultBandShort extends AbstractBand implements BandShort {
|
|
14 | 16 |
|
15 | 17 |
short[] data; |
16 | 18 |
|
17 |
|
|
18 | 19 |
/** |
19 | 20 |
* @param rows |
20 | 21 |
* @param columns |
... | ... | |
31 | 32 |
public DefaultBandShort(int rows, int columns, NoData noData) { |
32 | 33 |
this.rows = rows; |
33 | 34 |
this.columns = columns; |
34 |
data = new short[rows*columns];
|
|
35 |
data = new short[rows * columns];
|
|
35 | 36 |
this.noData = noData; |
36 | 37 |
} |
37 | 38 |
|
... | ... | |
47 | 48 |
|
48 | 49 |
@Override |
49 | 50 |
public void set(int row, int column, Object value) { |
50 |
setValue(row, column, (short)value); |
|
51 |
setValue(row, column, (short) value);
|
|
51 | 52 |
} |
52 | 53 |
|
53 | 54 |
@Override |
54 | 55 |
public void fill(Object value) { |
55 |
short aux = (short) getNoData().getValue(); |
|
56 |
if(value != null){ |
|
57 |
aux = (short)value; |
|
56 |
if (value == null) { |
|
57 |
if (getNoData().isDefined()) { |
|
58 |
value = getNoData().getValue(); |
|
59 |
} else { |
|
60 |
// Do nothing, no data value is defined |
|
61 |
return; |
|
62 |
} |
|
58 | 63 |
} |
59 |
for (int i = 0; i < data.length; i++) { |
|
60 |
data[i] = aux; |
|
61 |
} |
|
64 |
Arrays.fill(data, (short) value); |
|
62 | 65 |
} |
63 | 66 |
|
64 |
short[] getData(){ |
|
67 |
short[] getData() {
|
|
65 | 68 |
return data; |
66 | 69 |
} |
67 | 70 |
|
68 | 71 |
@Override |
69 | 72 |
public void copyFrom(Band source) throws CopyFromBandException { |
70 |
if(this.getColumns()!=source.getColumns() || this.getRows()!=source.getRows() || !(source instanceof DefaultBandShort)){ |
|
71 |
throw new CopyFromBandException(source,this); |
|
73 |
if (this.getColumns() != source.getColumns() || this.getRows() != source.getRows() |
|
74 |
|| !(source instanceof DefaultBandShort)) { |
|
75 |
throw new CopyFromBandException(source, this); |
|
72 | 76 |
} |
73 |
System.arraycopy(((DefaultBandShort)source).getData(), 0, this.data, 0, this.getRows()*this.getColumns()); |
|
77 |
System.arraycopy(((DefaultBandShort) source).getData(), 0, this.data, 0, this.getRows() |
|
78 |
* this.getColumns()); |
|
74 | 79 |
} |
75 | 80 |
|
76 | 81 |
@Override |
77 | 82 |
public short getValue(int row, int column) { |
78 |
return data[row+column*getColumns()];
|
|
83 |
return data[row + column * getColumns()];
|
|
79 | 84 |
} |
80 | 85 |
|
81 | 86 |
@Override |
82 | 87 |
public void setValue(int row, int column, short value) { |
83 |
data[row+column*getColumns()] = value;
|
|
88 |
data[row + column * getColumns()] = value;
|
|
84 | 89 |
} |
85 | 90 |
|
86 | 91 |
@Override |
... | ... | |
90 | 95 |
|
91 | 96 |
@Override |
92 | 97 |
public void fetchRow(int row, Object rowBuffer) { |
93 |
System.arraycopy(data, row*getColumns(), (short[])rowBuffer, 0, getColumns());
|
|
98 |
System.arraycopy(data, row * getColumns(), (short[]) rowBuffer, 0, getColumns());
|
|
94 | 99 |
|
95 | 100 |
} |
96 | 101 |
|
97 | 102 |
@Override |
98 | 103 |
public void putRow(int row, Object rowBuffer) { |
99 |
System.arraycopy((short[])rowBuffer, 0, data, row*getColumns(), getColumns());
|
|
104 |
System.arraycopy((short[]) rowBuffer, 0, data, row * getColumns(), getColumns());
|
|
100 | 105 |
|
101 | 106 |
} |
102 | 107 |
|
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.buffer/org.gvsig.raster.lib.buffer.impl/src/main/java/org/gvsig/raster/lib/buffer/impl/DefaultBandByte.java | ||
---|---|---|
1 | 1 |
package org.gvsig.raster.lib.buffer.impl; |
2 | 2 |
|
3 |
import java.util.Arrays; |
|
4 |
|
|
3 | 5 |
import org.gvsig.raster.lib.buffer.api.Band; |
4 | 6 |
import org.gvsig.raster.lib.buffer.api.BufferManager; |
5 | 7 |
import org.gvsig.raster.lib.buffer.api.NoData; |
... | ... | |
10 | 12 |
* @author fdiaz |
11 | 13 |
* |
12 | 14 |
*/ |
13 |
public class DefaultBandByte extends AbstractBand implements BandByte{ |
|
15 |
public class DefaultBandByte extends AbstractBand implements BandByte {
|
|
14 | 16 |
|
15 | 17 |
byte[] data; |
16 | 18 |
|
17 |
|
|
18 | 19 |
/** |
19 | 20 |
* @param rows |
20 | 21 |
* @param columns |
21 | 22 |
*/ |
22 | 23 |
public DefaultBandByte(int rows, int columns) { |
23 |
this(rows, columns, null);
|
|
24 |
this(rows, columns, new DefaultNoData(null));
|
|
24 | 25 |
} |
25 | 26 |
|
26 | 27 |
/** |
... | ... | |
31 | 32 |
public DefaultBandByte(int rows, int columns, NoData noData) { |
32 | 33 |
this.rows = rows; |
33 | 34 |
this.columns = columns; |
34 |
data = new byte[rows*columns];
|
|
35 |
data = new byte[rows * columns];
|
|
35 | 36 |
this.noData = noData; |
36 | 37 |
} |
37 | 38 |
|
... | ... | |
47 | 48 |
|
48 | 49 |
@Override |
49 | 50 |
public void set(int row, int column, Object value) { |
50 |
setValue(row, column, (byte)value); |
|
51 |
setValue(row, column, (byte) value);
|
|
51 | 52 |
} |
52 | 53 |
|
53 | 54 |
@Override |
54 | 55 |
public void fill(Object value) { |
55 |
byte aux = (byte) getNoData().getValue(); |
|
56 |
if(value != null){ |
|
57 |
aux = (byte)value; |
|
56 |
if (value == null) { |
|
57 |
if (getNoData().isDefined()) { |
|
58 |
value = getNoData().getValue(); |
|
59 |
} else { |
|
60 |
// Do nothing, no data value is defined |
|
61 |
return; |
|
62 |
} |
|
58 | 63 |
} |
59 |
for (int i = 0; i < data.length; i++) { |
|
60 |
data[i] = aux; |
|
61 |
} |
|
64 |
Arrays.fill(data, (byte) value); |
|
62 | 65 |
} |
63 | 66 |
|
64 |
byte[] getData(){ |
|
67 |
byte[] getData() {
|
|
65 | 68 |
return data; |
66 | 69 |
} |
67 | 70 |
|
68 | 71 |
@Override |
69 | 72 |
public void copyFrom(Band source) throws CopyFromBandException { |
70 |
if(this.getColumns()!=source.getColumns() || this.getRows()!=source.getRows() || !(source instanceof DefaultBandByte)){ |
|
71 |
throw new CopyFromBandException(source,this); |
|
73 |
if (this.getColumns() != source.getColumns() || this.getRows() != source.getRows() |
|
74 |
|| !(source instanceof DefaultBandByte)) { |
|
75 |
throw new CopyFromBandException(source, this); |
|
72 | 76 |
} |
73 |
System.arraycopy(((DefaultBandByte)source).getData(), 0, this.data, 0, this.getRows()*this.getColumns()); |
|
77 |
System.arraycopy(((DefaultBandByte) source).getData(), 0, this.data, 0, this.getRows() |
|
78 |
* this.getColumns()); |
|
74 | 79 |
} |
75 | 80 |
|
76 | 81 |
@Override |
77 | 82 |
public byte getValue(int row, int column) { |
78 |
return data[row+column*getColumns()];
|
|
83 |
return data[row + column * getColumns()];
|
|
79 | 84 |
} |
80 | 85 |
|
81 | 86 |
@Override |
82 | 87 |
public void setValue(int row, int column, byte value) { |
83 |
data[row+column*getColumns()] = value;
|
|
88 |
data[row + column * getColumns()] = value;
|
|
84 | 89 |
} |
85 | 90 |
|
86 | 91 |
@Override |
... | ... | |
90 | 95 |
|
91 | 96 |
@Override |
92 | 97 |
public void fetchRow(int row, Object rowBuffer) { |
93 |
System.arraycopy(data, row*getColumns(), (byte[])rowBuffer, 0, getColumns());
|
|
98 |
System.arraycopy(data, row * getColumns(), (byte[]) rowBuffer, 0, getColumns());
|
|
94 | 99 |
|
95 | 100 |
} |
96 | 101 |
|
97 | 102 |
@Override |
98 | 103 |
public void putRow(int row, Object rowBuffer) { |
99 |
System.arraycopy((byte[])rowBuffer, 0, data, row*getColumns(), getColumns());
|
|
104 |
System.arraycopy((byte[]) rowBuffer, 0, data, row * getColumns(), getColumns());
|
|
100 | 105 |
|
101 | 106 |
} |
102 | 107 |
|
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.buffer/org.gvsig.raster.lib.buffer.impl/src/main/java/org/gvsig/raster/lib/buffer/impl/DefaultBandFloat.java | ||
---|---|---|
1 | 1 |
package org.gvsig.raster.lib.buffer.impl; |
2 | 2 |
|
3 |
import java.util.Arrays; |
|
4 |
|
|
3 | 5 |
import org.gvsig.raster.lib.buffer.api.Band; |
4 | 6 |
import org.gvsig.raster.lib.buffer.api.BufferManager; |
5 | 7 |
import org.gvsig.raster.lib.buffer.api.NoData; |
... | ... | |
10 | 12 |
* @author fdiaz |
11 | 13 |
* |
12 | 14 |
*/ |
13 |
public class DefaultBandFloat extends AbstractBand implements BandFloat{ |
|
15 |
public class DefaultBandFloat extends AbstractBand implements BandFloat {
|
|
14 | 16 |
|
15 | 17 |
float[] data; |
16 | 18 |
|
17 |
|
|
18 | 19 |
/** |
19 | 20 |
* @param rows |
20 | 21 |
* @param columns |
... | ... | |
31 | 32 |
public DefaultBandFloat(int rows, int columns, NoData noData) { |
32 | 33 |
this.rows = rows; |
33 | 34 |
this.columns = columns; |
34 |
data = new float[rows*columns];
|
|
35 |
data = new float[rows * columns];
|
|
35 | 36 |
this.noData = noData; |
36 | 37 |
} |
37 | 38 |
|
... | ... | |
47 | 48 |
|
48 | 49 |
@Override |
49 | 50 |
public void set(int row, int column, Object value) { |
50 |
setValue(row, column, (float)value); |
|
51 |
setValue(row, column, (float) value);
|
|
51 | 52 |
} |
52 | 53 |
|
53 | 54 |
@Override |
54 | 55 |
public void fill(Object value) { |
55 |
float aux = (float) getNoData().getValue(); |
|
56 |
if(value != null){ |
|
57 |
aux = (float)value; |
|
56 |
if (value == null) { |
|
57 |
if (getNoData().isDefined()) { |
|
58 |
value = getNoData().getValue(); |
|
59 |
} else { |
|
60 |
// Do nothing, no data value is defined |
|
61 |
return; |
|
62 |
} |
|
58 | 63 |
} |
59 |
for (int i = 0; i < data.length; i++) { |
|
60 |
data[i] = aux; |
|
61 |
} |
|
64 |
Arrays.fill(data, (float) value); |
|
62 | 65 |
} |
63 | 66 |
|
64 |
float[] getData(){ |
|
67 |
float[] getData() {
|
|
65 | 68 |
return data; |
66 | 69 |
} |
67 | 70 |
|
68 | 71 |
@Override |
69 | 72 |
public void copyFrom(Band source) throws CopyFromBandException { |
70 |
if(this.getColumns()!=source.getColumns() || this.getRows()!=source.getRows() || !(source instanceof DefaultBandFloat)){ |
|
71 |
throw new CopyFromBandException(source,this); |
|
73 |
if (this.getColumns() != source.getColumns() || this.getRows() != source.getRows() |
|
74 |
|| !(source instanceof DefaultBandFloat)) { |
|
75 |
throw new CopyFromBandException(source, this); |
|
72 | 76 |
} |
73 |
System.arraycopy(((DefaultBandFloat)source).getData(), 0, this.data, 0, this.getRows()*this.getColumns()); |
|
77 |
System.arraycopy(((DefaultBandFloat) source).getData(), 0, this.data, 0, this.getRows() |
|
78 |
* this.getColumns()); |
|
74 | 79 |
} |
75 | 80 |
|
76 | 81 |
@Override |
77 | 82 |
public float getValue(int row, int column) { |
78 |
return data[row+column*getColumns()];
|
|
83 |
return data[row + column * getColumns()];
|
|
79 | 84 |
} |
80 | 85 |
|
81 | 86 |
@Override |
82 | 87 |
public void setValue(int row, int column, float value) { |
83 |
data[row+column*getColumns()] = value;
|
|
88 |
data[row + column * getColumns()] = value;
|
|
84 | 89 |
} |
85 | 90 |
|
86 | 91 |
@Override |
... | ... | |
90 | 95 |
|
91 | 96 |
@Override |
92 | 97 |
public void fetchRow(int row, Object rowBuffer) { |
93 |
System.arraycopy(data, row*getColumns(), (float[])rowBuffer, 0, getColumns());
|
|
98 |
System.arraycopy(data, row * getColumns(), (float[]) rowBuffer, 0, getColumns());
|
|
94 | 99 |
|
95 | 100 |
} |
96 | 101 |
|
97 | 102 |
@Override |
98 | 103 |
public void putRow(int row, Object rowBuffer) { |
99 |
System.arraycopy((float[])rowBuffer, 0, data, row*getColumns(), getColumns());
|
|
104 |
System.arraycopy((float[]) rowBuffer, 0, data, row * getColumns(), getColumns());
|
|
100 | 105 |
|
101 | 106 |
} |
102 | 107 |
|
Also available in: Unified diff