/** * Constructs a new instance initialized with the values from the specified metadata object. * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the * given object are not recursively copied. * * <div class="note"><b>Note on properties validation:</b> * This constructor does not verify the property values of the given metadata (e.g. whether it contains * unexpected negative values). This is because invalid metadata exist in practice, and verifying their * validity in this copy constructor is often too late. Note that this is not the only hole, as invalid * metadata instances can also be obtained by unmarshalling an invalid XML document. * </div> * * @param object the metadata to copy values from, or {@code null} if none. * * @see #castOrCopy(GridSpatialRepresentation) */ public DefaultGridSpatialRepresentation(final GridSpatialRepresentation object) { super(object); if (object != null) { numberOfDimensions = object.getNumberOfDimensions(); axisDimensionProperties = copyList(object.getAxisDimensionProperties(), Dimension.class); cellGeometry = object.getCellGeometry(); if (object.isTransformationParameterAvailable()) { booleans = TRANSFORMATION_MASK; } } }
for (final Dimension dim : ((GridSpatialRepresentation) metadata).getAxisDimensionProperties()) { final Integer size = dim.getDimensionSize(); if (size != null) {
/** * Constructs a new instance initialized with the values from the specified metadata object. * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the * given object are not recursively copied. * * <div class="note"><b>Note on properties validation:</b> * This constructor does not verify the property values of the given metadata (e.g. whether it contains * unexpected negative values). This is because invalid metadata exist in practice, and verifying their * validity in this copy constructor is often too late. Note that this is not the only hole, as invalid * metadata instances can also be obtained by unmarshalling an invalid XML document. * </div> * * @param object the metadata to copy values from, or {@code null} if none. * * @see #castOrCopy(GridSpatialRepresentation) */ public DefaultGridSpatialRepresentation(final GridSpatialRepresentation object) { super(object); if (object != null) { numberOfDimensions = object.getNumberOfDimensions(); axisDimensionProperties = copyList(object.getAxisDimensionProperties(), Dimension.class); cellGeometry = object.getCellGeometry(); if (object.isTransformationParameterAvailable()) { booleans = TRANSFORMATION_MASK; } } }