blob: f2aaff2795fe839ac435065b43092ff751d117af [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (21) on Thu Oct 05 19:54:57 CEST 2023 -->
<title>WritableFeatureSet (Apache SIS 1.4 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="dc.created" content="2023-10-05">
<meta name="description" content="declaration: module: org.apache.sis.storage, package: org.apache.sis.storage, interface: WritableFeatureSet">
<meta name="generator" content="javadoc/ClassWriterImpl">
<meta name="keywords" content="org.apache.sis.storage.WritableFeatureSet interface">
<meta name="keywords" content="updateType()">
<meta name="keywords" content="add()">
<meta name="keywords" content="removeIf()">
<meta name="keywords" content="replaceIf()">
<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">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../script-dir/jquery-3.6.1.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="../../../../module-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</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>Constr</li>
<li><a href="#method-summary">Method</a></li>
</ul>
</li>
<li>
<p>Detail:</p>
<ul>
<li>Field</li>
<li>Constr</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>Constr&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>Constr&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="module-label-in-type">Module</span>&nbsp;<a href="../../../../module-summary.html">org.apache.sis.storage</a></div>
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">org.apache.sis.storage</a></div>
<h1 title="Interface WritableFeatureSet" class="title">Interface WritableFeatureSet</h1>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>All Superinterfaces:</dt>
<dd><code><a href="DataSet.html" title="interface in org.apache.sis.storage">Data­Set</a></code>, <code><a href="FeatureSet.html" title="interface in org.apache.sis.storage">Feature­Set</a></code>, <code><a href="Resource.html" title="interface in org.apache.sis.storage">Resource</a></code></dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public interface </span><span class="element-name type-name-label">WritableFeatureSet</span><span class="extends-implements">
extends <a href="FeatureSet.html" title="interface in org.apache.sis.storage">FeatureSet</a></span></div>
<div class="block">A <a href="FeatureSet.html" title="interface in org.apache.sis.storage"><code>Feature­Set</code></a> with writing capabilities. <code>Writable­Feature­Set</code> inherits the reading capabilities from
its parent and adds the capabilities to <a href="#add(java.util.Iterator)">add</a>, <a href="#removeIf(java.util.function.Predicate)">remove</a>
or <a href="#replaceIf(java.util.function.Predicate,java.util.function.UnaryOperator)">replace</a> feature instances.</div>
<dl class="notes">
<dt>Since:</dt>
<dd>1.0</dd>
</dl>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ========== 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-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></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-tab3"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#add(java.util.Iterator)" class="member-name-link">add</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Iterator.html" title="class or interface in java.util" class="external-link">Iterator</a>&lt;? extends <a href="../../../../../org.apache.sis.feature/org/apache/sis/feature/AbstractFeature.html" title="class in org.apache.sis.feature">Abstract­Feature</a>&gt;&nbsp;features)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Inserts new feature instances in this <code>Feature­Set</code>.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#removeIf(java.util.function.Predicate)" class="member-name-link">remove­If</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Predicate.html" title="class or interface in java.util.function" class="external-link">Predicate</a>&lt;? super <a href="../../../../../org.apache.sis.feature/org/apache/sis/feature/AbstractFeature.html" title="class in org.apache.sis.feature">Abstract­Feature</a>&gt;&nbsp;filter)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Removes all feature instances from this <code>Feature­Set</code> which matches the given predicate.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#replaceIf(java.util.function.Predicate,java.util.function.UnaryOperator)" class="member-name-link">replace­If</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Predicate.html" title="class or interface in java.util.function" class="external-link">Predicate</a>&lt;? super <a href="../../../../../org.apache.sis.feature/org/apache/sis/feature/AbstractFeature.html" title="class in org.apache.sis.feature">Abstract­Feature</a>&gt;&nbsp;filter,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/UnaryOperator.html" title="class or interface in java.util.function" class="external-link">Unary­Operator</a>&lt;<a href="../../../../../org.apache.sis.feature/org/apache/sis/feature/AbstractFeature.html" title="class in org.apache.sis.feature">Abstract­Feature</a>&gt;&nbsp;updater)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Updates all feature instances from this <code>Feature­Set</code> which match the given predicate.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#updateType(org.apache.sis.feature.DefaultFeatureType)" class="member-name-link">update­Type</a><wbr>(<a href="../../../../../org.apache.sis.feature/org/apache/sis/feature/DefaultFeatureType.html" title="class in org.apache.sis.feature">Default­Feature­Type</a>&nbsp;new­Type)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Declares or redefines the type of all feature instances in this feature set.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-DataSet">Methods inherited from interface&nbsp;<a href="DataSet.html" title="interface in org.apache.sis.storage">DataSet</a></h3>
<code><a href="DataSet.html#getEnvelope()">get­Envelope</a></code></div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-FeatureSet">Methods inherited from interface&nbsp;<a href="FeatureSet.html" title="interface in org.apache.sis.storage">FeatureSet</a></h3>
<code><a href="FeatureSet.html#features(boolean)">features</a>, <a href="FeatureSet.html#getType()">get­Type</a>, <a href="FeatureSet.html#subset(org.apache.sis.storage.Query)">subset</a></code></div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-Resource">Methods inherited from interface&nbsp;<a href="Resource.html" title="interface in org.apache.sis.storage">Resource</a></h3>
<code><a href="Resource.html#addListener(java.lang.Class,org.apache.sis.storage.event.StoreListener)">add­Listener</a>, <a href="Resource.html#getIdentifier()">get­Identifier</a>, <a href="Resource.html#getMetadata()">get­Metadata</a>, <a href="Resource.html#removeListener(java.lang.Class,org.apache.sis.storage.event.StoreListener)">remove­Listener</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="updateType(org.apache.sis.feature.DefaultFeatureType)">
<h3>updateType</h3>
<div class="member-signature"><span class="return-type">void</span>&nbsp;<span class="element-name">updateType</span><wbr><span class="parameters">(<a href="../../../../../org.apache.sis.feature/org/apache/sis/feature/DefaultFeatureType.html" title="class in org.apache.sis.feature">DefaultFeatureType</a>&nbsp;newType)</span>
throws <span class="exceptions"><a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></span></div>
<div class="block">Declares or redefines the type of all feature instances in this feature set.
In the case of a newly created feature set, this method can be used for defining the type of features
to be stored (this is not a required step however). In the case of a feature set which already contains
feature instances, this operation may take an undefined amount of time to execute since all features in
the set may need to be transformed.
<p>Feature sets may restrict the kind of changes that are allowed. An <a href="IllegalFeatureTypeException.html" title="class in org.apache.sis.storage"><code>Illegal­Feature­Type­Exception</code></a>
will be thrown if the given type contains incompatible property changes.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>new­Type</code> - new feature type definition (not <code>null</code>).</dd>
<dt>Throws:</dt>
<dd><code><a href="IllegalFeatureTypeException.html" title="class in org.apache.sis.storage">Illegal­Feature­Type­Exception</a></code> - if the given type is not compatible with the types supported by the store.</dd>
<dd><code><a href="DataStoreException.html" title="class in org.apache.sis.storage">Data­Store­Exception</a></code> - if another error occurred while changing the feature type.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="add(java.util.Iterator)">
<h3>add</h3>
<div class="member-signature"><span class="return-type">void</span>&nbsp;<span class="element-name">add</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Iterator.html" title="class or interface in java.util" class="external-link">Iterator</a>&lt;? extends <a href="../../../../../org.apache.sis.feature/org/apache/sis/feature/AbstractFeature.html" title="class in org.apache.sis.feature">AbstractFeature</a>&gt;&nbsp;features)</span>
throws <span class="exceptions"><a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></span></div>
<div class="block">Inserts new feature instances in this <code>Feature­Set</code>.
Any feature already present in this <a href="FeatureSet.html" title="interface in org.apache.sis.storage"><code>Feature­Set</code></a> will remain unmodified.
If a <a href="../../../../../org.apache.sis.feature/org/apache/sis/feature/AbstractFeature.html#getProperty(java.lang.String)">feature property</a> is used as unique identifier, then:
<ul>
<li>If a given feature assigns to that property a value already in use, an exception will be thrown.</li>
<li>If given features do not assign value to that property, identifiers should be generated by the data store.</li>
</ul>
After successful insertion, the new features may appear after the features already present
but not necessarily; ordering is <a href="DataStore.html" title="class in org.apache.sis.storage"><code>Data­Store</code></a> specific.
<h4 id="api-note-heading">API note</h4>
This method expects an <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Iterator.html" title="class or interface in java.util" class="external-link"><code>Iterator</code></a> rather than a <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/stream/Stream.html" title="class or interface in java.util.stream" class="external-link"><code>Stream</code></a> for easing
inter-operability with various API. Implementing a custom <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Iterator.html" title="class or interface in java.util" class="external-link"><code>Iterator</code></a> requires less effort
than implementing a <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/stream/Stream.html" title="class or interface in java.util.stream" class="external-link"><code>Stream</code></a>. On the other side if the user has a <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/stream/Stream.html" title="class or interface in java.util.stream" class="external-link"><code>Stream</code></a>,
obtaining an <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Iterator.html" title="class or interface in java.util" class="external-link"><code>Iterator</code></a> can be done by a call to <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/stream/BaseStream.html#iterator()" title="class or interface in java.util.stream" class="external-link"><code>Base­Stream​.iterator()</code></a>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>features</code> - feature instances to insert or copy in this <code>Feature­Set</code>.</dd>
<dt>Throws:</dt>
<dd><code><a href="IllegalFeatureTypeException.html" title="class in org.apache.sis.storage">Illegal­Feature­Type­Exception</a></code> - if a feature given by the iterator is not of the type expected by this <code>Feature­Set</code>.</dd>
<dd><code><a href="DataStoreException.html" title="class in org.apache.sis.storage">Data­Store­Exception</a></code> - if another error occurred while storing new features.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="removeIf(java.util.function.Predicate)">
<h3>removeIf</h3>
<div class="member-signature"><span class="return-type">void</span>&nbsp;<span class="element-name">removeIf</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Predicate.html" title="class or interface in java.util.function" class="external-link">Predicate</a>&lt;? super <a href="../../../../../org.apache.sis.feature/org/apache/sis/feature/AbstractFeature.html" title="class in org.apache.sis.feature">AbstractFeature</a>&gt;&nbsp;filter)</span>
throws <span class="exceptions"><a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></span></div>
<div class="block">Removes all feature instances from this <code>Feature­Set</code> which matches the given predicate.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>filter</code> - a predicate which returns <code>true</code> for feature instances to be removed.</dd>
<dt>Throws:</dt>
<dd><code><a href="DataStoreException.html" title="class in org.apache.sis.storage">Data­Store­Exception</a></code> - if an error occurred while removing features.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="replaceIf(java.util.function.Predicate,java.util.function.UnaryOperator)">
<h3>replaceIf</h3>
<div class="member-signature"><span class="return-type">void</span>&nbsp;<span class="element-name">replaceIf</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Predicate.html" title="class or interface in java.util.function" class="external-link">Predicate</a>&lt;? super <a href="../../../../../org.apache.sis.feature/org/apache/sis/feature/AbstractFeature.html" title="class in org.apache.sis.feature">AbstractFeature</a>&gt;&nbsp;filter,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/UnaryOperator.html" title="class or interface in java.util.function" class="external-link">UnaryOperator</a>&lt;<a href="../../../../../org.apache.sis.feature/org/apache/sis/feature/AbstractFeature.html" title="class in org.apache.sis.feature">AbstractFeature</a>&gt;&nbsp;updater)</span>
throws <span class="exceptions"><a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></span></div>
<div class="block">Updates all feature instances from this <code>Feature­Set</code> which match the given predicate.
For each <code>Feature</code> instance matching the given <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Predicate.html" title="class or interface in java.util.function" class="external-link"><code>Predicate</code></a>,
the <code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Function.html#apply(T)" title="class or interface in java.util.function" class="external-link">Unary­Operator​.apply(Feature)</a></code> method will be invoked.
<code>Unary­Operator</code>s are free to modify the given <code>Feature</code> <i>in-place</i>
or to return a different feature instance. Two behaviors are possible:
<ul>
<li>If the operator returns a non-null <code>Feature</code>, then the modified feature is stored
in replacement of the previous feature (not necessarily at the same location).</li>
<li>If the operator returns <code>null</code>, then the feature will be removed from the <code>Feature­Set</code>.</li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>filter</code> - a predicate which returns <code>true</code> for feature instances to be updated.</dd>
<dd><code>updater</code> - operation called for each matching <code>Feature</code> instance.</dd>
<dt>Throws:</dt>
<dd><code><a href="IllegalFeatureTypeException.html" title="class in org.apache.sis.storage">Illegal­Feature­Type­Exception</a></code> - if a feature given by the operator is not of the type expected by this <code>Feature­Set</code>.</dd>
<dd><code><a href="DataStoreException.html" title="class in org.apache.sis.storage">Data­Store­Exception</a></code> - if another error occurred while replacing features.</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
</div>
</div>
</body>
</html>