You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2013/03/28 16:25:54 UTC
svn commit: r1462152 [4/5] - in
/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis:
internal/jaxb/gmi/ metadata/ metadata/iso/ metadata/iso/acquisition/
metadata/iso/citation/ metadata/iso/constraint/ metadata/iso/content/
metadata/iso/distri...
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -116,12 +116,38 @@ public class DefaultMaintenanceInformati
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
+ *
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(MaintenanceInformation)
+ */
+ public DefaultMaintenanceInformation(final MaintenanceInformation object) {
+ super(object);
+ maintenanceAndUpdateFrequency = object.getMaintenanceAndUpdateFrequency();
+// TODO dateOfNextUpdate = object.getDateOfNextUpdate();
+ userDefinedMaintenanceFrequency = object.getUserDefinedMaintenanceFrequency();
+ updateScopes = copyCollection(object.getUpdateScopes(), ScopeCode.class);
+ updateScopeDescriptions = copyCollection(object.getUpdateScopeDescriptions(), ScopeDescription.class);
+ maintenanceNotes = copyCollection(object.getMaintenanceNotes(), InternationalString.class);
+ contacts = copyCollection(object.getContacts(), ResponsibleParty.class);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultMaintenanceInformation}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultMaintenanceInformation} instance is created using the
+ * {@linkplain #DefaultMaintenanceInformation(MaintenanceInformation) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -131,9 +157,7 @@ public class DefaultMaintenanceInformati
if (object == null || object instanceof DefaultMaintenanceInformation) {
return (DefaultMaintenanceInformation) object;
}
- final DefaultMaintenanceInformation copy = new DefaultMaintenanceInformation();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultMaintenanceInformation(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -85,12 +85,37 @@ public class DefaultScopeDescription ext
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
+ *
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(ScopeDescription)
+ */
+ public DefaultScopeDescription(final ScopeDescription object) {
+ super(object);
+ dataset = object.getDataset();
+ other = object.getOther();
+ attributeInstances = copySet(object.getAttributeInstances(), AttributeType.class);
+ attributes = copySet(object.getAttributes(), AttributeType.class);
+ featureInstances = copySet(object.getFeatureInstances(), FeatureType.class);
+ features = copySet(object.getFeatures(), FeatureType.class);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultScopeDescription}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultScopeDescription} instance is created using the
+ * {@linkplain #DefaultScopeDescription(ScopeDescription) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -100,9 +125,7 @@ public class DefaultScopeDescription ext
if (object == null || object instanceof DefaultScopeDescription) {
return (DefaultScopeDescription) object;
}
- final DefaultScopeDescription copy = new DefaultScopeDescription();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultScopeDescription(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractCompleteness.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractCompleteness.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractCompleteness.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractCompleteness.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -52,18 +52,36 @@ public class AbstractCompleteness extend
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
*
- * <p>This method checks for the {@link CompletenessCommission} and {@link CompletenessOmission}
- * sub-interfaces. If one of those interfaces is found, then this method delegates to
- * the corresponding {@code castOrCopy} static method. If the given object implements more
- * than one of the above-cited interfaces, then the {@code castOrCopy} method to be used is
- * unspecified.</p>
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(Completeness)
+ */
+ public AbstractCompleteness(final Completeness object) {
+ super(object);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is is an instance of {@link CompletenessCommission} or
+ * {@link CompletenessOmission}, then this method delegates to the {@code castOrCopy(…)}
+ * method of the corresponding SIS subclass. Note that if the given object implements
+ * more than one of the above-cited interfaces, then the {@code castOrCopy(…)} method
+ * to be used is unspecified.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code AbstractCompleteness}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code AbstractCompleteness} instance is created using the
+ * {@linkplain #AbstractCompleteness(Completeness) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -76,11 +94,10 @@ public class AbstractCompleteness extend
if (object instanceof CompletenessOmission) {
return DefaultCompletenessOmission.castOrCopy((CompletenessOmission) object);
}
+ // Intentionally tested after the sub-interfaces.
if (object == null || object instanceof AbstractCompleteness) {
return (AbstractCompleteness) object;
}
- final AbstractCompleteness copy = new AbstractCompleteness();
- copy.shallowCopy(object);
- return copy;
+ return new AbstractCompleteness(object);
}
}
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -139,19 +139,45 @@ public class AbstractElement extends ISO
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
- *
- * <p>This method checks for the {@link PositionalAccuracy}, {@link TemporalAccuracy},
- * {@link ThematicAccuracy}, {@link LogicalConsistency}, {@link Completeness} and
- * {@link Usability} sub-interfaces. If one of those interfaces is found, then this method
- * delegates to the corresponding {@code castOrCopy} static method. If the given object implements
- * more than one of the above-cited interfaces, then the {@code castOrCopy} method to be used is
- * unspecified.</p>
+ * 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.
+ *
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(Element)
+ */
+ public AbstractElement(final Element object) {
+ super(object);
+ namesOfMeasure = copyCollection(object.getNamesOfMeasure(), InternationalString.class);
+ measureIdentification = object.getMeasureIdentification();
+ measureDescription = object.getMeasureDescription();
+ evaluationMethodType = object.getEvaluationMethodType();
+ evaluationMethodDescription = object.getEvaluationMethodDescription();
+ evaluationProcedure = object.getEvaluationProcedure();
+// TODO dates = copyCollection(object.getDates(), Date.class);
+ results = copyCollection(object.getResults(), Result.class);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is is an instance of {@link PositionalAccuracy},
+ * {@link TemporalAccuracy}, {@link ThematicAccuracy}, {@link LogicalConsistency},
+ * {@link Completeness} or {@link Usability}, then this method delegates to the
+ * {@code castOrCopy(…)} method of the corresponding SIS subclass.
+ * Note that if the given object implements more than one of the above-cited interfaces,
+ * then the {@code castOrCopy(…)} method to be used is unspecified.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code AbstractElement}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code AbstractElement} instance is created using the
+ * {@linkplain #AbstractElement(Element) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -176,12 +202,11 @@ public class AbstractElement extends ISO
if (object instanceof Usability) {
return DefaultUsability.castOrCopy((Usability) object);
}
+ // Intentionally tested after the sub-interfaces.
if (object == null || object instanceof AbstractElement) {
return (AbstractElement) object;
}
- final AbstractElement copy = new AbstractElement();
- copy.shallowCopy(object);
- return copy;
+ return new AbstractElement(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractLogicalConsistency.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractLogicalConsistency.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractLogicalConsistency.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractLogicalConsistency.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -57,18 +57,36 @@ public class AbstractLogicalConsistency
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
*
- * <p>This method checks for the {@link ConceptualConsistency}, {@link DomainConsistency},
- * {@link FormatConsistency} and {@link TopologicalConsistency} sub-interfaces.
- * If one of those interfaces is found, then this method delegates to the corresponding
- * {@code castOrCopy} static method. If the given object implements more than one of the
- * above-cited interfaces, then the {@code castOrCopy} method to be used is unspecified.</p>
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(LogicalConsistency)
+ */
+ public AbstractLogicalConsistency(final LogicalConsistency object) {
+ super(object);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is is an instance of {@link ConceptualConsistency},
+ * {@link DomainConsistency}, {@link FormatConsistency} or {@link TopologicalConsistency},
+ * then this method delegates to the {@code castOrCopy(…)} method of the corresponding SIS subclass.
+ * Note that if the given object implements more than one of the above-cited interfaces,
+ * then the {@code castOrCopy(…)} method to be used is unspecified.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code AbstractLogicalConsistency}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code AbstractLogicalConsistency} instance is created using the
+ * {@linkplain #AbstractLogicalConsistency(LogicalConsistency) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -87,11 +105,10 @@ public class AbstractLogicalConsistency
if (object instanceof TopologicalConsistency) {
return DefaultTopologicalConsistency.castOrCopy((TopologicalConsistency) object);
}
+ // Intentionally tested after the sub-interfaces.
if (object == null || object instanceof AbstractLogicalConsistency) {
return (AbstractLogicalConsistency) object;
}
- final AbstractLogicalConsistency copy = new AbstractLogicalConsistency();
- copy.shallowCopy(object);
- return copy;
+ return new AbstractLogicalConsistency(object);
}
}
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracy.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracy.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -65,18 +65,36 @@ public class AbstractPositionalAccuracy
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
*
- * <p>This method checks for the {@link GriddedDataPositionalAccuracy},
- * {@link AbsoluteExternalPositionalAccuracy} and {@link RelativeInternalPositionalAccuracy}
- * sub-interfaces. If one of those interfaces is found, then this method delegates to the
- * corresponding {@code castOrCopy} static method. If the given object implements more than one
- * of the above-cited interfaces, then the {@code castOrCopy} method to be used is unspecified.</p>
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(PositionalAccuracy)
+ */
+ public AbstractPositionalAccuracy(final PositionalAccuracy object) {
+ super(object);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is is an instance of {@link RelativeInternalPositionalAccuracy},
+ * {@link AbsoluteExternalPositionalAccuracy} or {@link GriddedDataPositionalAccuracy}, then this
+ * method delegates to the {@code castOrCopy(…)} method of the corresponding SIS subclass.
+ * Note that if the given object implements more than one of the above-cited interfaces,
+ * then the {@code castOrCopy(…)} method to be used is unspecified.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code AbstractPositionalAccuracy}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code AbstractPositionalAccuracy} instance is created using the
+ * {@linkplain #AbstractPositionalAccuracy(PositionalAccuracy) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -92,11 +110,10 @@ public class AbstractPositionalAccuracy
if (object instanceof RelativeInternalPositionalAccuracy) {
return DefaultRelativeInternalPositionalAccuracy.castOrCopy((RelativeInternalPositionalAccuracy) object);
}
+ // Intentionally tested after the sub-interfaces.
if (object == null || object instanceof AbstractPositionalAccuracy) {
return (AbstractPositionalAccuracy) object;
}
- final AbstractPositionalAccuracy copy = new AbstractPositionalAccuracy();
- copy.shallowCopy(object);
- return copy;
+ return new AbstractPositionalAccuracy(object);
}
}
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -55,18 +55,36 @@ public class AbstractResult extends ISOM
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
*
- * <p>This method checks for the {@link CoverageResult}, {@link QuantitativeResult}, and
- * {@link ConformanceResult} sub-interfaces. If one of those interfaces is found, then
- * this method delegates to the corresponding {@code castOrCopy} static method. If the given
- * object implements more than one of the above-cited interfaces, then the {@code castOrCopy}
- * method to be used is unspecified.</p>
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(Result)
+ */
+ public AbstractResult(final Result object) {
+ super(object);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is is an instance of {@link ConformanceResult},
+ * {@link QuantitativeResult}or {@link CoverageResult}, then this method delegates to
+ * the {@code castOrCopy(…)} method of the corresponding SIS subclass.
+ * Note that if the given object implements more than one of the above-cited interfaces,
+ * then the {@code castOrCopy(…)} method to be used is unspecified.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code AbstractResult}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code AbstractResult} instance is created using the
+ * {@linkplain #AbstractResult(Result) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -82,11 +100,10 @@ public class AbstractResult extends ISOM
if (object instanceof ConformanceResult) {
return DefaultConformanceResult.castOrCopy((ConformanceResult) object);
}
+ // Intentionally tested after the sub-interfaces.
if (object == null || object instanceof AbstractResult) {
return (AbstractResult) object;
}
- final AbstractResult copy = new AbstractResult();
- copy.shallowCopy(object);
- return copy;
+ return new AbstractResult(object);
}
}
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalAccuracy.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalAccuracy.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -54,18 +54,36 @@ public class AbstractTemporalAccuracy ex
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
*
- * <p>This method checks for the {@link AccuracyOfATimeMeasurement}, {@link TemporalConsistency}
- * and {@link TemporalValidity} sub-interfaces. If one of those interfaces is found, then this
- * method delegates to the corresponding {@code castOrCopy} static method. If the given object
- * implements more than one of the above-cited interfaces, then the {@code castOrCopy} method to
- * be used is unspecified.</p>
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(TemporalAccuracy)
+ */
+ public AbstractTemporalAccuracy(final TemporalAccuracy object) {
+ super(object);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is is an instance of {@link AccuracyOfATimeMeasurement},
+ * {@link TemporalConsistency} or {@link TemporalValidity}, then this method delegates to
+ * the {@code castOrCopy(…)} method of the corresponding SIS subclass.
+ * Note that if the given object implements more than one of the above-cited interfaces,
+ * then the {@code castOrCopy(…)} method to be used is unspecified.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code AbstractTemporalAccuracy}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code AbstractTemporalAccuracy} instance is created using the
+ * {@linkplain #AbstractTemporalAccuracy(TemporalAccuracy) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -81,11 +99,10 @@ public class AbstractTemporalAccuracy ex
if (object instanceof TemporalValidity) {
return DefaultTemporalValidity.castOrCopy((TemporalValidity) object);
}
+ // Intentionally tested after the sub-interfaces.
if (object == null || object instanceof AbstractTemporalAccuracy) {
return (AbstractTemporalAccuracy) object;
}
- final AbstractTemporalAccuracy copy = new AbstractTemporalAccuracy();
- copy.shallowCopy(object);
- return copy;
+ return new AbstractTemporalAccuracy(object);
}
}
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -55,19 +55,36 @@ public class AbstractThematicAccuracy ex
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
*
- * <p>This method checks for the {@link QuantitativeAttributeAccuracy},
- * {@link NonQuantitativeAttributeAccuracy} and {@link ThematicClassificationCorrectness}
- * sub-interfaces. If one of those interfaces is found, then this method delegates to
- * the corresponding {@code castOrCopy} static method. If the given object implements more
- * than one of the above-cited interfaces, then the {@code castOrCopy} method to be used is
- * unspecified.</p>
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(ThematicAccuracy)
+ */
+ public AbstractThematicAccuracy(final ThematicAccuracy object) {
+ super(object);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is is an instance of {@link QuantitativeAttributeAccuracy},
+ * {@link NonQuantitativeAttributeAccuracy} or {@link ThematicClassificationCorrectness},
+ * then this method delegates to the {@code castOrCopy(…)} method of the corresponding
+ * SIS subclass. Note that if the given object implements more than one of the above-cited
+ * interfaces, then the {@code castOrCopy(…)} method to be used is unspecified.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code AbstractThematicAccuracy}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code AbstractThematicAccuracy} instance is created using the
+ * {@linkplain #AbstractThematicAccuracy(ThematicAccuracy) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -83,11 +100,10 @@ public class AbstractThematicAccuracy ex
if (object instanceof ThematicClassificationCorrectness) {
return DefaultThematicClassificationCorrectness.castOrCopy((ThematicClassificationCorrectness) object);
}
+ // Intentionally tested after the sub-interfaces.
if (object == null || object instanceof AbstractThematicAccuracy) {
return (AbstractThematicAccuracy) object;
}
- final AbstractThematicAccuracy copy = new AbstractThematicAccuracy();
- copy.shallowCopy(object);
- return copy;
+ return new AbstractThematicAccuracy(object);
}
}
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -58,12 +58,31 @@ public class DefaultAbsoluteExternalPosi
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
+ *
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(AbsoluteExternalPositionalAccuracy)
+ */
+ public DefaultAbsoluteExternalPositionalAccuracy(final AbsoluteExternalPositionalAccuracy object) {
+ super(object);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultAbsoluteExternalPositionalAccuracy}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultAbsoluteExternalPositionalAccuracy} instance is created using the
+ * {@linkplain #DefaultAbsoluteExternalPositionalAccuracy(AbsoluteExternalPositionalAccuracy) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -73,8 +92,6 @@ public class DefaultAbsoluteExternalPosi
if (object == null || object instanceof DefaultAbsoluteExternalPositionalAccuracy) {
return (DefaultAbsoluteExternalPositionalAccuracy) object;
}
- final DefaultAbsoluteExternalPositionalAccuracy copy = new DefaultAbsoluteExternalPositionalAccuracy();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultAbsoluteExternalPositionalAccuracy(object);
}
}
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -47,12 +47,31 @@ public class DefaultAccuracyOfATimeMeasu
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
+ *
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(AccuracyOfATimeMeasurement)
+ */
+ public DefaultAccuracyOfATimeMeasurement(final AccuracyOfATimeMeasurement object) {
+ super(object);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultAccuracyOfATimeMeasurement}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultAccuracyOfATimeMeasurement} instance is created using the
+ * {@linkplain #DefaultAccuracyOfATimeMeasurement(AccuracyOfATimeMeasurement) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -62,8 +81,6 @@ public class DefaultAccuracyOfATimeMeasu
if (object == null || object instanceof DefaultAccuracyOfATimeMeasurement) {
return (DefaultAccuracyOfATimeMeasurement) object;
}
- final DefaultAccuracyOfATimeMeasurement copy = new DefaultAccuracyOfATimeMeasurement();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultAccuracyOfATimeMeasurement(object);
}
}
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -45,12 +45,31 @@ public class DefaultCompletenessCommissi
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
+ *
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(CompletenessCommission)
+ */
+ public DefaultCompletenessCommission(final CompletenessCommission object) {
+ super(object);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultCompletenessCommission}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultCompletenessCommission} instance is created using the
+ * {@linkplain #DefaultCompletenessCommission(CompletenessCommission) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -60,8 +79,6 @@ public class DefaultCompletenessCommissi
if (object == null || object instanceof DefaultCompletenessCommission) {
return (DefaultCompletenessCommission) object;
}
- final DefaultCompletenessCommission copy = new DefaultCompletenessCommission();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultCompletenessCommission(object);
}
}
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -45,12 +45,31 @@ public class DefaultCompletenessOmission
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
+ *
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(CompletenessOmission)
+ */
+ public DefaultCompletenessOmission(final CompletenessOmission object) {
+ super(object);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultCompletenessOmission}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultCompletenessOmission} instance is created using the
+ * {@linkplain #DefaultCompletenessOmission(CompletenessOmission) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -60,8 +79,6 @@ public class DefaultCompletenessOmission
if (object == null || object instanceof DefaultCompletenessOmission) {
return (DefaultCompletenessOmission) object;
}
- final DefaultCompletenessOmission copy = new DefaultCompletenessOmission();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultCompletenessOmission(object);
}
}
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -47,12 +47,31 @@ public class DefaultConceptualConsistenc
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
+ *
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(ConceptualConsistency)
+ */
+ public DefaultConceptualConsistency(final ConceptualConsistency object) {
+ super(object);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultConceptualConsistency}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultConceptualConsistency} instance is created using the
+ * {@linkplain #DefaultConceptualConsistency(ConceptualConsistency) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -62,8 +81,6 @@ public class DefaultConceptualConsistenc
if (object == null || object instanceof DefaultConceptualConsistency) {
return (DefaultConceptualConsistency) object;
}
- final DefaultConceptualConsistency copy = new DefaultConceptualConsistency();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultConceptualConsistency(object);
}
}
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConformanceResult.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConformanceResult.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConformanceResult.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConformanceResult.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -90,12 +90,34 @@ public class DefaultConformanceResult ex
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
+ *
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(ConformanceResult)
+ */
+ public DefaultConformanceResult(final ConformanceResult object) {
+ super(object);
+ specification = object.getSpecification();
+ explanation = object.getExplanation();
+ pass = object.pass();
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultConformanceResult}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultConformanceResult} instance is created using the
+ * {@linkplain #DefaultConformanceResult(ConformanceResult) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -105,9 +127,7 @@ public class DefaultConformanceResult ex
if (object == null || object instanceof DefaultConformanceResult) {
return (DefaultConformanceResult) object;
}
- final DefaultConformanceResult copy = new DefaultConformanceResult();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultConformanceResult(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -84,12 +84,36 @@ public class DefaultCoverageResult exten
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
+ *
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(CoverageResult)
+ */
+ public DefaultCoverageResult(final CoverageResult object) {
+ super(object);
+ spatialRepresentationType = object.getSpatialRepresentationType();
+ resultSpatialRepresentation = object.getResultSpatialRepresentation();
+ resultContentDescription = object.getResultContentDescription();
+ resultFormat = object.getResultFormat();
+ resultFile = object.getResultFile();
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultCoverageResult}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultCoverageResult} instance is created using the
+ * {@linkplain #DefaultCoverageResult(CoverageResult) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -99,9 +123,7 @@ public class DefaultCoverageResult exten
if (object == null || object instanceof DefaultCoverageResult) {
return (DefaultCoverageResult) object;
}
- final DefaultCoverageResult copy = new DefaultCoverageResult();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultCoverageResult(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -83,12 +83,34 @@ public class DefaultDataQuality extends
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
+ *
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(DataQuality)
+ */
+ public DefaultDataQuality(final DataQuality object) {
+ super(object);
+ scope = object.getScope();
+ reports = copyCollection(object.getReports(), Element.class);
+ lineage = object.getLineage();
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultDataQuality}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultDataQuality} instance is created using the
+ * {@linkplain #DefaultDataQuality(DataQuality) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -98,9 +120,7 @@ public class DefaultDataQuality extends
if (object == null || object instanceof DefaultDataQuality) {
return (DefaultDataQuality) object;
}
- final DefaultDataQuality copy = new DefaultDataQuality();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultDataQuality(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDomainConsistency.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDomainConsistency.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDomainConsistency.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDomainConsistency.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -45,12 +45,31 @@ public class DefaultDomainConsistency ex
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
+ *
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(DomainConsistency)
+ */
+ public DefaultDomainConsistency(final DomainConsistency object) {
+ super(object);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultDomainConsistency}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultDomainConsistency} instance is created using the
+ * {@linkplain #DefaultDomainConsistency(DomainConsistency) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -60,8 +79,6 @@ public class DefaultDomainConsistency ex
if (object == null || object instanceof DefaultDomainConsistency) {
return (DefaultDomainConsistency) object;
}
- final DefaultDomainConsistency copy = new DefaultDomainConsistency();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultDomainConsistency(object);
}
}
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFormatConsistency.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFormatConsistency.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFormatConsistency.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFormatConsistency.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -46,12 +46,31 @@ public class DefaultFormatConsistency ex
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
+ *
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(FormatConsistency)
+ */
+ public DefaultFormatConsistency(final FormatConsistency object) {
+ super(object);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultFormatConsistency}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultFormatConsistency} instance is created using the
+ * {@linkplain #DefaultFormatConsistency(FormatConsistency) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -61,8 +80,6 @@ public class DefaultFormatConsistency ex
if (object == null || object instanceof DefaultFormatConsistency) {
return (DefaultFormatConsistency) object;
}
- final DefaultFormatConsistency copy = new DefaultFormatConsistency();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultFormatConsistency(object);
}
}
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultGriddedDataPositionalAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultGriddedDataPositionalAccuracy.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultGriddedDataPositionalAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultGriddedDataPositionalAccuracy.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -47,12 +47,31 @@ public class DefaultGriddedDataPositiona
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
+ *
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(GriddedDataPositionalAccuracy)
+ */
+ public DefaultGriddedDataPositionalAccuracy(final GriddedDataPositionalAccuracy object) {
+ super(object);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultGriddedDataPositionalAccuracy}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultGriddedDataPositionalAccuracy} instance is created using the
+ * {@linkplain #DefaultGriddedDataPositionalAccuracy(GriddedDataPositionalAccuracy) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -62,8 +81,6 @@ public class DefaultGriddedDataPositiona
if (object == null || object instanceof DefaultGriddedDataPositionalAccuracy) {
return (DefaultGriddedDataPositionalAccuracy) object;
}
- final DefaultGriddedDataPositionalAccuracy copy = new DefaultGriddedDataPositionalAccuracy();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultGriddedDataPositionalAccuracy(object);
}
}
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeAccuracy.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeAccuracy.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -46,12 +46,31 @@ public class DefaultNonQuantitativeAttri
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
+ *
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(NonQuantitativeAttributeAccuracy)
+ */
+ public DefaultNonQuantitativeAttributeAccuracy(final NonQuantitativeAttributeAccuracy object) {
+ super(object);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultNonQuantitativeAttributeAccuracy}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultNonQuantitativeAttributeAccuracy} instance is created using the
+ * {@linkplain #DefaultNonQuantitativeAttributeAccuracy(NonQuantitativeAttributeAccuracy) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -61,8 +80,6 @@ public class DefaultNonQuantitativeAttri
if (object == null || object instanceof DefaultNonQuantitativeAttributeAccuracy) {
return (DefaultNonQuantitativeAttributeAccuracy) object;
}
- final DefaultNonQuantitativeAttributeAccuracy copy = new DefaultNonQuantitativeAttributeAccuracy();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultNonQuantitativeAttributeAccuracy(object);
}
}
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeAttributeAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeAttributeAccuracy.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeAttributeAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeAttributeAccuracy.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -47,12 +47,31 @@ public class DefaultQuantitativeAttribut
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
+ *
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(QuantitativeAttributeAccuracy)
+ */
+ public DefaultQuantitativeAttributeAccuracy(final QuantitativeAttributeAccuracy object) {
+ super(object);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultQuantitativeAttributeAccuracy}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultQuantitativeAttributeAccuracy} instance is created using the
+ * {@linkplain #DefaultQuantitativeAttributeAccuracy(QuantitativeAttributeAccuracy) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -62,8 +81,6 @@ public class DefaultQuantitativeAttribut
if (object == null || object instanceof DefaultQuantitativeAttributeAccuracy) {
return (DefaultQuantitativeAttributeAccuracy) object;
}
- final DefaultQuantitativeAttributeAccuracy copy = new DefaultQuantitativeAttributeAccuracy();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultQuantitativeAttributeAccuracy(object);
}
}
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -75,12 +75,35 @@ public class DefaultQuantitativeResult e
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
+ *
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(QuantitativeResult)
+ */
+ public DefaultQuantitativeResult(final QuantitativeResult object) {
+ super(object);
+ valueType = object.getValueType();
+ valueUnit = object.getValueUnit();
+ errorStatistic = object.getErrorStatistic();
+ values = copyList(object.getValues(), Record.class);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultQuantitativeResult}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultQuantitativeResult} instance is created using the
+ * {@linkplain #DefaultQuantitativeResult(QuantitativeResult) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -90,9 +113,7 @@ public class DefaultQuantitativeResult e
if (object == null || object instanceof DefaultQuantitativeResult) {
return (DefaultQuantitativeResult) object;
}
- final DefaultQuantitativeResult copy = new DefaultQuantitativeResult();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultQuantitativeResult(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -48,12 +48,31 @@ public class DefaultRelativeInternalPosi
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * 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.
+ *
+ * @param object The metadata to copy values from.
+ *
+ * @see #castOrCopy(RelativeInternalPositionalAccuracy)
+ */
+ public DefaultRelativeInternalPositionalAccuracy(final RelativeInternalPositionalAccuracy object) {
+ super(object);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultRelativeInternalPositionalAccuracy}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultRelativeInternalPositionalAccuracy} instance is created using the
+ * {@linkplain #DefaultRelativeInternalPositionalAccuracy(RelativeInternalPositionalAccuracy) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -63,8 +82,6 @@ public class DefaultRelativeInternalPosi
if (object == null || object instanceof DefaultRelativeInternalPositionalAccuracy) {
return (DefaultRelativeInternalPositionalAccuracy) object;
}
- final DefaultRelativeInternalPositionalAccuracy copy = new DefaultRelativeInternalPositionalAccuracy();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultRelativeInternalPositionalAccuracy(object);
}
}