/** * Tests whether this ProductData is equal to another one. * Performs an element-wise comparision if the other object is a {@link ProductData} instance of the same data type. * Otherwise the method behaves like {@link Object#equals(Object)}. * * @param other the other one */ @Override public boolean equalElems(ProductData other) { if (other == this) { return true; } else if (other instanceof ProductData.Float) { return Arrays.equals(_array, ((ProductData.Float) other).getArray()); } return false; }
public DirectTile(RasterDataNode rasterDataNode, ProductData dataBuffer, Rectangle rectangle, boolean target) { Assert.notNull(rasterDataNode, "rasterDataNode"); this.rasterDataNode = rasterDataNode; this.dataBuffer = dataBuffer; this.minX = rectangle.x; this.minY = rectangle.y; this.maxX = rectangle.x + rectangle.width - 1; this.maxY = rectangle.y + rectangle.height - 1; this.width = rectangle.width; this.height = rectangle.height; this.target = target; this.scaled = rasterDataNode.isScalingApplied(); this.signedByte = rasterDataNode.getDataType() == ProductData.TYPE_INT8; this.dataBufferByte = (dataBuffer instanceof ProductData.Byte) ? ((ProductData.Byte) dataBuffer).getArray() : null; this.dataBufferShort = (dataBuffer instanceof ProductData.Short) ? ((ProductData.Short) dataBuffer).getArray() : null; this.dataBufferInt = (dataBuffer instanceof ProductData.Int) ? ((ProductData.Int) dataBuffer).getArray() : null; this.dataBufferFloat = (dataBuffer instanceof ProductData.Float) ? ((ProductData.Float) dataBuffer).getArray() : null; this.dataBufferDouble = (dataBuffer instanceof ProductData.Double) ? ((ProductData.Double) dataBuffer).getArray() : null; }