This is an automated email from the ASF dual-hosted git repository.
desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git
The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
new d1fc9fa Fix our usage of the "cardinality" and "multiplicity" words.
Cardinality is the number of elements in a set while multiplicity is the range
of possible cardinalities a set can hold (ISO 19103). In many places we were
using "cardinality" for meaning "multiplicity".
d1fc9fa is described below
commit d1fc9fa186a6a6997dfd1e2b8a74a43feda9ee75
Author: Martin Desruisseaux <[email protected]>
AuthorDate: Sun Sep 16 17:37:22 2018 +0200
Fix our usage of the "cardinality" and "multiplicity" words.
Cardinality is the number of elements in a set while multiplicity is the
range of possible cardinalities a set can hold (ISO 19103).
In many places we were using "cardinality" for meaning "multiplicity".
---
.../org/apache/sis/feature/AbstractAttribute.java | 10 +-
.../org/apache/sis/feature/AbstractFeature.java | 4 +-
.../org/apache/sis/feature/DefaultFeatureType.java | 12 +-
.../java/org/apache/sis/feature/FeatureFormat.java | 26 ++--
.../java/org/apache/sis/feature/FieldType.java | 2 +-
.../org/apache/sis/feature/PropertySingleton.java | 4 +-
.../java/org/apache/sis/feature/Validator.java | 2 +-
.../sis/feature/builder/AttributeTypeBuilder.java | 2 +-
.../sis/feature/builder/FeatureTypeBuilder.java | 33 +++--
.../sis/feature/builder/OperationWrapper.java | 2 +-
.../apache/sis/feature/builder/package-info.java | 14 +-
.../java/org/apache/sis/feature/package-info.java | 2 +-
.../sis/feature/DefaultAttributeTypeTest.java | 2 +-
.../apache/sis/feature/DefaultFeatureTypeTest.java | 4 +-
.../org/apache/sis/feature/FeatureFormatTest.java | 52 ++++----
.../org/apache/sis/feature/FeatureTestCase.java | 14 +-
.../sis/feature/MultiValuedAttributeTest.java | 2 +-
.../builder/AssociationRoleBuilderTest.java | 2 +-
.../org/apache/sis/metadata/KeyNamePolicy.java | 2 +-
.../apache/sis/metadata/PropertyComparator.java | 2 +-
.../org/apache/sis/metadata/TitleProperty.java | 2 +-
.../org/apache/sis/metadata/iso/ISOMetadata.java | 4 +-
.../org/apache/sis/util/iso/DefaultRecord.java | 2 +-
.../org/apache/sis/test/xml/PackageVerifier.java | 2 +-
.../org/apache/sis/parameter/ParameterBuilder.java | 14 +-
.../apache/sis/parameter/ParameterValueList.java | 2 +-
.../parameter/DefaultParameterValueGroupTest.java | 16 +--
.../java/org/apache/sis/measure/NumberRange.java | 2 +-
.../org/apache/sis/util/resources/Vocabulary.java | 5 +
.../sis/util/resources/Vocabulary.properties | 1 +
.../sis/util/resources/Vocabulary_fr.properties | 1 +
.../org/apache/sis/internal/sql/feature/Table.java | 2 +-
.../java/org/apache/sis/storage/FeatureSet.java | 2 +-
.../storage/gpx/GroupAsPolylineOperation.java | 8 +-
.../org/apache/sis/internal/storage/gpx/Types.java | 144 ++++++++++-----------
35 files changed, 215 insertions(+), 185 deletions(-)
diff --git
a/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java
b/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java
index 8618d3c..ee16439 100644
---
a/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java
+++
b/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java
@@ -44,9 +44,9 @@ import org.opengis.feature.MultiValuedPropertyException;
*
* <ul>
* <li>A {@linkplain #getType() reference to an attribute type}
- * which define the base Java type and domain of valid values.</li>
- * <li>One or more {@linkplain #getValues() values}, which may be a
singleton ([0 … 1] cardinality)
- * or multi-valued ([0 … ∞] cardinality).</li>
+ * which defines the base Java type and domain of valid values.</li>
+ * <li>One or more {@linkplain #getValues() values}, which may be a
singleton ([0 … 1] multiplicity)
+ * or multi-valued ([0 … ∞] multiplicity).</li>
* <li>Optional {@linkplain #characteristics() characteristics} about the
attribute
* (e.g. a <var>temperature</var> attribute may have a characteristic
holding the measurement <var>accuracy</var>).
* Characteristics are often, but not necessarily, constant for all
attributes of the same type in a dataset.</li>
@@ -408,7 +408,7 @@ public abstract class AbstractAttribute<V> extends Field<V>
implements Attribute
* </li><li>
* <p>If the attribute {@linkplain #getValue() value} is not an
{@linkplain Class#isInstance instance}
* of the expected {@linkplain
DefaultAttributeType#getValueClass() value class}, or if the number
- * of occurrences is not inside the cardinality range, or if any
other constraint is violated, then
+ * of occurrences is not inside the multiplicity range, or if any
other constraint is violated, then
* a {@linkplain
org.apache.sis.metadata.iso.quality.DefaultConformanceResult conformance
result} is
* added for each violation with an
* {@linkplain
org.apache.sis.metadata.iso.quality.DefaultConformanceResult#getExplanation()
explanation}
@@ -426,7 +426,7 @@ public abstract class AbstractAttribute<V> extends Field<V>
implements Attribute
* {@linkplain
org.apache.sis.metadata.iso.quality.DefaultConformanceResult conformance
result} having a
* {@linkplain
org.apache.sis.metadata.iso.quality.DefaultConformanceResult#pass() pass} value
of {@code false}.
*
- * <div class="note"><b>Example:</b> given an attribute named “population”
with [1 … 1] cardinality,
+ * <div class="note"><b>Example:</b> given an attribute named “population”
with [1 … 1] multiplicity,
* if no value has been assigned to that attribute, then this {@code
quality()} method will return
* the following data quality report:
*
diff --git
a/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java
b/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java
index 26f0c7a..03793c4 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java
@@ -298,7 +298,7 @@ public abstract class AbstractFeature implements Feature,
Serializable {
/**
* Returns the value for the property of the given name.
* This convenience method is equivalent to invoking {@link
#getProperty(String)} for the given name,
- * then to perform one of the following actions depending on the property
type and the cardinality:
+ * then to perform one of the following actions depending on the property
type and the multiplicity:
*
* <table class="sis">
* <caption>Class of returned value</caption>
@@ -735,7 +735,7 @@ public abstract class AbstractFeature implements Feature,
Serializable {
* {@linkplain
org.apache.sis.metadata.iso.quality.DefaultConformanceResult#pass() pass} value
of {@code false}.
*
* <div class="note"><b>Example:</b> given a feature with an attribute
named “population”.
- * If this attribute is mandatory ([1 … 1] cardinality) but no value has
been assigned to it,
+ * If this attribute is mandatory ([1 … 1] multiplicity) but no value has
been assigned to it,
* then this {@code quality()} method will return the following data
quality report:
*
* {@preformat text
diff --git
a/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java
b/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java
index 10214ca..04a7cb4 100644
---
a/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java
+++
b/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java
@@ -122,8 +122,8 @@ public class DefaultFeatureType extends
AbstractIdentifiedType implements Featur
private final boolean isAbstract;
/**
- * {@code true} if this feature type contains only attributes constrained
to the [1 … 1] cardinality,
- * or operations. The feature type shall not contains associations.
+ * {@code true} if this feature type contains only attributes with [1 … 1]
multiplicity, or operations.
+ * The feature type shall not contains associations.
*
* @see #isSimple()
*/
@@ -626,7 +626,7 @@ public class DefaultFeatureType extends
AbstractIdentifiedType implements Featur
}
/**
- * Returns {@code true} if this feature type contains only attributes
constrained to the [1 … 1] cardinality,
+ * Returns {@code true} if this feature type contains only attributes with
[1 … 1] multiplicity,
* or operations (no feature association).
* Such feature types can be handled as a {@linkplain
org.apache.sis.util.iso.DefaultRecord records}.
*
@@ -715,7 +715,7 @@ public class DefaultFeatureType extends
AbstractIdentifiedType implements Featur
/*
* If the base property is an attribute, then the overriding
property shall be either an attribute
* or a parameterless operation producing an attribute. The
parameterless operation is considered
- * has having a [1…1] cardinality.
+ * has having a [1…1] multiplicity.
*/
if (base instanceof AttributeType<?>) {
final AttributeType<?> p0 = (AttributeType<?>) base;
@@ -736,7 +736,7 @@ public class DefaultFeatureType extends
AbstractIdentifiedType implements Featur
if (!p0.getValueClass().isAssignableFrom(p1.getValueClass())
||
(minOccurs = p0.getMinimumOccurs()) >
p1.getMinimumOccurs() ||
(maxOccurs = p0.getMaximumOccurs()) <
p1.getMaximumOccurs() ||
- (p1 != other && (minOccurs > 1 || maxOccurs < 1)))
// [1…1] cardinality for operations.
+ (p1 != other && (minOccurs > 1 || maxOccurs < 1)))
// [1…1] multiplicity for operations.
{
return false;
}
@@ -764,7 +764,7 @@ public class DefaultFeatureType extends
AbstractIdentifiedType implements Featur
final int minOccurs, maxOccurs;
if ((minOccurs = p0.getMinimumOccurs()) >
p1.getMinimumOccurs() ||
(maxOccurs = p0.getMaximumOccurs()) <
p1.getMaximumOccurs() ||
- (p1 != other && (minOccurs > 1 || maxOccurs < 1)))
// [1…1] cardinality for operations.
+ (p1 != other && (minOccurs > 1 || maxOccurs < 1)))
// [1…1] multiplicity for operations.
{
return false;
}
diff --git
a/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureFormat.java
b/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureFormat.java
index f459ec2..c3c9fb7 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureFormat.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureFormat.java
@@ -72,13 +72,13 @@ import org.opengis.feature.Operation;
*
* {@preformat text
* City
- * ┌────────────┬─────────┬─────────────┬───────────┐
- * │ Name │ Type │ Cardinality │ Value │
- * ├────────────┼─────────┼─────────────┼───────────┤
- * │ name │ String │ [1 … 1] │ Paderborn │
- * │ population │ Integer │ [1 … 1] │ 143,174 │
- * │ twin town │ City │ [0 … ∞] │ Le Mans │
- * └────────────┴─────────┴─────────────┴───────────┘
+ * ┌────────────┬─────────┬──────────────┬───────────┐
+ * │ Name │ Type │ Multiplicity │ Value │
+ * ├────────────┼─────────┼──────────────┼───────────┤
+ * │ name │ String │ [1 … 1] │ Paderborn │
+ * │ population │ Integer │ [1 … 1] │ 143,174 │
+ * │ twin town │ City │ [0 … ∞] │ Le Mans │
+ * └────────────┴─────────┴──────────────┴───────────┘
* }</div>
*
* <p><b>Limitations:</b></p>
@@ -243,8 +243,11 @@ public class FeatureFormat extends TabularFormat<Object> {
TYPE(Vocabulary.Keys.Type),
/**
- * The minimum and maximum occurrences of attribute values. This is
made from the numbers returned
- * by {@link AttributeType#getMinimumOccurs()} and {@link
AttributeType#getMaximumOccurs()}.
+ * Cardinality (for attributes) or multiplicity (for attribute types).
+ * The cardinality is the actual number of attribute values.
+ * The multiplicity is the minimum and maximum occurrences of
attribute values.
+ * The multiplicity is made from the numbers returned by {@link
AttributeType#getMinimumOccurs()}
+ * and {@link AttributeType#getMaximumOccurs()}.
*/
CARDINALITY(Vocabulary.Keys.Cardinality),
@@ -377,8 +380,9 @@ public class FeatureFormat extends TabularFormat<Object> {
boolean isFirstColumn = true;
for (final Column column : visibleColumns) {
short key = column.resourceKey;
- if (key == Vocabulary.Keys.Value && feature == null) {
- key = Vocabulary.Keys.DefaultValue;
+ if (feature == null) {
+ if (key == Vocabulary.Keys.Cardinality) key =
Vocabulary.Keys.Multiplicity;
+ if (key == Vocabulary.Keys.Value) key =
Vocabulary.Keys.DefaultValue;
}
if (!isFirstColumn) nextColumn(table);
table.append(resources.getString(key));
diff --git
a/core/sis-feature/src/main/java/org/apache/sis/feature/FieldType.java
b/core/sis-feature/src/main/java/org/apache/sis/feature/FieldType.java
index 450cfd6..022a8bd 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/feature/FieldType.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/feature/FieldType.java
@@ -26,7 +26,7 @@ import org.opengis.feature.PropertyType;
/**
- * Base class of property types having a value and a cardinality.
+ * Base class of property types having a value and a multiplicity.
* This include {@code AttributeType} and {@code AssociationRole}, but not
{@code Operation}.
*
* <div class="note"><b>Analogy:</b> if we compare {@code FeatureType} to a
class in the Java language,
diff --git
a/core/sis-feature/src/main/java/org/apache/sis/feature/PropertySingleton.java
b/core/sis-feature/src/main/java/org/apache/sis/feature/PropertySingleton.java
index 3b3c77f..ad733ed 100644
---
a/core/sis-feature/src/main/java/org/apache/sis/feature/PropertySingleton.java
+++
b/core/sis-feature/src/main/java/org/apache/sis/feature/PropertySingleton.java
@@ -136,7 +136,7 @@ final class PropertySingleton<V> extends AbstractList<V> {
* Removes the property value.
*
* This method does not checks if the removal is allowed by the
- * {@linkplain DefaultAttributeType#getMinimumOccurs() cardinality}.
+ * {@linkplain DefaultAttributeType#getMinimumOccurs() multiplicity}.
* Such check can be performed by {@link AbstractFeature#quality()}.
*/
@Override
@@ -168,7 +168,7 @@ final class PropertySingleton<V> extends AbstractList<V> {
* Removes the property value.
*
* This method does not checks if the removal is allowed by the
- * {@linkplain DefaultAttributeType#getMinimumOccurs() cardinality}.
+ * {@linkplain DefaultAttributeType#getMinimumOccurs() multiplicity}.
* Such check can be performed by {@link AbstractFeature#quality()}.
*/
@Override
diff --git
a/core/sis-feature/src/main/java/org/apache/sis/feature/Validator.java
b/core/sis-feature/src/main/java/org/apache/sis/feature/Validator.java
index 1a7fb44..92e562b 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/feature/Validator.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/feature/Validator.java
@@ -200,7 +200,7 @@ final class Validator {
}
/**
- * Verifies if the given value mets the cardinality constraint.
+ * Verifies if the given value is compliant with the cardinality
constraint.
*
* @param report where to add the result, or {@code null} if not yet
created.
*/
diff --git
a/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeTypeBuilder.java
b/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeTypeBuilder.java
index 54c3dda..3b5f450 100644
---
a/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeTypeBuilder.java
+++
b/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeTypeBuilder.java
@@ -58,7 +58,7 @@ import org.opengis.feature.AttributeType;
* Must be specified at {@linkplain
FeatureTypeBuilder#addAttribute(Class) construction time}.</li>
* <li>a default value — to be used when an attribute instance does not
provide an explicit value.</li>
* <li>characteristics — for example the units of measurement for all
attributes of the same type.</li>
- * <li>cardinality — the minimum and maximum occurrences of attribute
values.</li>
+ * <li>multiplicity — the minimum and maximum occurrences of attribute
values.</li>
* </ul>
*
* @author Johann Sorel (Geomatys)
diff --git
a/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java
b/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java
index 04fb43b..166adb6 100644
---
a/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java
+++
b/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java
@@ -65,7 +65,7 @@ import org.opengis.feature.Operation;
* <li>Methods for optionally specifying the feature type hierarchy: its
{@linkplain #setSuperTypes super types}
* and whether the feature type is {@linkplain #setAbstract
abstract}.</li>
* <li>Convenience methods for setting the {@linkplain #setNameSpace name
space} and the
- * {@linkplain #setDefaultCardinality default cardinality} of properties
to be added to the feature type.</li>
+ * {@linkplain #setDefaultMultiplicity default multiplicity} of
properties to be added to the feature type.</li>
* <li>Methods for {@linkplain #addAttribute(Class) adding an attribute},
{@linkplain #addAssociation(FeatureType)
* an association} or {@linkplain #addProperty an operation}.</li>
* <li>Method for listing the previously added {@linkplain #properties()
properties}.</li>
@@ -88,12 +88,12 @@ import org.opengis.feature.Operation;
*
* {@preformat text
* City
- * ┌────────────┬─────────┬─────────────┬───────────────┐
- * │ Name │ Type │ Cardinality │ Default value │
- * ├────────────┼─────────┼─────────────┼───────────────┤
- * │ name │ String │ [1 … 1] │ Utopia │
- * │ population │ Integer │ [1 … 1] │ │
- * └────────────┴─────────┴─────────────┴───────────────┘
+ * ┌────────────┬─────────┬──────────────┬───────────────┐
+ * │ Name │ Type │ Multiplicity │ Default value │
+ * ├────────────┼─────────┼──────────────┼───────────────┤
+ * │ name │ String │ [1 … 1] │ Utopia │
+ * │ population │ Integer │ [1 … 1] │ │
+ * └────────────┴─────────┴──────────────┴───────────────┘
* }
*
* <p>{@code FeatureTypeBuilder} instances should be short lived.
@@ -143,14 +143,14 @@ public class FeatureTypeBuilder extends TypeBuilder {
/**
* The default minimum number of property values.
*
- * @see #setDefaultCardinality(int, int)
+ * @see #setDefaultMultiplicity(int, int)
*/
int defaultMinimumOccurs;
/**
* The default maximum number of property values.
*
- * @see #setDefaultCardinality(int, int)
+ * @see #setDefaultMultiplicity(int, int)
*/
int defaultMaximumOccurs;
@@ -551,12 +551,21 @@ public class FeatureTypeBuilder extends TypeBuilder {
}
/**
+ * @deprecated Renamed {@link #setDefaultMultiplicity(int, int)}. A
cardinality is the actual number of elements
+ * in a set, while multiplicity is the range of cardinality that a set can
have.
+ */
+ @Deprecated
+ public FeatureTypeBuilder setDefaultCardinality(final int minimumOccurs,
final int maximumOccurs) {
+ return setDefaultMultiplicity(minimumOccurs, maximumOccurs);
+ }
+
+ /**
* Sets the default minimum and maximum number of next attributes and
associations to add.
* Those defaults will applied to newly created attributes or associations,
* for example in next calls to {@link #addAttribute(Class)}.
* Attributes and associations added before this method call are not
modified.
*
- * <p>If this method is not invoked, then the default cardinality is [1 …
1].</p>
+ * <p>If this method is not invoked, then the default multiplicity is [1 …
1].</p>
*
* @param minimumOccurs new default minimum number of property values.
* @param maximumOccurs new default maximum number of property values.
@@ -564,8 +573,10 @@ public class FeatureTypeBuilder extends TypeBuilder {
*
* @see PropertyTypeBuilder#setMinimumOccurs(int)
* @see PropertyTypeBuilder#setMaximumOccurs(int)
+ *
+ * @since 1.0
*/
- public FeatureTypeBuilder setDefaultCardinality(final int minimumOccurs,
final int maximumOccurs) {
+ public FeatureTypeBuilder setDefaultMultiplicity(final int minimumOccurs,
final int maximumOccurs) {
if (minimumOccurs < 0 || maximumOccurs < minimumOccurs) {
throw new
IllegalArgumentException(errors().getString(Errors.Keys.IllegalRange_2,
minimumOccurs, maximumOccurs));
}
diff --git
a/core/sis-feature/src/main/java/org/apache/sis/feature/builder/OperationWrapper.java
b/core/sis-feature/src/main/java/org/apache/sis/feature/builder/OperationWrapper.java
index 5758e8e..1858944 100644
---
a/core/sis-feature/src/main/java/org/apache/sis/feature/builder/OperationWrapper.java
+++
b/core/sis-feature/src/main/java/org/apache/sis/feature/builder/OperationWrapper.java
@@ -59,7 +59,7 @@ final class OperationWrapper extends PropertyTypeBuilder {
}
/**
- * Do not allow a change of cardinality.
+ * Do not allow a change of multiplicity.
*/
@Override public PropertyTypeBuilder setMinimumOccurs(int occurs) {if
(occurs == 1) return this; throw readOnly();}
@Override public PropertyTypeBuilder setMaximumOccurs(int occurs) {if
(occurs == 1) return this; throw readOnly();}
diff --git
a/core/sis-feature/src/main/java/org/apache/sis/feature/builder/package-info.java
b/core/sis-feature/src/main/java/org/apache/sis/feature/builder/package-info.java
index e2df539..6f5c1f5 100644
---
a/core/sis-feature/src/main/java/org/apache/sis/feature/builder/package-info.java
+++
b/core/sis-feature/src/main/java/org/apache/sis/feature/builder/package-info.java
@@ -43,13 +43,13 @@
*
* {@preformat text
* Capital ⇾ City
- * ┌────────────┬─────────┬─────────────┬───────────────┐
- * │ Name │ Type │ Cardinality │ Default value │
- * ├────────────┼─────────┼─────────────┼───────────────┤
- * │ name │ String │ [1 … 1] │ Utopia │
- * │ population │ Integer │ [1 … 1] │ │
- * │ parliament │ String │ [1 … 1] │ │
- * └────────────┴─────────┴─────────────┴───────────────┘
+ * ┌────────────┬─────────┬──────────────┬───────────────┐
+ * │ Name │ Type │ Multiplicity │ Default value │
+ * ├────────────┼─────────┼──────────────┼───────────────┤
+ * │ name │ String │ [1 … 1] │ Utopia │
+ * │ population │ Integer │ [1 … 1] │ │
+ * │ parliament │ String │ [1 … 1] │ │
+ * └────────────┴─────────┴──────────────┴───────────────┘
* }
*
* @author Johann Sorel (Geomatys)
diff --git
a/core/sis-feature/src/main/java/org/apache/sis/feature/package-info.java
b/core/sis-feature/src/main/java/org/apache/sis/feature/package-info.java
index c76b10a..3d489e1 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/feature/package-info.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/feature/package-info.java
@@ -41,7 +41,7 @@
*
* <li><b>{@linkplain org.apache.sis.feature.DefaultFeatureType#isSimple()
Simple features}</b><br>
* Are instances of a feature type with no association to other
features, and where all attributes
- * are constrained to the [1 … 1] cardinality. Such simple features are
very common.</li>
+ * have [1 … 1] multiplicity. Such simple features are very common.</li>
* </ul>
*
* In addition, a feature type can inherit the properties of one or more other
feature types.
diff --git
a/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAttributeTypeTest.java
b/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAttributeTypeTest.java
index 35cc778..32e383c 100644
---
a/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAttributeTypeTest.java
+++
b/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAttributeTypeTest.java
@@ -98,7 +98,7 @@ public final strictfp class DefaultAttributeTypeTest extends
TestCase {
/**
* Creates an attribute type for a list of universities.
- * The cardinality is [0 … ∞].
+ * The multiplicity is [0 … ∞].
*
* @return an attribute type for university names.
*/
diff --git
a/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java
b/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java
index 495a2f1..03f5fd7 100644
---
a/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java
+++
b/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java
@@ -225,7 +225,7 @@ public final strictfp class DefaultFeatureTypeTest extends
TestCase {
/**
* Tests the construction of a simple feature without super-types.
- * A feature is said "simple" if the cardinality of all attributes is [1 …
1].
+ * A feature is said "simple" if the multiplicity of all attributes is [1
… 1].
*
* <p>Current implementation performs its tests on the {@link #city()}
feature.</p>
*/
@@ -246,7 +246,7 @@ public final strictfp class DefaultFeatureTypeTest extends
TestCase {
/**
* Tests the construction of a "complex" feature without super-types.
* A feature is said "complex" if it contains at least one attribute
- * with a cardinality different than [0 … 0] and [1 … 1].
+ * with a multiplicity different than [0 … 0] and [1 … 1].
*/
@Test
@DependsOnMethod("testSimple")
diff --git
a/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureFormatTest.java
b/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureFormatTest.java
index 730f5f0..091b18e 100644
---
a/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureFormatTest.java
+++
b/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureFormatTest.java
@@ -67,16 +67,16 @@ public final strictfp class FeatureFormatTest extends
TestCase {
final FeatureFormat format = create();
final String text = format.format(feature);
assertMultilinesEquals("World metropolis ⇾ Metropolis, University
city\n" +
-
"┌──────────────┬─────────────────────┬─────────────┬───────────────┬────────────────────────────┐\n"
+
- "│ Name │ Type │ Cardinality │ Default
value │ Characteristics │\n" +
-
"├──────────────┼─────────────────────┼─────────────┼───────────────┼────────────────────────────┤\n"
+
- "│ city │ String │ [1 … 1] │ Utopia
│ │\n" +
- "│ population │ Integer │ [1 … 1] │
│ │\n" +
- "│ region │ InternationalString │ [1 … 1] │
│ │\n" +
- "│ isGlobal │ Boolean │ [1 … 1] │
│ │\n" +
- "│ universities │ String │ [0 … ∞] │
│ │\n" +
- "│ temperature │ Float │ [1 … 1] │
│ accuracy = 0.1, units = °C │\n" +
-
"└──────────────┴─────────────────────┴─────────────┴───────────────┴────────────────────────────┘\n",
text);
+
"┌──────────────┬─────────────────────┬──────────────┬───────────────┬────────────────────────────┐\n"
+
+ "│ Name │ Type │ Multiplicity │ Default
value │ Characteristics │\n" +
+
"├──────────────┼─────────────────────┼──────────────┼───────────────┼────────────────────────────┤\n"
+
+ "│ city │ String │ [1 … 1] │ Utopia
│ │\n" +
+ "│ population │ Integer │ [1 … 1] │
│ │\n" +
+ "│ region │ InternationalString │ [1 … 1] │
│ │\n" +
+ "│ isGlobal │ Boolean │ [1 … 1] │
│ │\n" +
+ "│ universities │ String │ [0 … ∞] │
│ │\n" +
+ "│ temperature │ Float │ [1 … 1] │
│ accuracy = 0.1, units = °C │\n" +
+
"└──────────────┴─────────────────────┴──────────────┴───────────────┴────────────────────────────┘\n",
text);
}
/**
@@ -95,15 +95,15 @@ public final strictfp class FeatureFormatTest extends
TestCase {
final FeatureFormat format = create();
final String text = format.format(feature);
assertMultilinesEquals("Identified city ⇾ City\n" +
-
"┌────────────┬─────────┬─────────────┬─────────────────────┐\n" +
- "│ Name │ Type │ Cardinality │ Default value
│\n" +
-
"├────────────┼─────────┼─────────────┼─────────────────────┤\n" +
- "│ city │ String │ [1 … 1] │ Utopia
│\n" +
- "│ population │ Integer │ [1 … 1] │
│\n" +
- "│ someId │ String │ [1 … 1] │ = city
│\n" +
- "│ anotherId │ String │ [1 … 1] │ = <city:population>
│\n" +
- "│ new city │ String │ [1 … 1] │ = create(founder)
│\n" +
-
"└────────────┴─────────┴─────────────┴─────────────────────┘\n", text);
+
"┌────────────┬─────────┬──────────────┬─────────────────────┐\n" +
+ "│ Name │ Type │ Multiplicity │ Default value
│\n" +
+
"├────────────┼─────────┼──────────────┼─────────────────────┤\n" +
+ "│ city │ String │ [1 … 1] │ Utopia
│\n" +
+ "│ population │ Integer │ [1 … 1] │
│\n" +
+ "│ someId │ String │ [1 … 1] │ = city
│\n" +
+ "│ anotherId │ String │ [1 … 1] │ = <city:population>
│\n" +
+ "│ new city │ String │ [1 … 1] │ = create(founder)
│\n" +
+
"└────────────┴─────────┴──────────────┴─────────────────────┘\n", text);
}
/**
@@ -129,13 +129,13 @@ public final strictfp class FeatureFormatTest extends
TestCase {
final FeatureFormat format = create();
final String text = format.format(feature);
assertMultilinesEquals("City for human ⇾ City\n" +
-
"┌────────────┬─────────┬─────────────┬───────────────┬─────────────┐\n" +
- "│ Name │ Type │ Cardinality │ Default value │
Remarks │\n" +
-
"├────────────┼─────────┼─────────────┼───────────────┼─────────────┤\n" +
- "│ city │ String │ [1 … 1] │ Utopia │
│\n" +
- "│ population │ Integer │ [1 … 1] │ │
│\n" +
- "│ highway │ String │ [0 … 2] │ │
Deprecated¹ │\n" +
-
"└────────────┴─────────┴─────────────┴───────────────┴─────────────┘\n" +
+
"┌────────────┬─────────┬──────────────┬───────────────┬─────────────┐\n" +
+ "│ Name │ Type │ Multiplicity │ Default value │
Remarks │\n" +
+
"├────────────┼─────────┼──────────────┼───────────────┼─────────────┤\n" +
+ "│ city │ String │ [1 … 1] │ Utopia │
│\n" +
+ "│ population │ Integer │ [1 … 1] │ │
│\n" +
+ "│ highway │ String │ [0 … 2] │ │
Deprecated¹ │\n" +
+
"└────────────┴─────────┴──────────────┴───────────────┴─────────────┘\n" +
"¹ Replaced by pedestrian areas.\n", text);
}
diff --git
a/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureTestCase.java
b/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureTestCase.java
index c00a369..7f31f3b 100644
--- a/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureTestCase.java
+++ b/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureTestCase.java
@@ -190,12 +190,12 @@ public abstract strictfp class FeatureTestCase extends
TestCase {
setAttributeValue("city", "Utopia", "Atlantide");
/*
* At this point we have the following "City" feature:
- * ┌────────────┬─────────┬─────────────┬───────────┐
- * │ Name │ Type │ Cardinality │ Value │
- * ├────────────┼─────────┼─────────────┼───────────┤
- * │ city │ String │ [1 … 1] │ Atlantide │
- * │ population │ Integer │ [1 … 1] │ │
- * └────────────┴─────────┴─────────────┴───────────┘
+ * ┌────────────┬─────────┬──────────────┬───────────┐
+ * │ Name │ Type │ Multiplicity │ Value │
+ * ├────────────┼─────────┼──────────────┼───────────┤
+ * │ city │ String │ [1 … 1] │ Atlantide │
+ * │ population │ Integer │ [1 … 1] │ │
+ * └────────────┴─────────┴──────────────┴───────────┘
* Verify that attempt to set an illegal value fail.
*/
try {
@@ -248,7 +248,7 @@ public abstract strictfp class FeatureTestCase extends
TestCase {
setAttributeValue("city", "Utopia", "New York");
setAttributeValue("population", null, 8405837); // Estimation for 2013.
/*
- * Set the attribute value on a property having [0 … ∞] cardinality.
+ * Set the attribute value on a property having [0 … ∞] multiplicity.
* The feature implementation should put the value in a list.
*/
assertEquals("universities", Collections.emptyList(),
getAttributeValue("universities"));
diff --git
a/core/sis-feature/src/test/java/org/apache/sis/feature/MultiValuedAttributeTest.java
b/core/sis-feature/src/test/java/org/apache/sis/feature/MultiValuedAttributeTest.java
index cceabc6..e4c8f1e 100644
---
a/core/sis-feature/src/test/java/org/apache/sis/feature/MultiValuedAttributeTest.java
+++
b/core/sis-feature/src/test/java/org/apache/sis/feature/MultiValuedAttributeTest.java
@@ -38,7 +38,7 @@ import static org.apache.sis.test.Assert.*;
public final strictfp class MultiValuedAttributeTest extends TestCase {
/**
* Creates an attribute for a list of universities.
- * The cardinality is [0 … ∞].
+ * The multiplicity is [0 … ∞].
*/
static MultiValuedAttribute<String> universities() {
return new
MultiValuedAttribute<>(DefaultAttributeTypeTest.universities());
diff --git
a/core/sis-feature/src/test/java/org/apache/sis/feature/builder/AssociationRoleBuilderTest.java
b/core/sis-feature/src/test/java/org/apache/sis/feature/builder/AssociationRoleBuilderTest.java
index 61ecc79..dd0c896 100644
---
a/core/sis-feature/src/test/java/org/apache/sis/feature/builder/AssociationRoleBuilderTest.java
+++
b/core/sis-feature/src/test/java/org/apache/sis/feature/builder/AssociationRoleBuilderTest.java
@@ -37,7 +37,7 @@ import org.opengis.feature.FeatureAssociationRole;
*/
public final strictfp class AssociationRoleBuilderTest extends TestCase {
/**
- * Tests the name, designation, definition, description and cardinality
associated to the role.
+ * Tests the name, designation, definition, description and multiplicity
associated to the role.
*/
@Test
public void testMetadata() {
diff --git
a/core/sis-metadata/src/main/java/org/apache/sis/metadata/KeyNamePolicy.java
b/core/sis-metadata/src/main/java/org/apache/sis/metadata/KeyNamePolicy.java
index de18753..a342aef 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/KeyNamePolicy.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/KeyNamePolicy.java
@@ -28,7 +28,7 @@ import org.opengis.annotation.UML;
* <p>In GeoAPI implementation of ISO 19115, {@code UML_IDENTIFIER} and {@code
JAVA_PROPERTY}
* names are usually identical except for {@linkplain java.util.Collection
collections}:
* {@code JAVA_PROPERTY} names are plural when the property is a collection
while
- * {@code UML_IDENTIFIER} usually stay singular no matter the property
cardinality.</p>
+ * {@code UML_IDENTIFIER} usually stay singular no matter the property
multiplicity.</p>
*
* @author Martin Desruisseaux (Geomatys)
* @version 0.3
diff --git
a/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java
b/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java
index 6cff792..5440ba4 100644
---
a/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java
+++
b/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java
@@ -236,7 +236,7 @@ final class PropertyComparator implements
Comparator<Method> {
/*
* Do not happen, except when we have private methods or
deprecated public methods
* used as bridge between legacy and more recent standards
(e.g. ISO 19115:2003 to
- * ISO 19115:2014), especially when cardinality changed
between the two standards.
+ * ISO 19115:2014), especially when multiplicity changed
between the two standards.
* Example: "extent"
*/
final UML uml = method.getAnnotation(UML.class);
diff --git
a/core/sis-metadata/src/main/java/org/apache/sis/metadata/TitleProperty.java
b/core/sis-metadata/src/main/java/org/apache/sis/metadata/TitleProperty.java
index f5cef96..9bc428a 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/TitleProperty.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/TitleProperty.java
@@ -56,7 +56,7 @@ import java.lang.annotation.Documented;
* </div>
*
* The property referenced by this annotation should be the main property if
possible, but not necessarily
- * since it may be only a label. However the property shall be a singleton
([0…1] or [1…1] cardinality)
+ * since it may be only a label. However the property shall be a singleton
([0…1] or [1…1] multiplicity)
* and can not be another metadata object.
*
* @author Martin Desruisseaux (Geomatys)
diff --git
a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java
b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java
index 2ae4361..86f6e20 100644
---
a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java
+++
b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java
@@ -187,7 +187,7 @@ public class ISOMetadata extends ModifiableMetadata
implements IdentifiedObject,
* This method checks the {@linkplain Identifier#getAuthority() authority}
for filtering ignorable
* identifiers like ISBN/ISSN codes and XML attributes.
* This convenience method is provided for implementation of public {@code
getIdentifier(Identifier)}
- * methods in subclasses having an {@code identifier} property with [0 …
1] cardinality.
+ * methods in subclasses having an {@code identifier} property with [0 …
1] multiplicity.
*
* @return an identifier from ISO 19115-3 conceptual model (excluding XML
identifiers),
* or {@code null} if none.
@@ -201,7 +201,7 @@ public class ISOMetadata extends ModifiableMetadata
implements IdentifiedObject,
/**
* Sets the identifier for metadata objects that are expected to contain
at most one ISO 19115 identifier.
* This convenience method is provided for implementation of public {@code
setIdentifier(Identifier)} methods
- * in subclasses having an {@code identifier} property with [0 … 1]
cardinality.
+ * in subclasses having an {@code identifier} property with [0 … 1]
multiplicity.
* The default implementation removes all identifiers that would be
returned by {@link #getIdentifier()}
* before to add the given one in the {@link #identifiers} collection.
*
diff --git
a/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecord.java
b/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecord.java
index 7fdbbd5..e4650f6 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecord.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecord.java
@@ -39,7 +39,7 @@ import org.apache.sis.internal.metadata.RecordSchemaSIS;
/**
* A list of logically related elements as (<var>name</var>, <var>value</var>)
pairs in a dictionary.
- * By definition, all record members have a [1 … 1] cardinality
+ * By definition, all record members have a [1 … 1] multiplicity
* (for a more flexible construct, see {@linkplain org.apache.sis.feature
features}).
* Since all members are expected to be assigned a value, the initial values
on {@code DefaultRecord}
* instantiation are unspecified. Some may be null, or some may be zero.
diff --git
a/core/sis-metadata/src/test/java/org/apache/sis/test/xml/PackageVerifier.java
b/core/sis-metadata/src/test/java/org/apache/sis/test/xml/PackageVerifier.java
index a964214..eb4bd25 100644
---
a/core/sis-metadata/src/test/java/org/apache/sis/test/xml/PackageVerifier.java
+++
b/core/sis-metadata/src/test/java/org/apache/sis/test/xml/PackageVerifier.java
@@ -435,7 +435,7 @@ final strictfp class PackageVerifier {
.append("Expected @XmlElement(required =
").append(info.isRequired).append(')').toString());
}
/*
- * Following is a continuation of our check for cardinality, but
also the beginning of the check
+ * Following is a continuation of our check for multiplicity, but
also the beginning of the check
* for return value type. The return type should be an interface
with a UML annotation; we check
* that this annotation contains the name of the expected type.
*/
diff --git
a/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java
b/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java
index d0c038f..abbde09 100644
---
a/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java
+++
b/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java
@@ -37,7 +37,7 @@ import static
org.apache.sis.util.ArgumentChecks.ensureNonNull;
* <div class="section">Identification properties</div>
* The following properties are cleared after a call to any {@code
createXXX(…)} method,
* since those properties are specific to the each parameter. Other properties
like codespace,
- * version and cardinality are left unchanged because they may be shared by
many parameters.
+ * version and multiplicity are left unchanged because they may be shared by
many parameters.
*
* <ul class="verbose">
* <li><b>{@linkplain DefaultParameterDescriptor#getName() Names}:</b>
@@ -147,6 +147,14 @@ public class ParameterBuilder extends
Builder<ParameterBuilder> {
* <p><b>Lifetime:</b>
* this property is kept unchanged until this {@code setRequired(…)}
method is invoked again.</p>
*
+ * <div class="note"><b>API note:</b> the {@link
DefaultParameterDescriptor#getMaximumOccurs()
+ * maximum number of occurrences} is fixed to 1 and can not be changed
with this builder
+ * (except for {@linkplain #createGroup(int, int,
GeneralParameterDescriptor...) parameters group})
+ * because {@link DefaultParameterValueGroup#parameter(String)} can return
only one value.
+ * Allowing to return more than one value would complicate the API for an
uncommon case.
+ * If nevertheless a maximum number of occurrences greater than 1 is
really desired, Apache SIS supports
+ * this feature but users have to create the {@link
DefaultParameterDescriptor} instance themselves.</div>
+ *
* @param required {@code true} for a mandatory parameter, or {@code
false} for an optional one.
* @return {@code this}, for method call chaining.
*/
@@ -328,7 +336,7 @@ public class ParameterBuilder extends
Builder<ParameterBuilder> {
}
/**
- * Creates a descriptor group for the given cardinality and parameters.
+ * Creates a descriptor group for the given multiplicity and parameters.
*
* @param minimumOccurs the {@linkplain
DefaultParameterDescriptorGroup#getMinimumOccurs() minimum}
* number of times that values for this parameter
group are required.
@@ -353,7 +361,7 @@ public class ParameterBuilder extends
Builder<ParameterBuilder> {
/**
* Creates a descriptor group for the given parameters. This is a
convenience method for
- * {@link #createGroup(int, int, GeneralParameterDescriptor[])} with a
cardinality of [0 … 1]
+ * {@link #createGroup(int, int, GeneralParameterDescriptor[])} with a
multiplicity of [0 … 1]
* or [1 … 1] depending on the value given to the last call to {@link
#setRequired(boolean)}.
*
* @param parameters the {@linkplain
DefaultParameterDescriptorGroup#descriptors() parameter descriptors}
diff --git
a/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java
b/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java
index ab455d4..7b61323 100644
---
a/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java
+++
b/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java
@@ -296,7 +296,7 @@ final class ParameterValueList extends
AbstractList<GeneralParameterValue> imple
/**
* Removes the value at the specified index, provided that this removal is
allowed by the
- * parameter cardinality.
+ * parameter multiplicity.
*
* @param index the index of the value to remove.
* @return the value removed at the given index.
diff --git
a/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueGroupTest.java
b/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueGroupTest.java
index c5290ec..7a053ce 100644
---
a/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueGroupTest.java
+++
b/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueGroupTest.java
@@ -57,10 +57,10 @@ public final strictfp class DefaultParameterValueGroupTest
extends TestCase {
* The descriptors of parameters to be tested by this class.
* The default descriptors are:
* <ul>
- * <li>One mandatory parameter (cardinality [1…1]).</li>
- * <li>One mandatory parameter (cardinality [1…1]).</li>
- * <li>One optional parameter (cardinality [0…1]).</li>
- * <li>One optional parameter (cardinality [0…2]) — invalid according
ISO 19111, but supported by SIS.</li>
+ * <li>One mandatory parameter (multiplicity [1…1]).</li>
+ * <li>One mandatory parameter (multiplicity [1…1]).</li>
+ * <li>One optional parameter (multiplicity [0…1]).</li>
+ * <li>One optional parameter (multiplicity [0…2]) — invalid according
ISO 19111, but supported by SIS.</li>
* </ul>
*
* Some test methods may replace the default descriptor by an other one.
@@ -68,7 +68,7 @@ public final strictfp class DefaultParameterValueGroupTest
extends TestCase {
private ParameterDescriptorGroup descriptor =
DefaultParameterDescriptorGroupTest.M1_M1_O1_O2;
/**
- * Creates values for all parameters defined by the {@linkplain
#descriptor} (regardless their cardinality),
+ * Creates values for all parameters defined by the {@linkplain
#descriptor} (regardless their multiplicity),
* and assigns to them an integer value in sequence with the given step.
For example if {@code step} is 10,
* then this method will create parameters with values 10, 20, 30 and 40.
*/
@@ -323,7 +323,7 @@ public final strictfp class DefaultParameterValueGroupTest
extends TestCase {
assertTrue ("add(“Optional 3”)", values.add(toAdd[2]));
assertEquals("size", 3, values.size());
assertTrue ("add(“Optional 4”)", values.add(toAdd[3]));
assertEquals("size", 4, values.size());
/*
- * Test [1…1] cardinality.
+ * Test [1…1] multiplicity.
*/
try {
values.add(toAdd[1]);
@@ -335,7 +335,7 @@ public final strictfp class DefaultParameterValueGroupTest
extends TestCase {
}
assertEquals("size", 4, values.size()); // Size shall be unchanged.
/*
- * Test [0…1] cardinality.
+ * Test [0…1] multiplicity.
*/
try {
values.add(toAdd[2]);
@@ -347,7 +347,7 @@ public final strictfp class DefaultParameterValueGroupTest
extends TestCase {
}
assertEquals("size", 4, values.size()); // Size shall be unchanged.
/*
- * Test [0…2] cardinality.
+ * Test [0…2] multiplicity.
*/
assertTrue("add(“Optional 4”)",values.add(toAdd[3]));
assertEquals("size", 5, values.size());
diff --git
a/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java
b/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java
index 6d1e207..f20cd2b 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java
@@ -258,7 +258,7 @@ public class NumberRange<E extends Number & Comparable<?
super E>> extends Range
* <div class="note"><b>Note:</b> for creating left-bounded ranges of
floating point values,
* use one of the {@code create(…)} methods with a {@code
POSITIVE_INFINITY} constant.
* We do not provide variants for other integer types because this method
is typically invoked for
- * defining the {@linkplain org.apache.sis.feature.DefaultFeatureType
cardinality of an attribute}.</div>
+ * defining the {@linkplain org.apache.sis.feature.DefaultFeatureType
multiplicity of an attribute}.</div>
*
* @param minValue the minimal value.
* @param isMinIncluded {@code true} if the minimal value is inclusive,
or {@code false} if exclusive.
diff --git
a/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
b/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
index a40a766..f652cd7 100644
---
a/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
+++
b/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
@@ -492,6 +492,11 @@ public final class Vocabulary extends
IndexedResourceBundle {
public static final short ModifiedJulian = 71;
/**
+ * Multiplicity
+ */
+ public static final short Multiplicity = 147;
+
+ /**
* Name
*/
public static final short Name = 72;
diff --git
a/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
b/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
index fde71db..41d1935 100644
---
a/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
+++
b/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
@@ -101,6 +101,7 @@ MeanValue = Mean value
MinimumValue = Minimum value
Methods = Methods
ModifiedJulian = Modified Julian
+Multiplicity = Multiplicity
Name = Name
None = None
Note = Note
diff --git
a/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
b/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
index f1c9476..3be60cc 100644
---
a/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
+++
b/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
@@ -108,6 +108,7 @@ MeanValue = Valeur moyenne
MinimumValue = Valeur minimale
Methods = M\u00e9thodes
ModifiedJulian = Julien modifi\u00e9
+Multiplicity = Multiplicit\u00e9
Name = Nom
None = Aucun
Note = Note
diff --git
a/storage/sis-sqlstore/src/main/java/org/apache/sis/internal/sql/feature/Table.java
b/storage/sis-sqlstore/src/main/java/org/apache/sis/internal/sql/feature/Table.java
index 70a6b73..3fdfa04 100644
---
a/storage/sis-sqlstore/src/main/java/org/apache/sis/internal/sql/feature/Table.java
+++
b/storage/sis-sqlstore/src/main/java/org/apache/sis/internal/sql/feature/Table.java
@@ -213,7 +213,7 @@ final class Table extends AbstractFeatureSet {
}
/*
* For each column in the table that is not a foreigner key, create an
AttributeType of the same name.
- * The Java type is inferred from the SQL type, and the attribute
cardinality in inferred from the SQL
+ * The Java type is inferred from the SQL type, and the attribute
multiplicity in inferred from the SQL
* nullability. Attribute names are added in the 'attributeNames' and
'attributeColumns' list. Those
* names are usually the same, except when a column is used both as a
primary key and as foreigner key.
*/
diff --git
a/storage/sis-storage/src/main/java/org/apache/sis/storage/FeatureSet.java
b/storage/sis-storage/src/main/java/org/apache/sis/storage/FeatureSet.java
index 123f989..83b9ffe 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/storage/FeatureSet.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/storage/FeatureSet.java
@@ -44,7 +44,7 @@ public interface FeatureSet extends DataSet {
* <li>Name to use for accessing the property</li>
* <li>Human-readable description</li>
* <li>Type of values</li>
- * <li>Cardinality (minimum and maximum number of occurrences)</li>
+ * <li>Multiplicity (minimum and maximum number of occurrences)</li>
* <li>{@linkplain org.opengis.referencing.crs.CoordinateReferenceSystem
Coordinate Reference System}.</li>
* </ul>
*
diff --git
a/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/GroupAsPolylineOperation.java
b/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/GroupAsPolylineOperation.java
index 84a6082..4591ac8 100644
---
a/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/GroupAsPolylineOperation.java
+++
b/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/GroupAsPolylineOperation.java
@@ -45,13 +45,13 @@ import org.opengis.feature.AttributeType;
* <div class="note"><b>Examples:</b>
* <p><i>Polylines created from points:</i>
* a boat that record it's position every hour.
- * The list of all positions is stored in an attribute with [0 … ∞]
cardinality.
+ * The list of all positions is stored in an attribute with [0 … ∞]
multiplicity.
* This class will extract each position and create a line as a new attribute.
* Any change applied to the positions will be visible on the line.</p>
*
* <p><i>Polylines created from other polylines:</i>
* a boat that record track every hour.
- * The list of all tracks is stored in an attribute with [0 … ∞] cardinality.
+ * The list of all tracks is stored in an attribute with [0 … ∞] multiplicity.
* This class will extract each track and create a polyline as a new attribute.
* Any change applied to the tracks will be visible on the polyline.</p>
* </div>
@@ -75,7 +75,7 @@ final class GroupAsPolylineOperation extends
AbstractOperation {
/**
* Name of the property to follow in order to get the geometries to add to
a polyline.
- * This property shall be a feature association, usually with [0 … ∞]
cardinality.
+ * This property shall be a feature association, usually with [0 … ∞]
multiplicity.
*/
private final String association;
@@ -158,7 +158,7 @@ final class GroupAsPolylineOperation extends
AbstractOperation {
/**
* Name of the property to follow in order to get the geometries to
add to a polyline.
- * This property shall be a feature association, usually with [0 … ∞]
cardinality.
+ * This property shall be a feature association, usually with [0 … ∞]
multiplicity.
*/
private final String association;
diff --git
a/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Types.java
b/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Types.java
index ee86569..4d80617 100644
---
a/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Types.java
+++
b/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Types.java
@@ -143,11 +143,11 @@ final class Types {
* which is not part of GPX specification.
*
* GPXEntity
- * ┌────────────────┬─────────┬─────────────┐
- * │ Name │ Type │ Cardinality │
- * ├────────────────┼─────────┼─────────────┤
- * │ sis:identifier │ Integer │ [1 … 1] │ SIS-specific
property
- * └────────────────┴─────────┴─────────────┘
+ * ┌────────────────┬─────────┬──────────────┐
+ * │ Name │ Type │ Multiplicity │
+ * ├────────────────┼─────────┼──────────────┤
+ * │ sis:identifier │ Integer │ [1 … 1] │ SIS-specific
property
+ * └────────────────┴─────────┴──────────────┘
*/
final FeatureTypeBuilder builder = new FeatureTypeBuilder(factory,
library, locale);
builder.setNameSpace(Tags.PREFIX).setName("GPXEntity").setAbstract(true);
@@ -155,37 +155,37 @@ final class Types {
parent = builder.build();
/*
* WayPoint ⇾ GPXEntity
- *
┌──────────────────┬────────────────┬───────────────────────┬─────────────┐
- * │ Name │ Type │ XML type │
Cardinality │
- *
├──────────────────┼────────────────┼───────────────────────┼─────────────┤
- * │ sis:identifier │ Integer │ │ [1
… 1] │
- * │ sis:envelope │ Envelope │ │ [1
… 1] │
- * │ sis:geometry │ Point │ (lat,lon) attributes │ [1
… 1] │
- * │ ele │ Double │ xs:decimal │ [0
… 1] │
- * │ time │ Temporal │ xs:dateTime │ [0
… 1] │
- * │ magvar │ Double │ gpx:degreesType │ [0
… 1] │
- * │ geoidheight │ Double │ xs:decimal │ [0
… 1] │
- * │ name │ String │ xs:string │ [0
… 1] │
- * │ cmt │ String │ xs:string │ [0
… 1] │
- * │ desc │ String │ xs:string │ [0
… 1] │
- * │ src │ String │ xs:string │ [0
… 1] │
- * │ link │ OnlineResource │ gpx:linkType │ [0
… ∞] │
- * │ sym │ String │ xs:string │ [0
… 1] │
- * │ type │ String │ xs:string │ [0
… 1] │
- * │ fix │ Fix │ gpx:fixType │ [0
… 1] │
- * │ sat │ Integer │ xs:nonNegativeInteger │ [0
… 1] │
- * │ hdop │ Double │ xs:decimal │ [0
… 1] │
- * │ vdop │ Double │ xs:decimal │ [0
… 1] │
- * │ pdop │ Double │ xs:decimal │ [0
… 1] │
- * │ ageofdgpsdata │ Double │ xs:decimal │ [0
… 1] │
- * │ dgpsid │ Integer │ gpx:dgpsStationType │ [0
… 1] │
- *
└──────────────────┴────────────────┴───────────────────────┴─────────────┘
+ *
┌──────────────────┬────────────────┬───────────────────────┬──────────────┐
+ * │ Name │ Type │ XML type │
Multiplicity │
+ *
├──────────────────┼────────────────┼───────────────────────┼──────────────┤
+ * │ sis:identifier │ Integer │ │ [1
… 1] │
+ * │ sis:envelope │ Envelope │ │ [1
… 1] │
+ * │ sis:geometry │ Point │ (lat,lon) attributes │ [1
… 1] │
+ * │ ele │ Double │ xs:decimal │ [0
… 1] │
+ * │ time │ Temporal │ xs:dateTime │ [0
… 1] │
+ * │ magvar │ Double │ gpx:degreesType │ [0
… 1] │
+ * │ geoidheight │ Double │ xs:decimal │ [0
… 1] │
+ * │ name │ String │ xs:string │ [0
… 1] │
+ * │ cmt │ String │ xs:string │ [0
… 1] │
+ * │ desc │ String │ xs:string │ [0
… 1] │
+ * │ src │ String │ xs:string │ [0
… 1] │
+ * │ link │ OnlineResource │ gpx:linkType │ [0
… ∞] │
+ * │ sym │ String │ xs:string │ [0
… 1] │
+ * │ type │ String │ xs:string │ [0
… 1] │
+ * │ fix │ Fix │ gpx:fixType │ [0
… 1] │
+ * │ sat │ Integer │ xs:nonNegativeInteger │ [0
… 1] │
+ * │ hdop │ Double │ xs:decimal │ [0
… 1] │
+ * │ vdop │ Double │ xs:decimal │ [0
… 1] │
+ * │ pdop │ Double │ xs:decimal │ [0
… 1] │
+ * │ ageofdgpsdata │ Double │ xs:decimal │ [0
… 1] │
+ * │ dgpsid │ Integer │ gpx:dgpsStationType │ [0
… 1] │
+ *
└──────────────────┴────────────────┴───────────────────────┴──────────────┘
*/
builder.clear().setSuperTypes(parent).setNameSpace(Tags.PREFIX).setName("WayPoint");
builder.addAttribute(GeometryType.POINT).setName(geomName)
.setCRS(CommonCRS.WGS84.normalizedGeographic())
.addRole(AttributeRole.DEFAULT_GEOMETRY);
- builder.setDefaultCardinality(0, 1);
+ builder.setDefaultMultiplicity(0, 1);
builder.addAttribute(Double .class).setName(Tags.ELEVATION);
builder.addAttribute(Temporal .class).setName(Tags.TIME);
builder.addAttribute(Double .class).setName(Tags.MAGNETIC_VAR);
@@ -207,28 +207,28 @@ final class Types {
wayPoint = create(builder, resources);
/*
* Route ⇾ GPXEntity
- *
┌────────────────┬────────────────┬───────────────────────┬─────────────┐
- * │ Name │ Type │ XML type │
Cardinality │
- *
├────────────────┼────────────────┼───────────────────────┼─────────────┤
- * │ sis:identifier │ Integer │ │ [1 …
1] │
- * │ sis:envelope │ Envelope │ │ [1 …
1] │
- * │ sis:geometry │ Polyline │ │ [1 …
1] │
- * │ name │ String │ xs:string │ [0 …
1] │
- * │ cmt │ String │ xs:string │ [0 …
1] │
- * │ desc │ String │ xs:string │ [0 …
1] │
- * │ src │ String │ xs:string │ [0 …
1] │
- * │ link │ OnlineResource │ gpx:linkType │ [0 …
∞] │
- * │ number │ Integer │ xs:nonNegativeInteger │ [0 …
1] │
- * │ type │ String │ xs:string │ [0 …
1] │
- * │ rtept │ WayPoint │ gpx:wptType │ [0 …
∞] │
- *
└────────────────┴────────────────┴───────────────────────┴─────────────┘
+ *
┌────────────────┬────────────────┬───────────────────────┬──────────────┐
+ * │ Name │ Type │ XML type │
Multiplicity │
+ *
├────────────────┼────────────────┼───────────────────────┼──────────────┤
+ * │ sis:identifier │ Integer │ │ [1 …
1] │
+ * │ sis:envelope │ Envelope │ │ [1 …
1] │
+ * │ sis:geometry │ Polyline │ │ [1 …
1] │
+ * │ name │ String │ xs:string │ [0 …
1] │
+ * │ cmt │ String │ xs:string │ [0 …
1] │
+ * │ desc │ String │ xs:string │ [0 …
1] │
+ * │ src │ String │ xs:string │ [0 …
1] │
+ * │ link │ OnlineResource │ gpx:linkType │ [0 …
∞] │
+ * │ number │ Integer │ xs:nonNegativeInteger │ [0 …
1] │
+ * │ type │ String │ xs:string │ [0 …
1] │
+ * │ rtept │ WayPoint │ gpx:wptType │ [0 …
∞] │
+ *
└────────────────┴────────────────┴───────────────────────┴──────────────┘
*/
final AttributeType<?> groupResult =
GroupAsPolylineOperation.getResult(geometries);
GroupAsPolylineOperation groupOp = new
GroupAsPolylineOperation(geomInfo, Tags.ROUTE_POINTS, groupResult);
builder.clear().setSuperTypes(parent).setNameSpace(Tags.PREFIX).setName("Route");
builder.addProperty(groupOp);
builder.addProperty(FeatureOperations.envelope(envpInfo, null,
groupOp));
- builder.setDefaultCardinality(0, 1);
+ builder.setDefaultMultiplicity(0, 1);
builder.addProperty(wayPoint.getProperty(Tags.NAME));
builder.addProperty(wayPoint.getProperty(Tags.COMMENT));
builder.addProperty(wayPoint.getProperty(Tags.DESCRIPTION));
@@ -240,45 +240,45 @@ final class Types {
route = create(builder, resources);
/*
* TrackSegment ⇾ GPXEntity
- * ┌────────────────┬──────────┬─────────────┬─────────────┐
- * │ Name │ Type │ XML type │ Cardinality │
- * ├────────────────┼──────────┼─────────────┼─────────────┤
- * │ sis:identifier │ Integer │ │ [1 … 1] │
- * │ sis:envelope │ Envelope │ │ [1 … 1] │
- * │ sis:geometry │ Polyline │ │ [1 … 1] │
- * │ trkpt │ WayPoint │ gpx:wptType │ [0 … ∞] │
- * └────────────────┴──────────┴─────────────┴─────────────┘
+ * ┌────────────────┬──────────┬─────────────┬──────────────┐
+ * │ Name │ Type │ XML type │ Multiplicity │
+ * ├────────────────┼──────────┼─────────────┼──────────────┤
+ * │ sis:identifier │ Integer │ │ [1 … 1] │
+ * │ sis:envelope │ Envelope │ │ [1 … 1] │
+ * │ sis:geometry │ Polyline │ │ [1 … 1] │
+ * │ trkpt │ WayPoint │ gpx:wptType │ [0 … ∞] │
+ * └────────────────┴──────────┴─────────────┴──────────────┘
*/
groupOp = new GroupAsPolylineOperation(geomInfo, Tags.TRACK_POINTS,
groupResult);
builder.clear().setSuperTypes(parent).setNameSpace(Tags.PREFIX).setName("TrackSegment");
builder.addProperty(groupOp);
builder.addProperty(FeatureOperations.envelope(envpInfo, null,
groupOp));
- builder.setDefaultCardinality(0, 1);
+ builder.setDefaultMultiplicity(0, 1);
builder.addAssociation(wayPoint).setName(Tags.TRACK_POINTS).setMaximumOccurs(Integer.MAX_VALUE);
trackSegment = create(builder, resources);
/*
* Track ⇾ GPXEntity
- *
┌────────────────┬────────────────┬───────────────────────┬─────────────┐
- * │ Name │ Type │ XML type │
Cardinality │
- *
├────────────────┼────────────────┼───────────────────────┼─────────────┤
- * │ sis:identifier │ Integer │ │ [1 …
1] │
- * │ sis:envelope │ Envelope │ │ [1 …
1] │
- * │ sis:geometry │ Polyline │ │ [1 …
1] │
- * │ name │ String │ xs:string │ [0 …
1] │
- * │ cmt │ String │ xs:string │ [0 …
1] │
- * │ desc │ String │ xs:string │ [0 …
1] │
- * │ src │ String │ xs:string │ [0 …
1] │
- * │ link │ OnlineResource │ gpx:linkType │ [0 …
∞] │
- * │ number │ Integer │ xs:nonNegativeInteger │ [0 …
1] │
- * │ type │ String │ xs:string │ [0 …
1] │
- * │ trkseg │ TrackSegment │ gpx:trksegType │ [0 …
∞] │
- *
└────────────────┴────────────────┴───────────────────────┴─────────────┘
+ *
┌────────────────┬────────────────┬───────────────────────┬──────────────┐
+ * │ Name │ Type │ XML type │
Multiplicity │
+ *
├────────────────┼────────────────┼───────────────────────┼──────────────┤
+ * │ sis:identifier │ Integer │ │ [1 …
1] │
+ * │ sis:envelope │ Envelope │ │ [1 …
1] │
+ * │ sis:geometry │ Polyline │ │ [1 …
1] │
+ * │ name │ String │ xs:string │ [0 …
1] │
+ * │ cmt │ String │ xs:string │ [0 …
1] │
+ * │ desc │ String │ xs:string │ [0 …
1] │
+ * │ src │ String │ xs:string │ [0 …
1] │
+ * │ link │ OnlineResource │ gpx:linkType │ [0 …
∞] │
+ * │ number │ Integer │ xs:nonNegativeInteger │ [0 …
1] │
+ * │ type │ String │ xs:string │ [0 …
1] │
+ * │ trkseg │ TrackSegment │ gpx:trksegType │ [0 …
∞] │
+ *
└────────────────┴────────────────┴───────────────────────┴──────────────┘
*/
groupOp = new GroupAsPolylineOperation(geomInfo, Tags.TRACK_SEGMENTS,
groupResult);
builder.clear().setSuperTypes(parent).setNameSpace(Tags.PREFIX).setName("Track");
builder.addProperty(groupOp);
builder.addProperty(FeatureOperations.envelope(envpInfo, null,
groupOp));
- builder.setDefaultCardinality(0, 1);
+ builder.setDefaultMultiplicity(0, 1);
builder.addProperty(route.getProperty(Tags.NAME));
builder.addProperty(route.getProperty(Tags.COMMENT));
builder.addProperty(route.getProperty(Tags.DESCRIPTION));