| <!DOCTYPE HTML> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (19) --> |
| <title>Vector (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.math, class: Vector"> |
| <meta name="generator" content="javadoc/ClassWriterImpl"> |
| <meta name="keywords" content="org.apache.sis.math.Vector class"> |
| <meta name="keywords" content="create()"> |
| <meta name="keywords" content="createForDecimal()"> |
| <meta name="keywords" content="createSequence()"> |
| <meta name="keywords" content="getElementType()"> |
| <meta name="keywords" content="isSinglePrecision()"> |
| <meta name="keywords" content="isInteger()"> |
| <meta name="keywords" content="isUnsigned()"> |
| <meta name="keywords" content="size()"> |
| <meta name="keywords" content="isEmptyOrNaN()"> |
| <meta name="keywords" content="isNaN()"> |
| <meta name="keywords" content="doubleValue()"> |
| <meta name="keywords" content="floatValue()"> |
| <meta name="keywords" content="longValue()"> |
| <meta name="keywords" content="intValue()"> |
| <meta name="keywords" content="shortValue()"> |
| <meta name="keywords" content="byteValue()"> |
| <meta name="keywords" content="stringValue()"> |
| <meta name="keywords" content="get()"> |
| <meta name="keywords" content="set()"> |
| <meta name="keywords" content="fill()"> |
| <meta name="keywords" content="repetitions()"> |
| <meta name="keywords" content="increment()"> |
| <meta name="keywords" content="range()"> |
| <meta name="keywords" content="subList()"> |
| <meta name="keywords" content="subSampling()"> |
| <meta name="keywords" content="pick()"> |
| <meta name="keywords" content="concatenate()"> |
| <meta name="keywords" content="repeat()"> |
| <meta name="keywords" content="reverse()"> |
| <meta name="keywords" content="transform()"> |
| <meta name="keywords" content="compress()"> |
| <meta name="keywords" content="buffer()"> |
| <meta name="keywords" content="doubleValues()"> |
| <meta name="keywords" content="floatValues()"> |
| <meta name="keywords" content="toString()"> |
| <meta name="keywords" content="hashCode()"> |
| <meta name="keywords" content="equals()"> |
| <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"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </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/Vector.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><a href="#field-summary">Field</a></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: </li> |
| <li>Nested | </li> |
| <li><a href="#field-summary">Field</a> | </li> |
| <li><a href="#constructor-summary">Constr</a> | </li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| <ul class="sub-nav-list"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor-detail">Constr</a> | </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> <a href="package-summary.html">org.apache.sis.math</a></div> |
| <h1 title="Class Vector" class="title">Class Vector</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"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractCollection.html" title="class or interface in java.util" class="external-link">AbstractCollection</a><E> |
| <div class="inheritance"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html" title="class or interface in java.util" class="external-link">AbstractList</a><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>> |
| <div class="inheritance">Vector</div> |
| </div> |
| </div> |
| </div> |
| <section class="class-description" id="class-description"> |
| <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/lang/Iterable.html" title="class or interface in java.lang" class="external-link">Iterable</a><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></code>, <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><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></code>, <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></code>, <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/RandomAccess.html" title="class or interface in java.util" class="external-link">RandomAccess</a></code></dd> |
| </dl> |
| <hr> |
| <div class="type-signature"><span class="modifiers">public abstract class </span><span class="element-name type-name-label">Vector</span> |
| <span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html" title="class or interface in java.util" class="external-link">AbstractList</a><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>> |
| implements <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/RandomAccess.html" title="class or interface in java.util" class="external-link">RandomAccess</a></span></div> |
| <div class="block">A vector of real numbers. An instance of <code>Vector</code> can be a wrapper around an array of Java primitive type |
| (typically <code>float[]</code> or <code>double[]</code>), or it may be a function calculating values on the fly. |
| Often the two above-cited cases are used together, for example in a time series where: |
| |
| <ul> |
| <li><var>x[i]</var> is a linear function of <var>i</var> |
| (e.g. the sampling time of measurements performed at a fixed time interval)</li> |
| <li><var>y[i]</var> is the measurement of a phenomenon at time <var>x[i]</var>.</li> |
| </ul> |
| |
| <h2>Instantiation</h2> |
| Instances of <code>Vector</code> are usually created by calls to the <a href="#create(java.lang.Object,boolean)"><code>create(Object, boolean)</code></a> static method. |
| The supplied array is not cloned – changes to the primitive array are reflected in the vector, and vice-versa. |
| Vectors can be a view over a subsection of the given array, or can provide a view of the elements in reverse order, |
| <i>etc</i>. The example below creates a view over a subsection: |
| |
| <blockquote><pre><font color="green">float</font>[] array = <font color="green">new</font> <font color="green">float</font>[100]; |
| Vector v = Vector.<b>create</b>(array, <font color="green">false</font>).<b>subList</b>(20, 40) |
| <i><font color="gray">// At this point, v.doubleValue(0) is equivalent to (double) array[20].</font></i></pre></blockquote> |
| |
| <h2>Usage</h2> |
| The methods that are most often used after <code>Vector</code> creation are <a href="#size()"><code>size()</code></a> and <a href="#doubleValue(int)"><code>doubleValue(int)</code></a> |
| or <a href="#intValue(int)"><code>intValue(int)</code></a>. Those methods make abstraction of the underlying data type. For example if the vector is |
| backed by an array of type <code>int[]</code>, then calls to <code>doubleValue(index)</code> will: |
| |
| <ul> |
| <li>Convert the <code>int[index]</code> value to a <code>double</code> value.</li> |
| <li>If <a href="#isUnsigned()"><code>isUnsigned()</code></a> is <code>true</code>, apply the necessary bitmask before conversion.</li> |
| </ul> |
| |
| Widening conversions (for example from <code>short</code> to <code>long</code>) are always allowed. |
| Narrowing conversions are allowed if the result can be represented at least approximately by the target type. |
| For example, conversions from <code>double</code> to <code>float</code> are always allowed (values that are too large for |
| the <code>float</code> type are represented by positive of negative infinity), but conversions from <code>long</code> to |
| <code>short</code> are allowed only if the value is between <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Short.html#MIN_VALUE" title="class or interface in java.lang" class="external-link"><code>Short.MIN_VALUE</code></a> and <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Short.html#MAX_VALUE" title="class or interface in java.lang" class="external-link"><code>Short.MAX_VALUE</code></a> inclusive. |
| |
| <div class="note"><b>Comparison with other API:</b> |
| the above functionalities look like similar functionalities provided by <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link"><code>ByteBuffer</code></a> |
| in standard Java, but they actually serve different purposes. The <code>ByteBuffer</code> getter methods |
| (for example <code>getShort(int)</code>, <code>getLong(int)</code>, <i>etc.</i>) allow to decode a sequence of |
| bytes in a way determined by the type of the value to decode (2 bytes for a <code>short</code>, 8 bytes |
| for a <code>long</code>, <i>etc.</i>) – the type of the stored value must be known before to read it. |
| By contrast, this <code>Vector</code> class is used in situations where <em>the decoding has already been done</em> |
| by the code that <em>create</em> a <code>Vector</code> object, but the data type may not be known |
| by the code that will <em>use</em> the <code>Vector</code> object. |
| For example, a method performing a numerical calculation may want to see the data as <code>double</code> values |
| without concern about whether the data were really stored as <code>double</code> or as <code>float</code> values. |
| For the situations where a <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/Buffer.html" title="class or interface in java.nio" class="external-link"><code>Buffer</code></a> is needed, inter-operability is provided by the <a href="#buffer()"><code>buffer()</code></a> |
| method and by accepting buffer in the <a href="#create(java.lang.Object,boolean)"><code>create(Object, boolean)</code></a> method.</div></div> |
| <dl class="notes"> |
| <dt>Since:</dt> |
| <dd>0.8</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="../util/collection/IntegerList.html" title="class in org.apache.sis.util.collection"><code>IntegerList</code></a></li> |
| </ul> |
| </dd> |
| |
| <p><font size="-1">Defined in the <code>sis-utility</code> module</font></p> |
| </dl> |
| </section> |
| <section class="summary"> |
| <ul class="summary-list"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <li> |
| <section class="field-summary" id="field-summary"> |
| <h2>Field Summary</h2> |
| <div class="inherited-list"> |
| <h3 id="fields-inherited-from-class-AbstractList">Fields inherited from class <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html" title="class or interface in java.util" class="external-link">AbstractList</a></h3> |
| <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html#modCount" title="class or interface in java.util" class="external-link">modCount</a></code></div> |
| </section> |
| </li> |
| <!-- ======== 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()" class="member-name-link">Vector</a>()</code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">For subclasses constructor.</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/Optional.html" title="class or interface in java.util" class="external-link">Optional</a><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/Buffer.html" title="class or interface in java.nio" class="external-link">Buffer</a>></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#buffer()" class="member-name-link">buffer</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 the vector data as a <code>java.nio</code> buffer.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>byte</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#byteValue(int)" class="member-name-link">byteValue</a><wbr>(int index)</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 value at the given index as a <code>byte</code>.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#compress(double)" class="member-name-link">compress</a><wbr>(double tolerance)</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 vector with the same data than this vector but encoded in a more compact way, |
| or <code>this</code> if this method cannot do better than current <code>Vector</code> instance.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#concatenate(org.apache.sis.math.Vector)" class="member-name-link">concatenate</a><wbr>(<a href="Vector.html" title="class in org.apache.sis.math">Vector</a> toAppend)</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 concatenation of this vector with the given one.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#create(double%5B%5D)" class="member-name-link">create</a><wbr>(double[] array)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Wraps the given array of floating point values.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#create(java.lang.Object,boolean)" class="member-name-link">create</a><wbr>(<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> array, |
| boolean isUnsigned)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Wraps the given object in a vector.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#createForDecimal(float%5B%5D)" class="member-name-link">createForDecimal</a><wbr>(float[] array)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Wraps the given <code>float[]</code> array in a vector that preserve the string representations in base 10.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#createSequence(java.lang.Number,java.lang.Number,int)" class="member-name-link">createSequence</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a> first, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a> increment, |
| int length)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Creates a sequence of numbers in a given range of values using the given increment.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract double</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#doubleValue(int)" class="member-name-link">doubleValue</a><wbr>(int index)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"> |
| <div class="block">Returns the value at the given index as a <code>double</code>.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double[]</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#doubleValues()" class="member-name-link">doubleValues</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Copies all values in an array of double precision floating point numbers.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#equals(java.lang.Object)" class="member-name-link">equals</a><wbr>(<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> object)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns <code>true</code> if the given object is a vector containing the same values than this vector.</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="#fill(int,int,java.lang.Number)" class="member-name-link">fill</a><wbr>(int fromIndex, |
| int toIndex, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a> value)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Sets a range of elements to the given number.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>float</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#floatValue(int)" class="member-name-link">floatValue</a><wbr>(int index)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the value at the given index as a <code>float</code>.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>float[]</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#floatValues()" class="member-name-link">floatValues</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Copies all values in an array of single precision floating point numbers.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#get(int)" class="member-name-link">get</a><wbr>(int index)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"> |
| <div class="block">Returns the number at the given index, or <code>null</code> if none.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><? extends <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getElementType()" class="member-name-link">getElementType</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 type of elements in this vector.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#hashCode()" class="member-name-link">hashCode</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 hash code for the values in this vector.</div> |
| </div> |
| <div class="col-first odd-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/Number.html" title="class or interface in java.lang" class="external-link">Number</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#increment(double)" class="member-name-link">increment</a><wbr>(double tolerance)</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 increment between all consecutive values if this increment is constant, or <code>null</code> otherwise.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#intValue(int)" class="member-name-link">intValue</a><wbr>(int index)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the value at the given index as an <code>int</code>.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isEmptyOrNaN()" class="member-name-link">isEmptyOrNaN</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 <code>true</code> if this vector is empty or contains only <code>NaN</code> values.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isInteger()" class="member-name-link">isInteger</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 <code>true</code> if this vector contains only integer values.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract boolean</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#isNaN(int)" class="member-name-link">isNaN</a><wbr>(int index)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"> |
| <div class="block">Returns <code>true</code> if the value at the given index is <code>null</code> or <code>NaN</code>.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isSinglePrecision()" class="member-name-link">isSinglePrecision</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 <code>true</code> if values in this vector can be casted to single-precision floating point numbers |
| (<code>float</code>) without precision lost.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isUnsigned()" class="member-name-link">isUnsigned</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 <code>true</code> if integer values shall be interpreted as unsigned values.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>long</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#longValue(int)" class="member-name-link">longValue</a><wbr>(int index)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the value at the given index as a <code>long</code>.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#pick(int...)" class="member-name-link">pick</a><wbr>(int... indices)</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 view which contains the values of this vector at the given indexes.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../measure/NumberRange.html" title="class in org.apache.sis.measure">NumberRange</a><?></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#range()" class="member-name-link">range</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 the minimal and maximal values found in this vector.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#repeat(boolean,int)" class="member-name-link">repeat</a><wbr>(boolean eachValue, |
| int count)</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 vector whose value is the content of this vector repeated <var>count</var> times.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int[]</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#repetitions(int...)" class="member-name-link">repetitions</a><wbr>(int... candidates)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Detects repetition patterns in the values contained in this vector.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>final <a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#reverse()" class="member-name-link">reverse</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 view which contains the values of this vector in reverse order.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#set(int,java.lang.Number)" class="member-name-link">set</a><wbr>(int index, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a> 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 number at the given index.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>short</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#shortValue(int)" class="member-name-link">shortValue</a><wbr>(int index)</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 value at the given index as a <code>short</code>.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract int</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#size()" class="member-name-link">size</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"> |
| <div class="block">Returns the number of elements in this vector.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract <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 odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#stringValue(int)" class="member-name-link">stringValue</a><wbr>(int index)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"> |
| <div class="block">Returns a string representation of the value at the given index.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>final <a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#subList(int,int)" class="member-name-link">subList</a><wbr>(int lower, |
| int upper)</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 view which contain the values of this vector in the given index range.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#subSampling(int,int,int)" class="member-name-link">subSampling</a><wbr>(int first, |
| int step, |
| int length)</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 view which contain the values of this vector in a given index range.</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">toString</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 vector.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#transform(double,double)" class="member-name-link">transform</a><wbr>(double scale, |
| double offset)</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 view of this vector with all values transformed by the given linear equation.</div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-AbstractList">Methods inherited from class <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html" title="class or interface in java.util" class="external-link">AbstractList</a></h3> |
| <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html#add(int,E)" title="class or interface in java.util" class="external-link">add</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html#add(E)" title="class or interface in java.util" class="external-link">add</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html#addAll(int,java.util.Collection)" title="class or interface in java.util" class="external-link">addAll</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html#clear()" title="class or interface in java.util" class="external-link">clear</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html#indexOf(java.lang.Object)" title="class or interface in java.util" class="external-link">indexOf</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html#iterator()" title="class or interface in java.util" class="external-link">iterator</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html#lastIndexOf(java.lang.Object)" title="class or interface in java.util" class="external-link">lastIndexOf</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html#listIterator()" title="class or interface in java.util" class="external-link">listIterator</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html#listIterator(int)" title="class or interface in java.util" class="external-link">listIterator</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html#remove(int)" title="class or interface in java.util" class="external-link">remove</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html#removeRange(int,int)" title="class or interface in java.util" class="external-link">removeRange</a></code></div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-AbstractCollection">Methods inherited from class <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractCollection.html" title="class or interface in java.util" class="external-link">AbstractCollection</a></h3> |
| <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractCollection.html#addAll(java.util.Collection)" title="class or interface in java.util" class="external-link">addAll</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractCollection.html#contains(java.lang.Object)" title="class or interface in java.util" class="external-link">contains</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractCollection.html#containsAll(java.util.Collection)" title="class or interface in java.util" class="external-link">containsAll</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractCollection.html#isEmpty()" title="class or interface in java.util" class="external-link">isEmpty</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractCollection.html#remove(java.lang.Object)" title="class or interface in java.util" class="external-link">remove</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractCollection.html#removeAll(java.util.Collection)" title="class or interface in java.util" class="external-link">removeAll</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractCollection.html#retainAll(java.util.Collection)" title="class or interface in java.util" class="external-link">retainAll</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractCollection.html#toArray()" title="class or interface in java.util" class="external-link">toArray</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractCollection.html#toArray(T%5B%5D)" title="class or interface in java.util" class="external-link">toArray</a></code></div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-Object">Methods inherited from class <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#clone()" title="class or interface in java.lang" class="external-link">clone</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">getClass</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">notifyAll</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> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-Collection">Methods inherited from interface <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></h3> |
| <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html#parallelStream()" title="class or interface in java.util" class="external-link">parallelStream</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html#removeIf(java.util.function.Predicate)" title="class or interface in java.util" class="external-link">removeIf</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html#stream()" title="class or interface in java.util" class="external-link">stream</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html#toArray(java.util.function.IntFunction)" title="class or interface in java.util" class="external-link">toArray</a></code></div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-Iterable">Methods inherited from interface <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Iterable.html" title="class or interface in java.lang" class="external-link">Iterable</a></h3> |
| <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Iterable.html#forEach(java.util.function.Consumer)" title="class or interface in java.lang" class="external-link">forEach</a></code></div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-List">Methods inherited from interface <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a></h3> |
| <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html#addAll(java.util.Collection)" title="class or interface in java.util" class="external-link">addAll</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html#contains(java.lang.Object)" title="class or interface in java.util" class="external-link">contains</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html#containsAll(java.util.Collection)" title="class or interface in java.util" class="external-link">containsAll</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html#isEmpty()" title="class or interface in java.util" class="external-link">isEmpty</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html#remove(java.lang.Object)" title="class or interface in java.util" class="external-link">remove</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html#removeAll(java.util.Collection)" title="class or interface in java.util" class="external-link">removeAll</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html#replaceAll(java.util.function.UnaryOperator)" title="class or interface in java.util" class="external-link">replaceAll</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html#retainAll(java.util.Collection)" title="class or interface in java.util" class="external-link">retainAll</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html#sort(java.util.Comparator)" title="class or interface in java.util" class="external-link">sort</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html#spliterator()" title="class or interface in java.util" class="external-link">spliterator</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html#toArray()" title="class or interface in java.util" class="external-link">toArray</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html#toArray(T%5B%5D)" title="class or interface in java.util" class="external-link">toArray</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="<init>()"> |
| <h3>Vector</h3> |
| <div class="member-signature"><span class="modifiers">protected</span> <span class="element-name">Vector</span>()</div> |
| <div class="block">For subclasses constructor.</div> |
| </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(java.lang.Object,boolean)"> |
| <h3>create</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></span> <span class="element-name">create</span><wbr><span class="parameters">(<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> array, |
| boolean isUnsigned)</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">Wraps the given object in a vector. The argument should be one of the following: |
| |
| <ul> |
| <li>An array of a primitive type, like <code>float[]</code>.</li> |
| <li>A <code>Number[]</code> array.</li> |
| <li>A <code>String[]</code> array (not recommended, but happen with some file formats).</li> |
| <li>A <code>Vector</code>, in which case it is returned unchanged.</li> |
| <li>A <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/Buffer.html" title="class or interface in java.nio" class="external-link"><code>Buffer</code></a> backed by an array.</li> |
| <li>The <code>null</code> value, in which case <code>null</code> is returned.</li> |
| </ul> |
| |
| The given argument is not cloned. |
| Consequently, changes in the underlying array are reflected in this vector, and vice-versa. |
| |
| <h4>Unsigned integers</h4> |
| Java has no primitive support for unsigned integers. But some file formats use unsigned integers, |
| which can be simulated in Java by the use of bit masks or methods like <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Integer.html#toUnsignedLong(int)" title="class or interface in java.lang" class="external-link"><code>Integer.toUnsignedLong(int)</code></a>. |
| This <code>Vector</code> class applies automatically those masks (unless otherwise noticed in method Javadoc) |
| if the <code>isUnsigned</code> argument is <code>true</code>. |
| That argument applies only to <code>byte[]</code>, <code>short[]</code>, <code>int[]</code> or <code>long[]</code> arrays |
| and is ignored for all other kind of arrays.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>array</code> - the object to wrap in a vector, or <code>null</code>.</dd> |
| <dd><code>isUnsigned</code> - <code>true</code> if integer types should be interpreted as unsigned integers.</dd> |
| <dt>Returns:</dt> |
| <dd>the given object wrapped in a vector, or <code>null</code> if the argument was <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/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - if the type of the given object is not recognized by the method.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="create(double[])"> |
| <h3>create</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></span> <span class="element-name">create</span><wbr><span class="parameters">(double[] array)</span></div> |
| <div class="block">Wraps the given array of floating point values. This method does not clone the array: |
| changes in the given array will be reflected in the returned vector and vice-versa. |
| This method is equivalent to |
| <code><a href="#create(java.lang.Object,boolean)"><code>create</code></a>(array, false)</code> but potentially faster.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>array</code> - the array of floating point values to wrap in a vector, or <code>null</code>.</dd> |
| <dt>Returns:</dt> |
| <dd>the given array wrapped in a vector, or <code>null</code> if the argument was <code>null</code>.</dd> |
| <dt>Since:</dt> |
| <dd>1.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="createForDecimal(float[])"> |
| <h3>createForDecimal</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></span> <span class="element-name">createForDecimal</span><wbr><span class="parameters">(float[] array)</span></div> |
| <div class="block">Wraps the given <code>float[]</code> array in a vector that preserve the string representations in base 10. |
| For example, the 0.1 <code>float</code> value casted to <code>double</code> normally produces 0.10000000149011612 |
| because of the way IEEE 754 arithmetic represents numbers (in base 2 instead of base 10). But the |
| vector returned by this method will convert the 0.1 <code>float</code> value into the 0.1 <code>double</code> value. |
| Note that despite the appearance, this is <strong>not</strong> more accurate than the normal cast, |
| because base 10 is not more privileged in nature than base 2. |
| |
| <h4>When to use</h4> |
| This method can be used when there is good reasons to think that the <code>float</code> numbers were parsed |
| from decimal representations, for example an ASCII file. There is usually no reason to use this method |
| if the values are the result of some numerical computations.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>array</code> - the array of floating point values to wrap in a vector, or <code>null</code>.</dd> |
| <dt>Returns:</dt> |
| <dd>the given array wrapped in a vector, or <code>null</code> if the argument was <code>null</code>.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list-long"> |
| <li><a href="DecimalFunctions.html#floatToDouble(float)"><code>DecimalFunctions.floatToDouble(float)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="createSequence(java.lang.Number,java.lang.Number,int)"> |
| <h3>createSequence</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></span> <span class="element-name">createSequence</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a> first, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a> increment, |
| int length)</span></div> |
| <div class="block">Creates a sequence of numbers in a given range of values using the given increment. |
| The range of values will be <code>first</code> inclusive to <code>(first + increment*length)</code> exclusive. |
| Note that the value given by the <code>first</code> argument is equivalent to a "lowest" or "minimum" value |
| only if the given increment is positive. |
| |
| <p>The <a href="#getElementType()">element type</a> will be inferred from the type of the given |
| <code>Number</code> instances. If will typically be <code>Integer.class</code> for the [100:1:120] range |
| and <code>Double.class</code> for the [0:0.1:1] range.</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>first</code> - the first value, inclusive.</dd> |
| <dd><code>increment</code> - the difference between the values at two adjacent indexes.</dd> |
| <dd><code>length</code> - the length of the desired vector.</dd> |
| <dt>Returns:</dt> |
| <dd>the given sequence as a vector.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getElementType()"> |
| <h3>getElementType</h3> |
| <div class="member-signature"><span class="modifiers">public abstract</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><? extends <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></span> <span class="element-name">getElementType</span>()</div> |
| <div class="block">Returns the type of elements in this vector. If this vector is backed by an array of a primitive type, |
| then this method returns the <em>wrapper</em> class, not the primitive type. For example if this vector |
| is backed by an array of type <code>float[]</code>, then this method returns <code>Float.class</code>, |
| not <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Float.html#TYPE" title="class or interface in java.lang" class="external-link"><code>Float.TYPE</code></a>. |
| |
| <p>The information returned by this method is only indicative; it is not guaranteed to specify accurately |
| this kind of objects returned by the <a href="#get(int)"><code>get(int)</code></a> method. There is various situations where the types |
| may not match:</p> |
| |
| <ul> |
| <li>If this vector <a href="#isUnsigned()">is unsigned</a>, then the values returned by <code>get(int)</code> |
| will be instances of a type wider than the type used by this vector for storing the values.</li> |
| <li>If this vector has been <a href="#createForDecimal(float%5B%5D)">created for decimal numbers</a>, |
| then the values returned by <code>get(int)</code> will use double-precision even if this vector |
| stores the values as single-precision floating point numbers.</li> |
| <li>If this vector <a href="#compress(double)">has been compressed</a>, then the type returned by this |
| method does not describe accurately the range of values that this vector can store.</li> |
| </ul> |
| |
| <p>Users of the <a href="#doubleValue(int)"><code>doubleValue(int)</code></a> method do not need to care about this information since |
| <code>Vector</code> will perform automatically the type conversion. Users of other methods may want to |
| verify this information for avoiding <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link"><code>ArithmeticException</code></a>.</p></div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>the type of elements in this vector.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list-long"> |
| <li><a href="../util/collection/CheckedContainer.html#getElementType()"><code>CheckedContainer.getElementType()</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="isSinglePrecision()"> |
| <h3>isSinglePrecision</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">isSinglePrecision</span>()</div> |
| <div class="block">Returns <code>true</code> if values in this vector can be casted to single-precision floating point numbers |
| (<code>float</code>) without precision lost. In case of doubt, this method conservatively returns <code>false</code>.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>whether values in this vector can be casted to <code>float</code> primitive type.</dd> |
| <dt>Since:</dt> |
| <dd>1.1</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="#floatValue(int)"><code>floatValue(int)</code></a></li> |
| <li><a href="#floatValues()"><code>floatValues()</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="isInteger()"> |
| <h3>isInteger</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">isInteger</span>()</div> |
| <div class="block">Returns <code>true</code> if this vector contains only integer values. |
| This method may iterate over all values for performing this verification.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd><code>true</code> if this vector contains only integer values.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="isUnsigned()"> |
| <h3>isUnsigned</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">isUnsigned</span>()</div> |
| <div class="block">Returns <code>true</code> if integer values shall be interpreted as unsigned values. |
| This method may return <code>true</code> for data stored in <code>byte[]</code>, <code>short[]</code>, <code>int[]</code> |
| or <code>long[]</code> arrays, but never for data stored in <code>float[]</code> and <code>double[]</code> arrays. |
| The default implementation returns <code>false</code>. |
| |
| <p>Unless otherwise noticed in Javadoc, users do not need to care about this information since |
| <code>Vector</code> methods will perform automatically the operations needed for unsigned integers.</p></div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd><code>true</code> if the integer values shall be interpreted as unsigned values.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="size()"> |
| <h3>size</h3> |
| <div class="member-signature"><span class="modifiers">public abstract</span> <span class="return-type">int</span> <span class="element-name">size</span>()</div> |
| <div class="block">Returns the number of elements in this vector.</div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html#size()" title="class or interface in java.util" class="external-link">size</a></code> in interface <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><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></code></dd> |
| <dt>Specified by:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html#size()" title="class or interface in java.util" class="external-link">size</a></code> in interface <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></code></dd> |
| <dt>Specified by:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractCollection.html#size()" title="class or interface in java.util" class="external-link">size</a></code> in class <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractCollection.html" title="class or interface in java.util" class="external-link">AbstractCollection</a><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></code></dd> |
| <dt>Returns:</dt> |
| <dd>the number of elements in this vector.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="isEmptyOrNaN()"> |
| <h3>isEmptyOrNaN</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">isEmptyOrNaN</span>()</div> |
| <div class="block">Returns <code>true</code> if this vector is empty or contains only <code>NaN</code> values.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>whether this vector is empty or contains only <code>NaN</code> values.</dd> |
| <dt>Since:</dt> |
| <dd>1.1</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="isNaN(int)"> |
| <h3>isNaN</h3> |
| <div class="member-signature"><span class="modifiers">public abstract</span> <span class="return-type">boolean</span> <span class="element-name">isNaN</span><wbr><span class="parameters">(int index)</span></div> |
| <div class="block">Returns <code>true</code> if the value at the given index is <code>null</code> or <code>NaN</code>.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>index</code> - the index in the [0 … <a href="#size()">size</a>-1] range.</dd> |
| <dt>Returns:</dt> |
| <dd><code>true</code> if the value at the given index is <code>NaN</code>.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="doubleValue(int)"> |
| <h3>doubleValue</h3> |
| <div class="member-signature"><span class="modifiers">public abstract</span> <span class="return-type">double</span> <span class="element-name">doubleValue</span><wbr><span class="parameters">(int index)</span></div> |
| <div class="block">Returns the value at the given index as a <code>double</code>. |
| This is the safest method since all primitive types supported by <code>Vector</code> |
| are convertible to the <code>double</code> type.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>index</code> - the index in the [0 … <a href="#size()">size</a>-1] range.</dd> |
| <dt>Returns:</dt> |
| <dd>the value at the given index.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/NullPointerException.html" title="class or interface in java.lang" class="external-link">NullPointerException</a></code> - if the value is <code>null</code> (never happen if this vector wraps an array of primitive type).</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/NumberFormatException.html" title="class or interface in java.lang" class="external-link">NumberFormatException</a></code> - if the value is stored as a <code>String</code> and cannot be parsed.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="#doubleValues()"><code>doubleValues()</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="floatValue(int)"> |
| <h3>floatValue</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">float</span> <span class="element-name">floatValue</span><wbr><span class="parameters">(int index)</span></div> |
| <div class="block">Returns the value at the given index as a <code>float</code>. |
| This method may result in a lost of precision if this vector |
| stores or computes its values with the <code>double</code> type. |
| |
| <p>The default implementation delegates to <a href="#doubleValue(int)"><code>doubleValue(int)</code></a> and cast the result to <code>float</code>.</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>index</code> - the index in the [0 … <a href="#size()">size</a>-1] range.</dd> |
| <dt>Returns:</dt> |
| <dd>the value at the given index.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/NullPointerException.html" title="class or interface in java.lang" class="external-link">NullPointerException</a></code> - if the value is <code>null</code> (never happen if this vector wraps an array of primitive type).</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/NumberFormatException.html" title="class or interface in java.lang" class="external-link">NumberFormatException</a></code> - if the value is stored as a <code>String</code> and cannot be parsed.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="#floatValues()"><code>floatValues()</code></a></li> |
| <li><a href="#isSinglePrecision()"><code>isSinglePrecision()</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="longValue(int)"> |
| <h3>longValue</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">long</span> <span class="element-name">longValue</span><wbr><span class="parameters">(int index)</span></div> |
| <div class="block">Returns the value at the given index as a <code>long</code>. |
| If this vector uses floating point values, the value is rounded to the nearest integer. |
| |
| <p>The default implementation delegates to <a href="#doubleValue(int)"><code>doubleValue(int)</code></a> and verifies |
| if the result can be rounded to a <code>long</code> with an error not greater than 0.5. |
| Subclasses that store or compute their values with an integer type should override this method.</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>index</code> - the index in the [0 … <a href="#size()">size</a>-1] range.</dd> |
| <dt>Returns:</dt> |
| <dd>the value at the given index.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/NullPointerException.html" title="class or interface in java.lang" class="external-link">NullPointerException</a></code> - if the value is <code>null</code> (never happen if this vector wraps an array of primitive type).</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/NumberFormatException.html" title="class or interface in java.lang" class="external-link">NumberFormatException</a></code> - if the value is stored as a <code>String</code> and cannot be parsed.</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link">ArithmeticException</a></code> - if the value is too large for the capacity of the <code>long</code> type.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="intValue(int)"> |
| <h3>intValue</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int</span> <span class="element-name">intValue</span><wbr><span class="parameters">(int index)</span></div> |
| <div class="block">Returns the value at the given index as an <code>int</code>. |
| If this vector uses floating point values, the value is rounded to the nearest integer. |
| |
| <p>The default implementation delegates to <a href="#longValue(int)"><code>longValue(int)</code></a> and verifies if the result |
| fits in the <code>int</code> type. Subclasses that store or compute their values with the <code>int</code>, |
| <code>short</code> or <code>byte</code> type should override this method.</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>index</code> - the index in the [0 … <a href="#size()">size</a>-1] range.</dd> |
| <dt>Returns:</dt> |
| <dd>the value at the given index.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/NullPointerException.html" title="class or interface in java.lang" class="external-link">NullPointerException</a></code> - if the value is <code>null</code> (never happen if this vector wraps an array of primitive type).</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/NumberFormatException.html" title="class or interface in java.lang" class="external-link">NumberFormatException</a></code> - if the value is stored as a <code>String</code> and cannot be parsed.</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link">ArithmeticException</a></code> - if the value is too large for the capacity of the <code>int</code> type.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="shortValue(int)"> |
| <h3>shortValue</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">short</span> <span class="element-name">shortValue</span><wbr><span class="parameters">(int index)</span></div> |
| <div class="block">Returns the value at the given index as a <code>short</code>. |
| If this vector uses floating point values, the value is rounded to the nearest integer. |
| |
| <p>The default implementation delegates to <a href="#longValue(int)"><code>longValue(int)</code></a> and verifies if the result |
| fits in the <code>short</code> type. Subclasses that store or compute their values with the <code>short</code> |
| or <code>byte</code> type should override this method.</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>index</code> - the index in the [0 … <a href="#size()">size</a>-1] range.</dd> |
| <dt>Returns:</dt> |
| <dd>the value at the given index.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/NullPointerException.html" title="class or interface in java.lang" class="external-link">NullPointerException</a></code> - if the value is <code>null</code> (never happen if this vector wraps an array of primitive type).</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/NumberFormatException.html" title="class or interface in java.lang" class="external-link">NumberFormatException</a></code> - if the value is stored as a <code>String</code> and cannot be parsed.</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link">ArithmeticException</a></code> - if the value is too large for the capacity of the <code>short</code> type.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="byteValue(int)"> |
| <h3>byteValue</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">byte</span> <span class="element-name">byteValue</span><wbr><span class="parameters">(int index)</span></div> |
| <div class="block">Returns the value at the given index as a <code>byte</code>. |
| If this vector uses floating point values, the value is rounded to the nearest integer. |
| |
| <p>The default implementation delegates to <a href="#longValue(int)"><code>longValue(int)</code></a> and verifies if the result |
| fits in the <code>byte</code> type. Subclasses that store or compute their values with the <code>byte</code> |
| type should override this method.</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>index</code> - the index in the [0 … <a href="#size()">size</a>-1] range.</dd> |
| <dt>Returns:</dt> |
| <dd>the value at the given index.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/NullPointerException.html" title="class or interface in java.lang" class="external-link">NullPointerException</a></code> - if the value is <code>null</code> (never happen if this vector wraps an array of primitive type).</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/NumberFormatException.html" title="class or interface in java.lang" class="external-link">NumberFormatException</a></code> - if the value is stored as a <code>String</code> and cannot be parsed.</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link">ArithmeticException</a></code> - if the value is too large for the capacity of the <code>byte</code> type.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="stringValue(int)"> |
| <h3>stringValue</h3> |
| <div class="member-signature"><span class="modifiers">public abstract</span> <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> <span class="element-name">stringValue</span><wbr><span class="parameters">(int index)</span></div> |
| <div class="block">Returns a string representation of the value at the given index. |
| Invoking this method is generally equivalent to invoking |
| <code>String.valueOf(<a href="#get(int)">get</a>(index))</code> |
| except if the values are <a href="#isUnsigned()">unsigned integers</a>.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>index</code> - the index in the [0 … <a href="#size()">size</a>-1] range.</dd> |
| <dt>Returns:</dt> |
| <dd>a string representation of the value at the given index (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/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="#toString()"><code>toString()</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="get(int)"> |
| <h3>get</h3> |
| <div class="member-signature"><span class="modifiers">public abstract</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a></span> <span class="element-name">get</span><wbr><span class="parameters">(int index)</span></div> |
| <div class="block">Returns the number at the given index, or <code>null</code> if none. |
| The object returned by this method is usually an instance of the class returned by <a href="#getElementType()"><code>getElementType()</code></a>, |
| but may also be an instance of a wider type if this is necessary for representing the values. |
| |
| <div class="note"><b>Example:</b> |
| if <a href="#getElementType()"><code>getElementType()</code></a> returns <code>Byte.class</code> but <a href="#isUnsigned()"><code>isUnsigned()</code></a> returns <code>true</code>, |
| then this method will rather return instances of <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Short.html" title="class or interface in java.lang" class="external-link"><code>Short</code></a> because that type is the smallest Java |
| primitive type capable to hold byte values in the [0 … 255] range. But the elements are still stored |
| internally as <code>byte</code>, and the vector cannot accept values outside the [0 … 255] range even if |
| they are valid <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Short.html" title="class or interface in java.lang" class="external-link"><code>Short</code></a> values.</div> |
| |
| The class of returned objects should be stable. For example, this method should not use different types |
| for different range of values. This stability is recommended but not guaranteed because <code>Vector</code> |
| can also wrap arbitrary <code>Number[]</code> arrays.</div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html#get(int)" title="class or interface in java.util" class="external-link">get</a></code> in interface <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></code></dd> |
| <dt>Specified by:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html#get(int)" title="class or interface in java.util" class="external-link">get</a></code> in class <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html" title="class or interface in java.util" class="external-link">AbstractList</a><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></code></dd> |
| <dt>Parameters:</dt> |
| <dd><code>index</code> - the index in the [0 … <a href="#size()">size</a>-1] range.</dd> |
| <dt>Returns:</dt> |
| <dd>the value at the given index (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/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/NumberFormatException.html" title="class or interface in java.lang" class="external-link">NumberFormatException</a></code> - if the value is stored as a <code>String</code> and cannot be parsed.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="set(int,java.lang.Number)"> |
| <h3>set</h3> |
| <div class="member-signature"><span class="modifiers">public abstract</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a></span> <span class="element-name">set</span><wbr><span class="parameters">(int index, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a> value)</span></div> |
| <div class="block">Sets the number at the given index. |
| The given number should be an instance of the same type than the number returned by <a href="#get(int)"><code>get(int)</code></a>. |
| If not, the stored value may lost precision as a result of the cast.</div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html#set(int,E)" title="class or interface in java.util" class="external-link">set</a></code> in interface <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></code></dd> |
| <dt>Overrides:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html#set(int,E)" title="class or interface in java.util" class="external-link">set</a></code> in class <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html" title="class or interface in java.util" class="external-link">AbstractList</a><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></code></dd> |
| <dt>Parameters:</dt> |
| <dd><code>index</code> - the index in the [0 … <a href="#size()">size</a>-1] range.</dd> |
| <dd><code>value</code> - the value to set at the given index.</dd> |
| <dt>Returns:</dt> |
| <dd>the value previously stored at the given index.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/UnsupportedOperationException.html" title="class or interface in java.lang" class="external-link">UnsupportedOperationException</a></code> - if this vector is read-only.</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/NumberFormatException.html" title="class or interface in java.lang" class="external-link">NumberFormatException</a></code> - if the previous value was stored as a <code>String</code> and cannot be parsed.</dd> |
| <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">IllegalArgumentException</a></code> - if this vector uses some <a href="#compress(double)">compression</a> technic |
| and the given value is out of range for that compression.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="fill(int,int,java.lang.Number)"> |
| <h3>fill</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">fill</span><wbr><span class="parameters">(int fromIndex, |
| int toIndex, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a> value)</span></div> |
| <div class="block">Sets a range of elements to the given number. Invoking this method is equivalent |
| to invoking <a href="#set(int,java.lang.Number)"><code>set(int, Number)</code></a> in a loop, but potentially much more efficient.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>fromIndex</code> - index of the first element (inclusive) to be filled with the specified value.</dd> |
| <dd><code>toIndex</code> - index of the last element (exclusive) to be filled with the specified value.</dd> |
| <dd><code>value</code> - the value to be stored in elements of the vector.</dd> |
| <dt>Since:</dt> |
| <dd>1.1</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="repetitions(int...)"> |
| <h3>repetitions</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int[]</span> <span class="element-name">repetitions</span><wbr><span class="parameters">(int... candidates)</span></div> |
| <div class="block">Detects repetition patterns in the values contained in this vector. The repetitions detected by this method are |
| patterns that at repeated at a regular interval on the whole vector; this method does not search for repetitions |
| occurring at irregular intervals. This method returns an array of typically 0, 1 or 2 elements where zero element |
| means that no repetition has been found, one element describes a repetition (see the example below), and two elements |
| describes a repetition of the repetitions (examples below). More elements (deeper recursivity) are theoretically |
| possible but not yet implemented. |
| |
| <p>If the values in this vector are of the form (<var>x</var>, <var>x</var>, …, <var>x</var>, <var>y</var>, <var>y</var>, |
| …, <var>y</var>, <var>z</var>, <var>z</var>, …, <var>z</var>, …), then the first integer in the returned array is the |
| number of consecutive <var>x</var> values before the <var>y</var> values. That number of occurrences must be the same |
| than the number of consecutive <var>y</var> values before the <var>z</var> values, the number of consecutive <var>z</var> |
| values before the next values, and so on until the end of the vector.</p> |
| |
| <div class="note"><b>Examples:</b> |
| in the following vector, each value is repeated 3 times. So the array returned by this method would be <code>{4}</code>, |
| meaning that the first number appears 4 times, followed by a new number appearing 4 times, followed by a new number |
| appearing 4 times, and so on until the end of the vector. |
| |
| <blockquote><pre>10, 10, 10, 10, |
| 12, 12, 12, 12, |
| 15, 15, 15, 15</pre></blockquote></div> |
| |
| For the next level (the second integer in the returned array), this method represents above repetitions by single entities |
| then reapplies the same repetition detection. This method processes has if the (<var>x</var>, <var>x</var>, …, <var>x</var>, |
| <var>y</var>, <var>y</var>, …, <var>y</var>, <var>z</var>, <var>z</var>, …, <var>z</var>, …) vector was replaced by a new |
| (<b>x</b>, <b>y</b>, <b>z</b>, …) vector, then the same detection algorithm was applied recursively. |
| |
| <div class="note"><b>Examples:</b> |
| in the following vector, each value is repeated 2 times, then the sequence of 12 values is itself repeated 2 times. |
| So the array returned by this method would be <code>{3,4}</code>, meaning that the first number appears 3 times, followed |
| by a new number appearing 3 times, <i>etc.</i> until we counted 4 groups of 3 numbers. Then the whole sequence is |
| repeated until the end of the vector. |
| |
| <blockquote><pre>10, 10, 10, 12, 12, 12, 15, 15, 15, 18, 18, 18, |
| 10, 10, 10, 12, 12, 12, 15, 15, 15, 18, 18, 18, |
| 10, 10, 10, 12, 12, 12, 15, 15, 15, 18, 18, 18</pre></blockquote></div> |
| |
| <p>This method is useful for analyzing the localization grid provided by some files (for example in netCDF format). |
| Those grids sometimes have constant longitude for the same column index, or constant latitude for the same row index. |
| This method can detect such regularity, which allows more efficient handling of the <cite>grid to CRS</cite> transform.</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>candidates</code> - probable values, or <code>null</code> or an empty array if unknown. If non-empty, those values will be used |
| for narrowing the search, which may improve performances. There is no guarantee that the values returned by this |
| method will be among the given candidates.</dd> |
| <dt>Returns:</dt> |
| <dd>the number of times that entities (numbers, or group of numbers) appears consecutively with identical values. |
| If no such repetition is found, an empty array.</dd> |
| <dt>Since:</dt> |
| <dd>1.0</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list-long"> |
| <li><a href="#repeat(boolean,int)"><code>repeat(boolean, int)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="increment(double)"> |
| <h3>increment</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a></span> <span class="element-name">increment</span><wbr><span class="parameters">(double tolerance)</span></div> |
| <div class="block">Returns the increment between all consecutive values if this increment is constant, or <code>null</code> otherwise. |
| If the returned value is non-null, then the following condition shall hold for all values of <var>i</var> in |
| the [0 … <a href="#size()"><code>size()</code></a> - 1] range: |
| |
| <blockquote><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#abs(double)" title="class or interface in java.lang" class="external-link">abs</a>(<a href="#doubleValue(int)">doubleValue</a>(<var>i</var>) |
| - (doubleValue(0) + increment*<var>i</var>)) ≤ tolerance</code></blockquote> |
| |
| The tolerance threshold can be zero if exact matches are desired. |
| The return value (if non-null) is always a signed value, |
| even if this vector <a href="#isUnsigned()">is unsigned</a>.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>tolerance</code> - the tolerance threshold for verifying if the increment is constant.</dd> |
| <dt>Returns:</dt> |
| <dd>the increment as a signed value, or <code>null</code> if the increment is not constant.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="range()"> |
| <h3>range</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="../measure/NumberRange.html" title="class in org.apache.sis.measure">NumberRange</a><?></span> <span class="element-name">range</span>()</div> |
| <div class="block">Returns the minimal and maximal values found in this vector.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>minimal and maximal values found in this vector.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="subList(int,int)"> |
| <h3>subList</h3> |
| <div class="member-signature"><span class="modifiers">public final</span> <span class="return-type"><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></span> <span class="element-name">subList</span><wbr><span class="parameters">(int lower, |
| int upper)</span></div> |
| <div class="block">Returns a view which contain the values of this vector in the given index range. |
| The returned view will contain the values from index <code>lower</code> inclusive to |
| <code>upper</code> exclusive. |
| |
| <div class="note"><b>Implementation note:</b> this method delegates its work |
| <code><a href="#subSampling(int,int,int)">subSampling</a>(lower, 1, upper - lower)</code>. |
| This method is declared final in order to force subclasses to override <code>subSampling(…)</code> instead.</div></div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html#subList(int,int)" title="class or interface in java.util" class="external-link">subList</a></code> in interface <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></code></dd> |
| <dt>Overrides:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html#subList(int,int)" title="class or interface in java.util" class="external-link">subList</a></code> in class <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html" title="class or interface in java.util" class="external-link">AbstractList</a><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></code></dd> |
| <dt>Parameters:</dt> |
| <dd><code>lower</code> - index of the first value to be included in the returned view.</dd> |
| <dd><code>upper</code> - index after the last value to be included in the returned view.</dd> |
| <dt>Returns:</dt> |
| <dd>a view of this vector containing values in the given index range.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if an index is outside the [0 … <a href="#size()">size</a>-1] range.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="subSampling(int,int,int)"> |
| <h3>subSampling</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></span> <span class="element-name">subSampling</span><wbr><span class="parameters">(int first, |
| int step, |
| int length)</span></div> |
| <div class="block">Returns a view which contain the values of this vector in a given index range. |
| The returned view will contain the values from index <code>first</code> inclusive to |
| <code>(first + step*length)</code> exclusive with index incremented by the given <code>step</code> value, |
| which can be negative. More specifically the index <var>i</var> in the returned vector will maps |
| the element at index <code>(first + step*<var>i</var>)</code> in this vector. |
| |
| <p>This method does not copy the values. Consequently, any modification to the |
| values of this vector will be reflected in the returned view and vice-versa.</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>first</code> - index of the first value in this vector to be included in the returned view.</dd> |
| <dd><code>step</code> - the index increment between values in this vector to be included in the returned view. |
| Can be positive, zero or negative.</dd> |
| <dd><code>length</code> - the length of the view to be returned. Cannot be greater than |
| the length of this vector, except if the <code>step</code> is zero.</dd> |
| <dt>Returns:</dt> |
| <dd>a view of this vector containing values in the given index range.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if <code>first</code> or <code>first + step*(length-1)</code> |
| is outside the [0 … <a href="#size()">size</a>-1] range.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="pick(int...)"> |
| <h3>pick</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></span> <span class="element-name">pick</span><wbr><span class="parameters">(int... indices)</span></div> |
| <div class="block">Returns a view which contains the values of this vector at the given indexes. |
| This method does not copy the values, consequently any modification to the |
| values of this vector will be reflected in the returned view and vice-versa. |
| |
| <p>The indexes do not need to be in any particular order. The same index can be repeated |
| more than once. Thus it is possible to create a vector larger than the original vector.</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>indices</code> - indexes of the values to be returned.</dd> |
| <dt>Returns:</dt> |
| <dd>a view of this vector containing values at the given indexes.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if at least one index is out of bounds.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="concatenate(org.apache.sis.math.Vector)"> |
| <h3>concatenate</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></span> <span class="element-name">concatenate</span><wbr><span class="parameters">(<a href="Vector.html" title="class in org.apache.sis.math">Vector</a> toAppend)</span></div> |
| <div class="block">Returns the concatenation of this vector with the given one. Indexes in the [0 … <a href="#size()"><code>size</code></a> - 1] |
| range will map to this vector, while indexes in the [<code>size</code> … <code>size</code> + <code>toAppend.size</code>] |
| range while map to the given vector.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>toAppend</code> - the vector to concatenate at the end of this vector.</dd> |
| <dt>Returns:</dt> |
| <dd>the concatenation of this vector with the given vector.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="repeat(boolean,int)"> |
| <h3>repeat</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></span> <span class="element-name">repeat</span><wbr><span class="parameters">(boolean eachValue, |
| int count)</span></div> |
| <div class="block">Returns a vector whose value is the content of this vector repeated <var>count</var> times. |
| The content can be repeated in two different ways: |
| |
| <ul> |
| <li>If <code>eachValue</code> is <code>true</code>, then each value is repeated <code>count</code> times |
| before to move to the next value.</li> |
| <li>If <code>eachValue</code> is <code>false</code>, then whole vector is repeated <code>count</code> times.</li> |
| </ul> |
| |
| <div class="note"><b>Example:</b> |
| if <code>vec</code> contains <code>{1, 2, 3}</code>, then: |
| <ul> |
| <li><code>vec.repeat(true, 4)</code> returns <code>{1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3}</code>.</li> |
| <li><code>vec.repeat(false, 4)</code> returns <code>{1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3}</code>.</li> |
| </ul></div> |
| |
| This method returns an empty vector if <code>count</code> is zero and returns <code>this</code> if <code>count</code> is one. |
| For other positive <code>count</code> values, this method returns an unmodifiable view of this vector: |
| changes in this vector are reflected in the repeated vector.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>eachValue</code> - whether to apply the repetition on each value (<code>true</code>) or on the whole vector (<code>false</code>).</dd> |
| <dd><code>count</code> - number of repetitions as a positive number (including zero).</dd> |
| <dt>Returns:</dt> |
| <dd>this vector repeated <var>count</var> time.</dd> |
| <dt>Since:</dt> |
| <dd>1.0</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="#repetitions(int...)"><code>repetitions(int...)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="reverse()"> |
| <h3>reverse</h3> |
| <div class="member-signature"><span class="modifiers">public final</span> <span class="return-type"><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></span> <span class="element-name">reverse</span>()</div> |
| <div class="block">Returns a view which contains the values of this vector in reverse order. |
| |
| <div class="note"><b>Implementation note:</b> this method delegates its work |
| to <code><a href="#subSampling(int,int,int)">subSampling</a>(size-1, -1, <a href="#size()">size</a>)</code>. |
| This method is declared final in order to force subclasses to override <code>subSampling(…)</code> instead.</div></div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>the vector values in reverse order.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="transform(double,double)"> |
| <h3>transform</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></span> <span class="element-name">transform</span><wbr><span class="parameters">(double scale, |
| double offset)</span></div> |
| <div class="block">Returns a view of this vector with all values transformed by the given linear equation. |
| If <code>scale</code> = 1 and <code>offset</code> = 0, then this method returns <code>this</code>. |
| Otherwise this method returns a vector where each value at index <var>i</var> is computed |
| by <code>doubleValue(i)</code> × <code>scale</code> + <code>offset</code>. |
| The values are computed on-the-fly; they are not copied.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>scale</code> - the scale factor to apply on each value, or 1 if none.</dd> |
| <dd><code>offset</code> - the offset to apply on each value, or 0 if none.</dd> |
| <dt>Returns:</dt> |
| <dd>a vector with values computed by <code>doubleValue(i)</code> × <code>scale</code> + <code>offset</code>.</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">IllegalArgumentException</a></code> - if an argument is NaN or infinite.</dd> |
| <dt>Since:</dt> |
| <dd>1.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="compress(double)"> |
| <h3>compress</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></span> <span class="element-name">compress</span><wbr><span class="parameters">(double tolerance)</span></div> |
| <div class="block">Returns a vector with the same data than this vector but encoded in a more compact way, |
| or <code>this</code> if this method cannot do better than current <code>Vector</code> instance. |
| Examples: |
| |
| <ul> |
| <li>Vector is backed by an <code>int[]</code> array while values could be stored as <code>short</code> values.</li> |
| <li>Vector contains increasing or decreasing values with a constant delta between consecutive values.</li> |
| </ul> |
| |
| The returned vector may or may not be backed by the array given to the <a href="#create(java.lang.Object,boolean)"><code>create(Object, boolean)</code></a> method. |
| Since the returned array may be a copy of <code>this</code> array, caller should not retain reference to <code>this</code> |
| or reference to the backing array after this method call (otherwise an unnecessary duplication of data may exist |
| in memory). |
| |
| <h4>When to use</h4> |
| It is usually not worth to compress small arrays. Performance-critical arrays may not be compressed neither. |
| This method is best suited for vectors that may potentially be large and for which the cost of fetching |
| values in that vector is small compared to the calculation performed with the values.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>tolerance</code> - maximal difference allowed between original and compressed vectors (can be zero).</dd> |
| <dt>Returns:</dt> |
| <dd>a more compact vector with the same data than this vector, or <code>this</code>.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="buffer()"> |
| <h3>buffer</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Optional.html" title="class or interface in java.util" class="external-link">Optional</a><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/Buffer.html" title="class or interface in java.nio" class="external-link">Buffer</a>></span> <span class="element-name">buffer</span>()</div> |
| <div class="block">Returns the vector data as a <code>java.nio</code> buffer. |
| Data are not copied: changes in the buffer are reflected on this vector and vice-versa. |
| Date are provided in their "raw" form. For example, unsigned integers are given as plain <code>int</code> elements |
| and it is caller responsibility to use <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Integer.html#toUnsignedLong(int)" title="class or interface in java.lang" class="external-link"><code>Integer.toUnsignedLong(int)</code></a> if needed.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>the vector data as a buffer. Absent if this vector is not backed by an array or a buffer.</dd> |
| <dt>Since:</dt> |
| <dd>1.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="doubleValues()"> |
| <h3>doubleValues</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">double[]</span> <span class="element-name">doubleValues</span>()</div> |
| <div class="block">Copies all values in an array of double precision floating point numbers. |
| This method is for inter-operability with APIs requiring an array of primitive type. |
| |
| <p>The default implementation invokes <a href="#doubleValue(int)"><code>doubleValue(int)</code></a> for all indices from 0 inclusive |
| to <a href="#size()"><code>size()</code></a> exclusive. Subclasses may override with more efficient implementation.</p></div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>a copy of all floating point values in this vector.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="#doubleValue(int)"><code>doubleValue(int)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="floatValues()"> |
| <h3>floatValues</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">float[]</span> <span class="element-name">floatValues</span>()</div> |
| <div class="block">Copies all values in an array of single precision floating point numbers. |
| This method is for inter-operability with APIs requiring an array of primitive type. |
| |
| <p>The default implementation invokes <a href="#floatValue(int)"><code>floatValue(int)</code></a> for all indices from 0 inclusive |
| to <a href="#size()"><code>size()</code></a> exclusive. Subclasses may override with more efficient implementation.</p></div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>a copy of all floating point values in this vector.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="#floatValue(int)"><code>floatValue(int)</code></a></li> |
| <li><a href="#isSinglePrecision()"><code>isSinglePrecision()</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> <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> <span class="element-name">toString</span>()</div> |
| <div class="block">Returns a string representation of this vector.</div> |
| <dl class="notes"> |
| <dt>Overrides:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractCollection.html#toString()" title="class or interface in java.util" class="external-link">toString</a></code> in class <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractCollection.html" title="class or interface in java.util" class="external-link">AbstractCollection</a><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></code></dd> |
| <dt>Returns:</dt> |
| <dd>a string representation of this vector.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="#stringValue(int)"><code>stringValue(int)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="hashCode()"> |
| <h3>hashCode</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int</span> <span class="element-name">hashCode</span>()</div> |
| <div class="block">Returns a hash code for the values in this vector. The hash code is computed as if this vector was converted |
| to an array of <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link"><code>Number</code></a>s, then the <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Arrays.html#hashCode(java.lang.Object%5B%5D)" title="class or interface in java.util" class="external-link"><code>Arrays.hashCode(Object[])</code></a> method invoked for that array. |
| This contract is defined for compatibility with <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html#hashCode()" title="class or interface in java.util" class="external-link"><code>List.hashCode()</code></a> contract.</div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html#hashCode()" title="class or interface in java.util" class="external-link">hashCode</a></code> in interface <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><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></code></dd> |
| <dt>Specified by:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html#hashCode()" title="class or interface in java.util" class="external-link">hashCode</a></code> in interface <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></code></dd> |
| <dt>Overrides:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html#hashCode()" title="class or interface in java.util" class="external-link">hashCode</a></code> in class <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html" title="class or interface in java.util" class="external-link">AbstractList</a><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></code></dd> |
| <dt>Returns:</dt> |
| <dd>a hash code value for the values in this vector.</dd> |
| <dt>Since:</dt> |
| <dd>1.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="equals(java.lang.Object)"> |
| <h3>equals</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">equals</span><wbr><span class="parameters">(<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> object)</span></div> |
| <div class="block">Returns <code>true</code> if the given object is a vector containing the same values than this vector. |
| This method performs the comparison as if the two vectors where converted to arrays of <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link"><code>Number</code></a>s, |
| then the <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Arrays.html#equals(java.lang.Object%5B%5D,java.lang.Object%5B%5D)" title="class or interface in java.util" class="external-link"><code>Arrays.equals(Object[], Object[])</code></a> method invoked for those arrays.</div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html#equals(java.lang.Object)" title="class or interface in java.util" class="external-link">equals</a></code> in interface <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><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></code></dd> |
| <dt>Specified by:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html#equals(java.lang.Object)" title="class or interface in java.util" class="external-link">equals</a></code> in interface <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></code></dd> |
| <dt>Overrides:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html#equals(java.lang.Object)" title="class or interface in java.util" class="external-link">equals</a></code> in class <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/AbstractList.html" title="class or interface in java.util" class="external-link">AbstractList</a><<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>></code></dd> |
| <dt>Parameters:</dt> |
| <dd><code>object</code> - the other object to compare with this vector.</dd> |
| <dt>Returns:</dt> |
| <dd><code>true</code> if the given object is a vector containing the same values than this vector.</dd> |
| <dt>Since:</dt> |
| <dd>1.0</dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= END OF CLASS DATA ========= --> |
| </main> |
| <footer role="contentinfo"> |
| <hr> |
| <p class="legal-copy"><small>Copyright © 2010–2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </div> |
| </div> |
| </body> |
| </html> |