blob: b28511f527878f4b86198e38f3bcafa3c06846af [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (11.0.4) on Fri Sep 20 12:10:30 CEST 2019 -->
<title>AbstractAttribute (Apache SIS 1.0 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2019-09-20">
<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="../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="AbstractAttribute (Apache SIS 1.0 API)";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":9,"i3":10,"i4":10,"i5":6,"i6":10,"i7":10,"i8":6,"i9":10,"i10":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../";
var useModuleDirectories = false;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">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">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<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="subNavList">
<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>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.apache.sis.feature</a></div>
<h2 title="Class AbstractAttribute" class="title">Class AbstractAttribute&lt;V&gt;</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></li>
<li>
<ul class="inheritance">
<li>AbstractAttribute&lt;V&gt;</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>V</code> - the type of attribute values.</dd>
</dl>
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a></code></dd>
</dl>
<hr>
<pre>public abstract class <span class="typeNameLabel">AbstractAttribute&lt;V&gt;</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a>
implements <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a></pre>
<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>.
<div class="section">Limitations</div>
<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/javase/8/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>Cloneable</code></a> interface themselves if they choose
to support cloning.</li>
</ul></div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>0.5</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="AbstractFeature.html" title="class in org.apache.sis.feature"><code>Abstract­Feature</code></a>,
<a href="DefaultAttributeType.html" title="class in org.apache.sis.feature"><code>Default­Attribute­Type</code></a>,
<a href="../../../../serialized-form.html#org.apache.sis.feature.AbstractAttribute">Serialized Form</a></dd>
<p><font size="-1">Defined in the <code>sis-feature</code> module</font></p>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier</th>
<th class="colSecond" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected </code></td>
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(org.apache.sis.feature.DefaultAttributeType)">AbstractAttribute</a></span>&#8203;(<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)</code></th>
<td class="colLast">
<div class="block">Creates a new attribute of the given type.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>,&#8203;<a href="AbstractAttribute.html" title="class in org.apache.sis.feature">AbstractAttribute</a>&lt;?&gt;&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#characteristics()">characteristics</a></span>()</code></th>
<td class="colLast">
<div class="block">Other attributes that describes this attribute.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><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;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#clone()">clone</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a copy of this attribute if cloning is supported.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static &lt;V&gt;&nbsp;<a href="AbstractAttribute.html" title="class in org.apache.sis.feature">AbstractAttribute</a>&lt;V&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#create(org.apache.sis.feature.DefaultAttributeType)">create</a></span>&#8203;(<a href="DefaultAttributeType.html" title="class in org.apache.sis.feature">DefaultAttributeType</a>&lt;V&gt;&nbsp;type)</code></th>
<td class="colLast">
<div class="block">Creates a new attribute of the given type initialized to the
<a href="DefaultAttributeType.html#getDefaultValue()">default value</a>.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="http://www.geoapi.org/3.0/javadoc/org/opengis/util/GenericName.html?is-external=true" title="class or interface in org.opengis.util" class="externalLink">GenericName</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getName()">getName</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the name of this attribute as defined by its <a href="#getType()">type</a>.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><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;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getType()">getType</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns information about the attribute (base Java class, domain of values, <i>etc.</i>).</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>abstract <a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getValue()">getValue</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the attribute value, or <code>null</code> if none.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a>&lt;<a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getValues()">getValues</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns all attribute values, or an empty collection if none.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/quality/DataQuality.html?is-external=true" title="class or interface in org.opengis.metadata.quality" class="externalLink">DataQuality</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#quality()">quality</a></span>()</code></th>
<td class="colLast">
<div class="block">Evaluates the quality of this attribute at this method invocation time.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>abstract void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setValue(V)">setValue</a></span>&#8203;(<a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a>&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Sets the attribute value.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setValues(java.util.Collection)">setValues</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a>&lt;? extends <a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a>&gt;&nbsp;values)</code></th>
<td class="colLast">
<div class="block">Sets the attribute values.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toString()">toString</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a string representation of this attribute.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">get­Class</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hash­Code</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notify­All</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink">wait</a></code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a id="&lt;init&gt;(org.apache.sis.feature.DefaultAttributeType)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>AbstractAttribute</h4>
<pre>protected&nbsp;AbstractAttribute&#8203;(<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)</pre>
<div class="block">Creates a new attribute of the given type.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>type</code> - information about the attribute (base Java class, domain of values, <i>etc.</i>).</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#create(org.apache.sis.feature.DefaultAttributeType)"><code>create(Default­Attribute­Type)</code></a></dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="create(org.apache.sis.feature.DefaultAttributeType)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>create</h4>
<pre class="methodSignature">public static&nbsp;&lt;V&gt;&nbsp;<a href="AbstractAttribute.html" title="class in org.apache.sis.feature">AbstractAttribute</a>&lt;V&gt;&nbsp;create&#8203;(<a href="DefaultAttributeType.html" title="class in org.apache.sis.feature">DefaultAttributeType</a>&lt;V&gt;&nbsp;type)</pre>
<div class="block">Creates a new attribute of the given type initialized to the
<a href="DefaultAttributeType.html#getDefaultValue()">default value</a>.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>V</code> - the type of attribute values.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>type</code> - information about the attribute (base Java class, domain of values, <i>etc.</i>).</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the new attribute.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="DefaultAttributeType.html#newInstance()"><code>Default­Attribute­Type​.new­Instance()</code></a></dd>
</dl>
</li>
</ul>
<a id="getName()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getName</h4>
<pre class="methodSignature">public&nbsp;<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/util/GenericName.html?is-external=true" title="class or interface in org.opengis.util" class="externalLink">GenericName</a>&nbsp;getName()</pre>
<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>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the attribute name specified by its type.</dd>
</dl>
</li>
</ul>
<a id="getType()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getType</h4>
<pre class="methodSignature">public&nbsp;<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;getType()</pre>
<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>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>information about the attribute.</dd>
</dl>
</li>
</ul>
<a id="getValue()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValue</h4>
<pre class="methodSignature">public abstract&nbsp;<a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a>&nbsp;getValue()
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalStateException</a></pre>
<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>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the attribute value (may be <code>null</code>).</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang" class="externalLink">Illegal­State­Exception</a></code> - if this attribute contains more than one value.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="AbstractFeature.html#getPropertyValue(java.lang.String)"><code>Abstract­Feature​.get­Property­Value(String)</code></a></dd>
</dl>
</li>
</ul>
<a id="getValues()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValues</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a>&lt;<a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a>&gt;&nbsp;getValues()</pre>
<div class="block">Returns all attribute values, or an empty collection if none.
The returned collection is <cite>live</cite>: 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>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the attribute values in a <cite>live</cite> collection.</dd>
</dl>
</li>
</ul>
<a id="setValue(java.lang.Object)">
<!-- -->
</a><a id="setValue(V)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setValue</h4>
<pre class="methodSignature">public abstract&nbsp;void&nbsp;setValue&#8203;(<a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a>&nbsp;value)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></pre>
<div class="block">Sets the attribute value. All previous values are replaced by the given singleton.
<div class="section">Validation</div>
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>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - the new value, or <code>null</code> for removing all values from this attribute.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">Illegal­Argument­Exception</a></code> - if this method verifies argument validity and the given value
does not met the attribute constraints.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="AbstractFeature.html#setPropertyValue(java.lang.String,java.lang.Object)"><code>Abstract­Feature​.set­Property­Value(String, Object)</code></a></dd>
</dl>
</li>
</ul>
<a id="setValues(java.util.Collection)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setValues</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setValues&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a>&lt;? extends <a href="AbstractAttribute.html" title="type parameter in AbstractAttribute">V</a>&gt;&nbsp;values)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></pre>
<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>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>values</code> - the new values.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">Illegal­Argument­Exception</a></code> - if the given collection contains too many elements.</dd>
</dl>
</li>
</ul>
<a id="characteristics()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>characteristics</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>,&#8203;<a href="AbstractAttribute.html" title="class in org.apache.sis.feature">AbstractAttribute</a>&lt;?&gt;&gt;&nbsp;characteristics()</pre>
<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>
<div class="section">Reading a characteristic</div>
The characteristic values are enumerated in the <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true#values()" title="class or interface in java.util" class="externalLink">map values</a>.
The <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true#keySet()" title="class or interface in java.util" class="externalLink">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/javase/8/docs/api/java/lang/Float.html?is-external=true" title="class or interface in java.lang" class="externalLink"><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>
<div class="section">Adding a characteristic</div>
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/javase/8/docs/api/java/util/Map.html?is-external=true#values()" title="class or interface in java.util" class="externalLink">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/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang" class="externalLink"><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/javase/8/docs/api/java/util/Map.html?is-external=true#keySet()" title="class or interface in java.util" class="externalLink">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>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>other attribute types that describes this attribute type, or an empty map if none.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="DefaultAttributeType.html#characteristics()"><code>Default­Attribute­Type​.characteristics()</code></a></dd>
</dl>
</li>
</ul>
<a id="quality()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>quality</h4>
<pre class="methodSignature">public&nbsp;<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/quality/DataQuality.html?is-external=true" title="class or interface in org.opengis.metadata.quality" class="externalLink">DataQuality</a>&nbsp;quality()</pre>
<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/metadata/maintenance/ScopeCode.html?is-external=true#ATTRIBUTE" title="class or interface in org.opengis.metadata.maintenance" class="externalLink"><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/javase/8/docs/api/java/lang/Class.html?is-external=true#isInstance(java.lang.Object)" title="class or interface in java.lang" class="externalLink">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>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>reports on all constraint violations found.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="AbstractFeature.html#quality()"><code>Abstract­Feature​.quality()</code></a></dd>
</dl>
</li>
</ul>
<a id="toString()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;toString()</pre>
<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>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">to­String</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a string representation of this attribute for debugging purpose.</dd>
</dl>
</li>
</ul>
<a id="clone()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>clone</h4>
<pre class="methodSignature">public&nbsp;<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;&nbsp;clone()
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CloneNotSupportedException.html?is-external=true" title="class or interface in java.lang" class="externalLink">CloneNotSupportedException</a></pre>
<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/javase/8/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>Cloneable</code></a> interface, then this method throws a <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CloneNotSupportedException.html?is-external=true" title="class or interface in java.lang" class="externalLink"><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>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink">clone</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a clone of this attribute.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CloneNotSupportedException.html?is-external=true" title="class or interface in java.lang" class="externalLink">Clone­Not­Supported­Exception</a></code> - if this attribute, the <a href="#getValue()">value</a>
or one of its <a href="#characteristics()">characteristics</a> can not be cloned.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">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">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<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="subNavList">
<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>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright &#169; 2010&#x2013;2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</body>
</html>