blob: 13e81186e21abc2cf09b1018ebfc3a06b66997cc [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (19) -->
<title>AbstractAttribute (Apache SIS 1.3 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: org.apache.sis.feature, class: AbstractAttribute">
<meta name="generator" content="javadoc/ClassWriterImpl">
<meta name="keywords" content="org.apache.sis.feature.AbstractAttribute class">
<meta name="keywords" content="create()">
<meta name="keywords" content="getName()">
<meta name="keywords" content="getType()">
<meta name="keywords" content="getValue()">
<meta name="keywords" content="getValues()">
<meta name="keywords" content="setValue()">
<meta name="keywords" content="setValues()">
<meta name="keywords" content="characteristics()">
<meta name="keywords" content="quality()">
<meta name="keywords" content="toString()">
<meta name="keywords" content="clone()">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../sis.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../script-dir/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="../../../../script-dir/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var pathtoroot = "../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span></button>
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="class-use/AbstractAttribute.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html#class">Help</a></li>
</ul>
<ul class="sub-nav-list-small">
<li>
<p>Summary:</p>
<ul>
<li>Nested</li>
<li>Field</li>
<li><a href="#constructor-summary">Constr</a></li>
<li><a href="#method-summary">Method</a></li>
</ul>
</li>
<li>
<p>Detail:</p>
<ul>
<li>Field</li>
<li><a href="#constructor-detail">Constr</a></li>
<li><a href="#method-detail">Method</a></li>
</ul>
</li>
</ul>
</div>
<div class="sub-nav">
<div id="navbar-sub-list">
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor-summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor-detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</div>
<div class="nav-list-search"><a href="../../../../search.html">SEARCH</a>
<input type="text" id="search-input" disabled placeholder="Search">
<input type="reset" id="reset-button" disabled value="reset">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">org.apache.sis.feature</a></div>
<h1 title="Class AbstractAttribute" class="title">Class AbstractAttribute&lt;V&gt;</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>
<div class="inheritance">AbstractAttribute&lt;V&gt;</div>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>Type Parameters:</dt>
<dd><code>V</code> - the type of attribute values. If the attribute supports multi-occurrences,
then this is the type of elements (not the collection type).</dd>
</dl>
<dl class="notes">
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a></code></dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public abstract class </span><span class="element-name type-name-label">AbstractAttribute&lt;V&gt;</span>
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>
implements <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a></span></div>
<div class="block">An instance of an <a href="DefaultAttributeType.html" title="class in org.apache.sis.feature">attribute type</a> containing the value of an attribute in a feature.
<code>Attribute</code> holds three main information:
<ul>
<li>A <a href="#getType()">reference to an attribute type</a>
which defines the base Java type and domain of valid values.</li>
<li>One or more <a href="#getValues()">values</a>, which may be a singleton ([0 … 1] multiplicity)
or multi-valued ([0 … ∞] multiplicity).</li>
<li>Optional <a href="#characteristics()">characteristics</a> 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>
</ul>
<code>Abstract­Attribute</code> can be instantiated by calls to <a href="DefaultAttributeType.html#newInstance()"><code>Default­Attribute­Type​.new­Instance()</code></a>.
<h2>Limitations</h2>
<ul>
<li><b>Multi-threading:</b> <code>Abstract­Attribute</code> instances are <strong>not</strong> thread-safe.
Synchronization, if needed, shall be done externally by the caller.</li>
<li><b>Serialization:</b> serialized objects of this class are not guaranteed to be compatible with future
versions. Serialization should be used only for short term storage or RMI between applications running
the same SIS version.</li>
<li><b>Cloning:</b> despite providing a public <a href="#clone()"><code>clone()</code></a> method, this base class is <strong>not</strong>
cloneable by default. Subclasses shall implement the <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Cloneable.html" title="class or interface in java.lang" class="external-link"><code>Cloneable</code></a> interface themselves if they choose
to support cloning.</li>
</ul></div>
<dl class="notes">
<dt>Since:</dt>
<dd>0.5</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="AbstractFeature.html" title="class in org.apache.sis.feature"><code>Abstract­Feature</code></a></li>
<li><a href="DefaultAttributeType.html" title="class in org.apache.sis.feature"><code>Default­Attribute­Type</code></a></li>
<li><a href="../../../../serialized-form.html#org.apache.sis.feature.AbstractAttribute">Serialized Form</a></li>
</ul>
</dd>
<p><font size="-1">Defined in the <code>sis-feature</code> module</font></p>
</dl>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<li>
<section class="constructor-summary" id="constructor-summary">
<h2>Constructor Summary</h2>
<div class="caption"><span>Constructors</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier</div>
<div class="table-header col-second">Constructor</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>protected </code></div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(org.apache.sis.feature.DefaultAttributeType)" class="member-name-link">Abstract­Attribute</a><wbr>(<a href="DefaultAttributeType.html" title="class in org.apache.sis.feature">Default­Attribute­Type</a>&lt;<a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a>&gt;&nbsp;type)</code></div>
<div class="col-last even-row-color">
<div class="block">Creates a new attribute of the given type.</div>
</div>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab3" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab3', 3)" class="table-tab">Abstract Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel">
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="AbstractAttribute.html" title="class in org.apache.sis.feature">Abstract­Attribute</a>&lt;?&gt;&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#characteristics()" class="member-name-link">characteristics</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Other attributes that describes this attribute.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="AbstractAttribute.html" title="class in org.apache.sis.feature">Abstract­Attribute</a>&lt;<a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a>&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#clone()" class="member-name-link">clone</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns a copy of this attribute if cloning is supported.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static &lt;V&gt;&nbsp;<a href="AbstractAttribute.html" title="class in org.apache.sis.feature">Abstract­Attribute</a>&lt;V&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#create(org.apache.sis.feature.DefaultAttributeType)" class="member-name-link">create</a><wbr>(<a href="DefaultAttributeType.html" title="class in org.apache.sis.feature">Default­Attribute­Type</a>&lt;V&gt;&nbsp;type)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Creates a new attribute of the given type initialized to the
<a href="DefaultAttributeType.html#getDefaultValue()">default value</a>.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/util/GenericName.html" title="class or interface in org.opengis.util" class="external-link">Generic­Name</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getName()" class="member-name-link">get­Name</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the name of this attribute as defined by its <a href="#getType()">type</a>.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="DefaultAttributeType.html" title="class in org.apache.sis.feature">Default­Attribute­Type</a>&lt;<a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a>&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getType()" class="member-name-link">get­Type</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns information about the attribute (base Java class, domain of values, <i>etc.</i>).</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract <a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getValue()" class="member-name-link">get­Value</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns the attribute value, or <code>null</code> if none.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a>&lt;<a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a>&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getValues()" class="member-name-link">get­Values</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns all attribute values, or an empty collection if none.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/quality/DataQuality.html" title="class or interface in org.opengis.metadata.quality" class="external-link">Data­Quality</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#quality()" class="member-name-link">quality</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Evaluates the quality of this attribute at this method invocation time.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#setValue(V)" class="member-name-link">set­Value</a><wbr>(<a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a>&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Sets the attribute value.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setValues(java.util.Collection)" class="member-name-link">set­Values</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a>&lt;? extends <a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a>&gt;&nbsp;values)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sets the attribute values.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toString()" class="member-name-link">to­String</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns a string representation of this attribute.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-Object">Methods inherited from class&nbsp;<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">get­Class</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hash­Code</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notify­All</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li>
<section class="constructor-details" id="constructor-detail">
<h2>Constructor Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="&lt;init&gt;(org.apache.sis.feature.DefaultAttributeType)">
<h3>AbstractAttribute</h3>
<div class="member-signature"><span class="modifiers">protected</span>&nbsp;<span class="element-name">AbstractAttribute</span><wbr><span class="parameters">(<a href="DefaultAttributeType.html" title="class in org.apache.sis.feature">DefaultAttributeType</a>&lt;<a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a>&gt;&nbsp;type)</span></div>
<div class="block">Creates a new attribute of the given type.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>type</code> - information about the attribute (base Java class, domain of values, <i>etc.</i>).</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="#create(org.apache.sis.feature.DefaultAttributeType)"><code>create(Default­Attribute­Type)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="create(org.apache.sis.feature.DefaultAttributeType)">
<h3>create</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="type-parameters">&lt;V&gt;</span>&nbsp;<span class="return-type"><a href="AbstractAttribute.html" title="class in org.apache.sis.feature">AbstractAttribute</a>&lt;V&gt;</span>&nbsp;<span class="element-name">create</span><wbr><span class="parameters">(<a href="DefaultAttributeType.html" title="class in org.apache.sis.feature">DefaultAttributeType</a>&lt;V&gt;&nbsp;type)</span></div>
<div class="block">Creates a new attribute of the given type initialized to the
<a href="DefaultAttributeType.html#getDefaultValue()">default value</a>.</div>
<dl class="notes">
<dt>Type Parameters:</dt>
<dd><code>V</code> - the type of attribute values.</dd>
<dt>Parameters:</dt>
<dd><code>type</code> - information about the attribute (base Java class, domain of values, <i>etc.</i>).</dd>
<dt>Returns:</dt>
<dd>the new attribute.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="DefaultAttributeType.html#newInstance()"><code>Default­Attribute­Type​.new­Instance()</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getName()">
<h3>getName</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/util/GenericName.html" title="class or interface in org.opengis.util" class="external-link">GenericName</a></span>&nbsp;<span class="element-name">getName</span>()</div>
<div class="block">Returns the name of this attribute as defined by its <a href="#getType()">type</a>.
This convenience method delegates to <a href="AbstractIdentifiedType.html#getName()"><code>Abstract­Identified­Type​.get­Name()</code></a>.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the attribute name specified by its type.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getType()">
<h3>getType</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="DefaultAttributeType.html" title="class in org.apache.sis.feature">DefaultAttributeType</a>&lt;<a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a>&gt;</span>&nbsp;<span class="element-name">getType</span>()</div>
<div class="block">Returns information about the attribute (base Java class, domain of values, <i>etc.</i>).
<div class="warning"><b>Warning:</b> In a future SIS version, the return type may be changed
to <code>org​.opengis​.feature​.Attribute­Type</code>. This change is pending GeoAPI revision.</div></div>
<dl class="notes">
<dt>Returns:</dt>
<dd>information about the attribute.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getValue()">
<h3>getValue</h3>
<div class="member-signature"><span class="modifiers">public abstract</span>&nbsp;<span class="return-type"><a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a></span>&nbsp;<span class="element-name">getValue</span>()
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">IllegalStateException</a></span></div>
<div class="block">Returns the attribute value, or <code>null</code> if none. This convenience method can be invoked in
the common case where the <a href="DefaultAttributeType.html#getMaximumOccurs()">maximum number</a>
of attribute values is restricted to 1 or 0.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the attribute value (may be <code>null</code>).</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if this attribute contains more than one value.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="AbstractFeature.html#getPropertyValue(java.lang.String)"><code>Abstract­Feature​.get­Property­Value(String)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getValues()">
<h3>getValues</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a>&lt;<a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a>&gt;</span>&nbsp;<span class="element-name">getValues</span>()</div>
<div class="block">Returns all attribute values, or an empty collection if none.
The returned collection is <em>live</em>: changes in the returned collection
will be reflected immediately in this <code>Attribute</code> instance, and conversely.
<p>The default implementation returns a collection which will delegate its work to
<a href="#getValue()"><code>get­Value()</code></a> and <a href="#setValue(V)"><code>set­Value(Object)</code></a>.</p></div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the attribute values in a <em>live</em> collection.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setValue(V)">
<h3 id="setValue(java.lang.Object)">setValue</h3>
<div class="member-signature"><span class="modifiers">public abstract</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setValue</span><wbr><span class="parameters">(<a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a>&nbsp;value)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></span></div>
<div class="block">Sets the attribute value. All previous values are replaced by the given singleton.
<h4>Validation</h4>
The amount of validation performed by this method is implementation dependent.
Usually, only the most basic constraints are verified. This is so for performance reasons
and also because some rules may be temporarily broken while constructing a feature.
A more exhaustive verification can be performed by invoking the <a href="#quality()"><code>quality()</code></a> method.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - the new value, or <code>null</code> for removing all values from this attribute.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if this method verifies argument validity and the given value
does not met the attribute constraints.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="AbstractFeature.html#setPropertyValue(java.lang.String,java.lang.Object)"><code>Abstract­Feature​.set­Property­Value(String, Object)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setValues(java.util.Collection)">
<h3>setValues</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setValues</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a>&lt;? extends <a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a>&gt;&nbsp;values)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></span></div>
<div class="block">Sets the attribute values. All previous values are replaced by the given collection.
<p>The default implementation ensures that the given collection contains at most one element,
then delegates to <a href="#setValue(V)"><code>set­Value(Object)</code></a>.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>values</code> - the new values.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if the given collection contains too many elements.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="characteristics()">
<h3>characteristics</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="AbstractAttribute.html" title="class in org.apache.sis.feature">AbstractAttribute</a>&lt;?&gt;&gt;</span>&nbsp;<span class="element-name">characteristics</span>()</div>
<div class="block">Other attributes that describes this attribute. For example if this attribute carries a measurement,
then a characteristic of this attribute could be the measurement accuracy.
See <cite>"Attribute characterization"</cite> in <a href="DefaultAttributeType.html" title="class in org.apache.sis.feature"><code>Default­Attribute­Type</code></a> Javadoc for more information.
<p>The map returned by this method contains only the characteristics explicitly defined for this attribute.
If the map contains no characteristic for a given name, a <a href="DefaultAttributeType.html#getDefaultValue()">default value</a> may still exist.
In such cases, callers may also need to inspect the <a href="DefaultAttributeType.html#characteristics()"><code>Default­Attribute­Type​.characteristics()</code></a>
as shown in the <cite>Reading a characteristic</cite> section below.</p>
<div class="note"><b>Rational:</b>
Very often, all attributes of a given type in the same dataset have the same characteristics.
For example, it is very common that all temperature measurements in a dataset have the same accuracy,
and setting a different accuracy for a single measurement is relatively rare.
Consequently, <code>characteristics​.is­Empty()</code> is a convenient way to check that an attribute have
all the "standard" characteristics and need no special processing.</div>
<h4>Reading a characteristic</h4>
The characteristic values are enumerated in the <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html#values()" title="class or interface in java.util" class="external-link">map values</a>.
The <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html#keySet()" title="class or interface in java.util" class="external-link">map keys</a> are the <code>String</code> representations of characteristics
<a href="AbstractIdentifiedType.html#getName()">name</a>, for more convenient lookups.
<p>If an attribute is known to be a measurement with a characteristic named "accuracy"
of type <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Float.html" title="class or interface in java.lang" class="external-link"><code>Float</code></a>, then the accuracy value could be read as below:</p>
<blockquote><pre>Float <b>getAccuracy</b>(Attribute&lt;?&gt; measurement) {
Attribute&lt;?&gt; accuracy = measurement.<b>characteristics</b>().<b>get</b>(<font color="orangered">"accuracy"</font>);
<font color="green">if</font> (accuracy != <font color="green">null</font>) {
<font color="green">return</font> (Float) accuracy.<b>getValue</b>(); <i><font color="gray">// Value may be null.</font></i>
} <font color="green">else</font> {
<font color="green">return</font> (Float) measurement.<b>getType</b>().<b>characteristics</b>().<b>get</b>(<font color="orangered">"accuracy"</font>).<b>getDefaultValue</b>();
<i><font color="gray">// A more sophisticated implementation would probably cache the default value somewhere.</font></i>
}
}</pre></blockquote>
<h4>Adding a characteristic</h4>
A new characteristic can be added in the map in three different ways:
<ol>
<li>Putting the (<var>name</var>, <var>characteristic</var>) pair explicitly.
If an older characteristic existed for that name, it will be replaced.
Example:
<blockquote><pre>Attribute&lt;?&gt; accuracy = ...; <i><font color="gray">// To be created by the caller.</font></i>
characteristics.<b>put</b>(<font color="orangered">"accuracy"</font>, accuracy);</pre></blockquote></li>
<li>Adding the new characteristic to the <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html#values()" title="class or interface in java.util" class="external-link">values</a> collection.
The name is inferred automatically from the characteristic type.
If an older characteristic existed for the same name, an <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link"><code>Illegal­State­Exception</code></a> will be thrown.
Example:
<blockquote><pre>Attribute&lt;?&gt; accuracy = ...; <i><font color="gray">// To be created by the caller.</font></i>
characteristics.<b>values</b>().<b>add</b>(accuracy);</pre></blockquote></li>
<li>Adding the characteristic name to the <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html#keySet()" title="class or interface in java.util" class="external-link">key set</a>.
If no characteristic existed for that name, a default one will be created.
Example:
<blockquote><pre>characteristics.<b>keySet</b>().<b>add</b>(<font color="orangered">"accuracy"</font>); <i><font color="gray">// Ensure that an entry will exist for that name.</font></i>
Attribute&lt;?&gt; accuracy = characteristics.<b>get</b>(<font color="orangered">"accuracy"</font>);
Features.<b>cast</b>(accuracy, Float.<font color="green">class</font>).<b>setValue</b>(...); <i><font color="gray">// Set new accuracy value here as a float.</font></i></pre></blockquote></li>
</ol></div>
<dl class="notes">
<dt>Returns:</dt>
<dd>other attribute types that describes this attribute type, or an empty map if none.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="DefaultAttributeType.html#characteristics()"><code>Default­Attribute­Type​.characteristics()</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="quality()">
<h3>quality</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/quality/DataQuality.html" title="class or interface in org.opengis.metadata.quality" class="external-link">DataQuality</a></span>&nbsp;<span class="element-name">quality</span>()</div>
<div class="block">Evaluates the quality of this attribute at this method invocation time. The data quality reports
may include information about whether the attribute value mets the constraints defined by the
<a href="DefaultAttributeType.html" title="class in org.apache.sis.feature">attribute type</a>, or any other criterion at implementation choice.
<p>The default implementation reports data quality with at least the following information:</p>
<ul>
<li>
The <a href="../metadata/iso/quality/DefaultDataQuality.html#getScope()">scope</a>
<a href="../metadata/iso/maintenance/DefaultScope.html#getLevel()">level</a> is set to
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/maintenance/ScopeCode.html#ATTRIBUTE" title="class or interface in org.opengis.metadata.maintenance" class="external-link"><code>Scope­Code​.ATTRIBUTE</code></a>.
</li><li>
At most one <a href="../metadata/iso/quality/DefaultDomainConsistency.html" title="class in org.apache.sis.metadata.iso.quality">domain consistency</a>
element is added to the <a href="../metadata/iso/quality/DefaultDataQuality.html#getReports()">reports</a> list (implementations are free to omit that element if they have nothing to report).
If a report is provided, then it will contain at least the following information:
<ul>
<li>
<p>The <a href="#getName()">attribute name</a> as the data quality
<a href="../metadata/iso/quality/AbstractElement.html#getMeasureIdentification()">measure identification</a>.</p>
<div class="note"><b>Note:</b> strictly speaking, <code>measure­Identification</code> identifies the
<em>quality measurement</em>, not the “real” measurement itself. However, this implementation
uses the same set of identifiers for both for simplicity.</div>
</li><li>
<p>If the attribute <a href="#getValue()">value</a> is not an <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html#isInstance(java.lang.Object)" title="class or interface in java.lang" class="external-link">instance</a>
of the expected <a href="DefaultAttributeType.html#getValueClass()">value class</a>, or if the number
of occurrences is not inside the multiplicity range, or if any other constraint is violated, then
a <a href="../metadata/iso/quality/DefaultConformanceResult.html" title="class in org.apache.sis.metadata.iso.quality">conformance result</a> is
added for each violation with an
<a href="../metadata/iso/quality/DefaultConformanceResult.html#getExplanation()">explanation</a>
set to the error message.</p>
<div class="warning"><b>Note:</b> this is a departure from ISO intent, since <code>explanation</code>
should be a statement about what a successful conformance means. This point may be reformulated
in a future SIS version.</div>
</li>
</ul>
</li>
</ul>
This attribute is valid if this method does not report any
<a href="../metadata/iso/quality/DefaultConformanceResult.html" title="class in org.apache.sis.metadata.iso.quality">conformance result</a> having a
<a href="../metadata/iso/quality/DefaultConformanceResult.html#pass()">pass</a> value of <code>false</code>.
<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()</code> method will return
the following data quality report:
<blockquote><pre>Data quality
  ├─Scope
  │   └─Level………………………………………………… Attribute
  └─Report
      ├─Measure identification
      │   └─Code………………………………………… population
      ├─Evaluation method type…… Direct internal
      └─Result
          ├─Explanation……………………… Missing value for “population” property.
          └─Pass………………………………………… false</pre></blockquote>
</div></div>
<dl class="notes">
<dt>Returns:</dt>
<dd>reports on all constraint violations found.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="AbstractFeature.html#quality()"><code>Abstract­Feature​.quality()</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toString()">
<h3>toString</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">toString</span>()</div>
<div class="block">Returns a string representation of this attribute.
The returned string is for debugging purpose and may change in any future SIS version.
The current implementation is like below:
<blockquote><pre>Attribute[“temperature” : Float] = {20.3, 17.8, 21.1}
└─ characteristics: units=°C, accuracy=0.1</pre></blockquote></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">to­String</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd>
<dt>Returns:</dt>
<dd>a string representation of this attribute for debugging purpose.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="clone()">
<h3>clone</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="AbstractAttribute.html" title="class in org.apache.sis.feature">AbstractAttribute</a>&lt;<a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a>&gt;</span>&nbsp;<span class="element-name">clone</span>()
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/CloneNotSupportedException.html" title="class or interface in java.lang" class="external-link">CloneNotSupportedException</a></span></div>
<div class="block">Returns a copy of this attribute if cloning is supported.
The decision to support cloning or not is left to subclasses. If the subclass does not implement
the <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Cloneable.html" title="class or interface in java.lang" class="external-link"><code>Cloneable</code></a> interface, then this method throws a <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/CloneNotSupportedException.html" title="class or interface in java.lang" class="external-link"><code>Clone­Not­Supported­Exception</code></a>.
Otherwise the default implementation returns a <em>shallow</em> copy of this <code>Attribute</code>:
the attribute <a href="#getValue()">value</a> and <a href="#characteristics()">characteristics</a>
are <strong>not</strong> cloned.
However, subclasses may choose to do otherwise.</div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd>
<dt>Returns:</dt>
<dd>a clone of this attribute.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/CloneNotSupportedException.html" title="class or interface in java.lang" class="external-link">Clone­Not­Supported­Exception</a></code> - if this attribute, the <a href="#getValue()">value</a>
or one of its <a href="#characteristics()">characteristics</a> cannot be cloned.</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &#169; 2010&#x2013;2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>