| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (11.0.4) on Fri Sep 20 12:10:30 CEST 2019 --> |
| <title>Vector (Apache SIS 1.0 API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2019-09-20"> |
| <meta name="keywords" content="org.apache.sis.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="isInteger()"> |
| <meta name="keywords" content="isUnsigned()"> |
| <meta name="keywords" content="size()"> |
| <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="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="../../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../jquery/jquery-3.3.1.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jquery-migrate-3.0.1.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="Vector (Apache SIS 1.0 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":9,"i5":9,"i6":9,"i7":9,"i8":6,"i9":10,"i10":10,"i11":10,"i12":10,"i13":6,"i14":6,"i15":10,"i16":10,"i17":10,"i18":10,"i19":6,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":6,"i28":10,"i29":6,"i30":6,"i31":10,"i32":10,"i33":10,"i34":10}; |
| var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../"; |
| var useModuleDirectories = false; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/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">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </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="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.apache.sis.math</a></div> |
| <h2 title="Class Vector" class="title">Class Vector</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractCollection.html?is-external=true" title="class or interface in java.util" class="externalLink">AbstractCollection</a><E></li> |
| <li> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true" title="class or interface in java.util" class="externalLink">AbstractList</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></li> |
| <li> |
| <ul class="inheritance"> |
| <li>Vector</li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Iterable</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></code>, <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></code>, <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></code>, <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/RandomAccess.html?is-external=true" title="class or interface in java.util" class="externalLink">RandomAccess</a></code></dd> |
| </dl> |
| <hr> |
| <pre>public abstract class <span class="typeNameLabel">Vector</span> |
| extends <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true" title="class or interface in java.util" class="externalLink">AbstractList</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>> |
| implements <a href="https://docs.oracle.com/javase/8/docs/api/java/util/RandomAccess.html?is-external=true" title="class or interface in java.util" class="externalLink">RandomAccess</a></pre> |
| <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> |
| |
| <div class="section">Instantiation</div> |
| 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> |
| |
| <div class="section">Usage</div> |
| 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/javase/8/docs/api/java/lang/Short.html?is-external=true#MIN_VALUE" title="class or interface in java.lang" class="externalLink"><code>Short.MIN_VALUE</code></a> and <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Short.html?is-external=true#MAX_VALUE" title="class or interface in java.lang" class="externalLink"><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/javase/8/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio" class="externalLink"><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/javase/8/docs/api/java/nio/Buffer.html?is-external=true" title="class or interface in java.nio" class="externalLink"><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> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.8</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../util/collection/IntegerList.html" title="class in org.apache.sis.util.collection"><code>IntegerList</code></a></dd> |
| |
| <p><font size="-1">Defined in the <code>sis-utility</code> module</font></p> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <ul class="blockList"> |
| <li class="blockList"><a id="fields.inherited.from.class.AbstractList"> |
| <!-- --> |
| </a> |
| <h3>Fields inherited from class <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true" title="class or interface in java.util" class="externalLink">AbstractList</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true#modCount" title="class or interface in java.util" class="externalLink">modCount</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier</th> |
| <th class="colSecond" scope="col">Constructor</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected </code></td> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">Vector</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">For subclasses constructor.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html?is-external=true" title="class or interface in java.util" class="externalLink">Optional</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/Buffer.html?is-external=true" title="class or interface in java.nio" class="externalLink">Buffer</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#buffer()">buffer</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the vector data as a <code>java.nio</code> buffer.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>byte</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#byteValue(int)">byteValue</a></span>​(int index)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the value at the given index as a <code>byte</code>.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#compress(double)">compress</a></span>​(double tolerance)</code></th> |
| <td class="colLast"> |
| <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 can not do better than current <code>Vector</code> instance.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#concatenate(org.apache.sis.math.Vector)">concatenate</a></span>​(<a href="Vector.html" title="class in org.apache.sis.math">Vector</a> toAppend)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the concatenation of this vector with the given one.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>static <a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#create(double%5B%5D)">create</a></span>​(double[] array)</code></th> |
| <td class="colLast"> |
| <div class="block">Wraps the given array of floating point values.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>static <a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#create(java.lang.Object,boolean)">create</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> array, |
| boolean isUnsigned)</code></th> |
| <td class="colLast"> |
| <div class="block">Wraps the given object in a vector.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>static <a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#createForDecimal(float%5B%5D)">createForDecimal</a></span>​(float[] array)</code></th> |
| <td class="colLast"> |
| <div class="block">Wraps the given <code>float[]</code> array in a vector that preserve the string representations in base 10.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>static <a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#createSequence(java.lang.Number,java.lang.Number,int)">createSequence</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a> first, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a> increment, |
| int length)</code></th> |
| <td class="colLast"> |
| <div class="block">Creates a sequence of numbers in a given range of values using the given increment.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>abstract double</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#doubleValue(int)">doubleValue</a></span>​(int index)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the value at the given index as a <code>double</code>.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>double[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#doubleValues()">doubleValues</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Copies all values in an array of double precision floating point numbers.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#equals(java.lang.Object)">equals</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> object)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns <code>true</code> if the given object is a vector containing the same values than this vector.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code>float</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#floatValue(int)">floatValue</a></span>​(int index)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the value at the given index as a <code>float</code>.</div> |
| </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code>float[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#floatValues()">floatValues</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Copies all values in an array of single precision floating point numbers.</div> |
| </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code>abstract <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#get(int)">get</a></span>​(int index)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the number at the given index, or <code>null</code> if none.</div> |
| </td> |
| </tr> |
| <tr id="i14" class="altColor"> |
| <td class="colFirst"><code>abstract <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a><? extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getElementType()">getElementType</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the type of elements in this vector.</div> |
| </td> |
| </tr> |
| <tr id="i15" class="rowColor"> |
| <td class="colFirst"><code>int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#hashCode()">hashCode</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a hash code for the values in this vector.</div> |
| </td> |
| </tr> |
| <tr id="i16" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#increment(double)">increment</a></span>​(double tolerance)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the increment between all consecutive values if this increment is constant, or <code>null</code> otherwise.</div> |
| </td> |
| </tr> |
| <tr id="i17" class="rowColor"> |
| <td class="colFirst"><code>int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#intValue(int)">intValue</a></span>​(int index)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the value at the given index as an <code>int</code>.</div> |
| </td> |
| </tr> |
| <tr id="i18" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isInteger()">isInteger</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns <code>true</code> if this vector contains only integer values.</div> |
| </td> |
| </tr> |
| <tr id="i19" class="rowColor"> |
| <td class="colFirst"><code>abstract boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isNaN(int)">isNaN</a></span>​(int index)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns <code>true</code> if the value at the given index is <code>null</code> or <code>NaN</code>.</div> |
| </td> |
| </tr> |
| <tr id="i20" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isUnsigned()">isUnsigned</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns <code>true</code> if integer values shall be interpreted as unsigned values.</div> |
| </td> |
| </tr> |
| <tr id="i21" class="rowColor"> |
| <td class="colFirst"><code>long</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#longValue(int)">longValue</a></span>​(int index)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the value at the given index as a <code>long</code>.</div> |
| </td> |
| </tr> |
| <tr id="i22" class="altColor"> |
| <td class="colFirst"><code><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#pick(int...)">pick</a></span>​(int... indices)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a view which contains the values of this vector at the given indexes.</div> |
| </td> |
| </tr> |
| <tr id="i23" class="rowColor"> |
| <td class="colFirst"><code><a href="../measure/NumberRange.html" title="class in org.apache.sis.measure">NumberRange</a><?></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#range()">range</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the minimal and maximal values found in this vector.</div> |
| </td> |
| </tr> |
| <tr id="i24" class="altColor"> |
| <td class="colFirst"><code><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#repeat(boolean,int)">repeat</a></span>​(boolean eachValue, |
| int count)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a vector whose value is the content of this vector repeated <var>count</var> times.</div> |
| </td> |
| </tr> |
| <tr id="i25" class="rowColor"> |
| <td class="colFirst"><code>int[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#repetitions(int...)">repetitions</a></span>​(int... candidates)</code></th> |
| <td class="colLast"> |
| <div class="block">Detects repetition patterns in the values contained in this vector.</div> |
| </td> |
| </tr> |
| <tr id="i26" class="altColor"> |
| <td class="colFirst"><code><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#reverse()">reverse</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a view which contains the values of this vector in reverse order.</div> |
| </td> |
| </tr> |
| <tr id="i27" class="rowColor"> |
| <td class="colFirst"><code>abstract <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#set(int,java.lang.Number)">set</a></span>​(int index, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a> value)</code></th> |
| <td class="colLast"> |
| <div class="block">Sets the number at the given index.</div> |
| </td> |
| </tr> |
| <tr id="i28" class="altColor"> |
| <td class="colFirst"><code>short</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#shortValue(int)">shortValue</a></span>​(int index)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the value at the given index as a <code>short</code>.</div> |
| </td> |
| </tr> |
| <tr id="i29" class="rowColor"> |
| <td class="colFirst"><code>abstract int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#size()">size</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the number of elements in this vector.</div> |
| </td> |
| </tr> |
| <tr id="i30" class="altColor"> |
| <td class="colFirst"><code>abstract <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#stringValue(int)">stringValue</a></span>​(int index)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a string representation of the value at the given index.</div> |
| </td> |
| </tr> |
| <tr id="i31" class="rowColor"> |
| <td class="colFirst"><code><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#subList(int,int)">subList</a></span>​(int lower, |
| int upper)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a view which contain the values of this vector in the given index range.</div> |
| </td> |
| </tr> |
| <tr id="i32" class="altColor"> |
| <td class="colFirst"><code><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#subSampling(int,int,int)">subSampling</a></span>​(int first, |
| int step, |
| int length)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a view which contain the values of this vector in a given index range.</div> |
| </td> |
| </tr> |
| <tr id="i33" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toString()">toString</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a string representation of this vector.</div> |
| </td> |
| </tr> |
| <tr id="i34" class="altColor"> |
| <td class="colFirst"><code><a href="Vector.html" title="class in org.apache.sis.math">Vector</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#transform(double,double)">transform</a></span>​(double scale, |
| double offset)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a view of this vector with all values transformed by the given linear equation.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.AbstractList"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true" title="class or interface in java.util" class="externalLink">AbstractList</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true#add(int,E)" title="class or interface in java.util" class="externalLink">add</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true#add(E)" title="class or interface in java.util" class="externalLink">add</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true#addAll(int,java.util.Collection)" title="class or interface in java.util" class="externalLink">addAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true#clear()" title="class or interface in java.util" class="externalLink">clear</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true#indexOf(java.lang.Object)" title="class or interface in java.util" class="externalLink">indexOf</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true#iterator()" title="class or interface in java.util" class="externalLink">iterator</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true#lastIndexOf(java.lang.Object)" title="class or interface in java.util" class="externalLink">lastIndexOf</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true#listIterator()" title="class or interface in java.util" class="externalLink">listIterator</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true#listIterator(int)" title="class or interface in java.util" class="externalLink">listIterator</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true#remove(int)" title="class or interface in java.util" class="externalLink">remove</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true#removeRange(int,int)" title="class or interface in java.util" class="externalLink">removeRange</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.AbstractCollection"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractCollection.html?is-external=true" title="class or interface in java.util" class="externalLink">AbstractCollection</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractCollection.html?is-external=true#addAll(java.util.Collection)" title="class or interface in java.util" class="externalLink">addAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractCollection.html?is-external=true#contains(java.lang.Object)" title="class or interface in java.util" class="externalLink">contains</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractCollection.html?is-external=true#containsAll(java.util.Collection)" title="class or interface in java.util" class="externalLink">containsAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractCollection.html?is-external=true#isEmpty()" title="class or interface in java.util" class="externalLink">isEmpty</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractCollection.html?is-external=true#remove(java.lang.Object)" title="class or interface in java.util" class="externalLink">remove</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractCollection.html?is-external=true#removeAll(java.util.Collection)" title="class or interface in java.util" class="externalLink">removeAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractCollection.html?is-external=true#retainAll(java.util.Collection)" title="class or interface in java.util" class="externalLink">retainAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractCollection.html?is-external=true#toArray()" title="class or interface in java.util" class="externalLink">toArray</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractCollection.html?is-external=true#toArray(T%5B%5D)" title="class or interface in java.util" class="externalLink">toArray</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink">wait</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.Collection"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from interface <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#parallelStream()" title="class or interface in java.util" class="externalLink">parallelStream</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#removeIf(java.util.function.Predicate)" title="class or interface in java.util" class="externalLink">removeIf</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#stream()" title="class or interface in java.util" class="externalLink">stream</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#toArray(java.util.function.IntFunction)" title="class or interface in java.util" class="externalLink">toArray</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.Iterable"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from interface <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Iterable</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true#forEach(java.util.function.Consumer)" title="class or interface in java.lang" class="externalLink">forEach</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.List"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from interface <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#addAll(java.util.Collection)" title="class or interface in java.util" class="externalLink">addAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#contains(java.lang.Object)" title="class or interface in java.util" class="externalLink">contains</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#containsAll(java.util.Collection)" title="class or interface in java.util" class="externalLink">containsAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#isEmpty()" title="class or interface in java.util" class="externalLink">isEmpty</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#remove(java.lang.Object)" title="class or interface in java.util" class="externalLink">remove</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#removeAll(java.util.Collection)" title="class or interface in java.util" class="externalLink">removeAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#replaceAll(java.util.function.UnaryOperator)" title="class or interface in java.util" class="externalLink">replaceAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#retainAll(java.util.Collection)" title="class or interface in java.util" class="externalLink">retainAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#sort(java.util.Comparator)" title="class or interface in java.util" class="externalLink">sort</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#spliterator()" title="class or interface in java.util" class="externalLink">spliterator</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#toArray()" title="class or interface in java.util" class="externalLink">toArray</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#toArray(T%5B%5D)" title="class or interface in java.util" class="externalLink">toArray</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a id="<init>()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>Vector</h4> |
| <pre>protected Vector()</pre> |
| <div class="block">For subclasses constructor.</div> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="create(java.lang.Object,boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>create</h4> |
| <pre class="methodSignature">public static <a href="Vector.html" title="class in org.apache.sis.math">Vector</a> create​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> array, |
| boolean isUnsigned) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></pre> |
| <div class="block">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/javase/8/docs/api/java/nio/Buffer.html?is-external=true" title="class or interface in java.nio" class="externalLink"><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. |
| |
| <div class="section">Unsigned integers</div> |
| 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/javase/8/docs/api/java/lang/Integer.html?is-external=true#toUnsignedLong(int)" title="class or interface in java.lang" class="externalLink"><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> |
| <dt><span class="paramLabel">Parameters:</span></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><span class="returnLabel">Returns:</span></dt> |
| <dd>the given object wrapped in a vector, or <code>null</code> if the argument was <code>null</code>.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - if the type of the given object is not recognized by the method.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="create(double[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>create</h4> |
| <pre class="methodSignature">public static <a href="Vector.html" title="class in org.apache.sis.math">Vector</a> create​(double[] array)</pre> |
| <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> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>array</code> - the array of floating point values to wrap in a vector, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the given array wrapped in a vector, or <code>null</code> if the argument was <code>null</code>.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="createForDecimal(float[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>createForDecimal</h4> |
| <pre class="methodSignature">public static <a href="Vector.html" title="class in org.apache.sis.math">Vector</a> createForDecimal​(float[] array)</pre> |
| <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 than 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. |
| |
| <div class="section">When to use</div> |
| 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> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>array</code> - the array of floating point values to wrap in a vector, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the given array wrapped in a vector, or <code>null</code> if the argument was <code>null</code>.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="DecimalFunctions.html#floatToDouble(float)"><code>DecimalFunctions.floatToDouble(float)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="createSequence(java.lang.Number,java.lang.Number,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>createSequence</h4> |
| <pre class="methodSignature">public static <a href="Vector.html" title="class in org.apache.sis.math">Vector</a> createSequence​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a> first, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a> increment, |
| int length)</pre> |
| <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> |
| <dt><span class="paramLabel">Parameters:</span></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><span class="returnLabel">Returns:</span></dt> |
| <dd>the given sequence as a vector.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getElementType()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getElementType</h4> |
| <pre class="methodSignature">public abstract <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a><? extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>> getElementType()</pre> |
| <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/javase/8/docs/api/java/lang/Float.html?is-external=true#TYPE" title="class or interface in java.lang" class="externalLink"><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> |
| may 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/javase/8/docs/api/java/lang/ArithmeticException.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>ArithmeticException</code></a>.</p></div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the type of elements in this vector.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../util/collection/CheckedContainer.html#getElementType()"><code>CheckedContainer.getElementType()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isInteger()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isInteger</h4> |
| <pre class="methodSignature">public boolean isInteger()</pre> |
| <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> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if this vector contains only integer values.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isUnsigned()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isUnsigned</h4> |
| <pre class="methodSignature">public boolean isUnsigned()</pre> |
| <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> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if the integer values shall be interpreted as unsigned values.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="size()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>size</h4> |
| <pre class="methodSignature">public abstract int size()</pre> |
| <div class="block">Returns the number of elements in this vector.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#size()" title="class or interface in java.util" class="externalLink">size</a></code> in interface <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></code></dd> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#size()" title="class or interface in java.util" class="externalLink">size</a></code> in interface <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></code></dd> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractCollection.html?is-external=true#size()" title="class or interface in java.util" class="externalLink">size</a></code> in class <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractCollection.html?is-external=true" title="class or interface in java.util" class="externalLink">AbstractCollection</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></code></dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the number of elements in this vector.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isNaN(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isNaN</h4> |
| <pre class="methodSignature">public abstract boolean isNaN​(int index)</pre> |
| <div class="block">Returns <code>true</code> if the value at the given index is <code>null</code> or <code>NaN</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>index</code> - the index in the [0 … <a href="#size()">size</a>-1] range.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if the value at the given index is <code>NaN</code>.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="doubleValue(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>doubleValue</h4> |
| <pre class="methodSignature">public abstract double doubleValue​(int index)</pre> |
| <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> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>index</code> - the index in the [0 … <a href="#size()">size</a>-1] range.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the value at the given index.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang" class="externalLink">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/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NumberFormatException</a></code> - if the value is stored as a <code>String</code> and can not be parsed.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#doubleValues()"><code>doubleValues()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="floatValue(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>floatValue</h4> |
| <pre class="methodSignature">public float floatValue​(int index)</pre> |
| <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> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>index</code> - the index in the [0 … <a href="#size()">size</a>-1] range.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the value at the given index.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang" class="externalLink">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/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NumberFormatException</a></code> - if the value is stored as a <code>String</code> and can not be parsed.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#floatValues()"><code>floatValues()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="longValue(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>longValue</h4> |
| <pre class="methodSignature">public long longValue​(int index)</pre> |
| <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> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>index</code> - the index in the [0 … <a href="#size()">size</a>-1] range.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the value at the given index.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang" class="externalLink">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/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NumberFormatException</a></code> - if the value is stored as a <code>String</code> and can not be parsed.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ArithmeticException.html?is-external=true" title="class or interface in java.lang" class="externalLink">ArithmeticException</a></code> - if the value is too large for the capacity of the <code>long</code> type.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="intValue(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>intValue</h4> |
| <pre class="methodSignature">public int intValue​(int index)</pre> |
| <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> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>index</code> - the index in the [0 … <a href="#size()">size</a>-1] range.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the value at the given index.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang" class="externalLink">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/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NumberFormatException</a></code> - if the value is stored as a <code>String</code> and can not be parsed.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ArithmeticException.html?is-external=true" title="class or interface in java.lang" class="externalLink">ArithmeticException</a></code> - if the value is too large for the capacity of the <code>int</code> type.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="shortValue(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>shortValue</h4> |
| <pre class="methodSignature">public short shortValue​(int index)</pre> |
| <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> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>index</code> - the index in the [0 … <a href="#size()">size</a>-1] range.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the value at the given index.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang" class="externalLink">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/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NumberFormatException</a></code> - if the value is stored as a <code>String</code> and can not be parsed.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ArithmeticException.html?is-external=true" title="class or interface in java.lang" class="externalLink">ArithmeticException</a></code> - if the value is too large for the capacity of the <code>short</code> type.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="byteValue(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>byteValue</h4> |
| <pre class="methodSignature">public byte byteValue​(int index)</pre> |
| <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> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>index</code> - the index in the [0 … <a href="#size()">size</a>-1] range.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the value at the given index.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang" class="externalLink">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/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NumberFormatException</a></code> - if the value is stored as a <code>String</code> and can not be parsed.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ArithmeticException.html?is-external=true" title="class or interface in java.lang" class="externalLink">ArithmeticException</a></code> - if the value is too large for the capacity of the <code>byte</code> type.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="stringValue(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>stringValue</h4> |
| <pre class="methodSignature">public abstract <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> stringValue​(int index)</pre> |
| <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> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>index</code> - the index in the [0 … <a href="#size()">size</a>-1] range.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a string representation of the value at the given index (may be <code>null</code>).</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#toString()"><code>toString()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="get(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>get</h4> |
| <pre class="methodSignature">public abstract <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a> get​(int index)</pre> |
| <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 may return instances of <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Short.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>Short</code></a> since that type is the smallest Java primitive |
| type capable to hold byte values in the [0 … 255] range.</div></div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#get(int)" title="class or interface in java.util" class="externalLink">get</a></code> in interface <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></code></dd> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true#get(int)" title="class or interface in java.util" class="externalLink">get</a></code> in class <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true" title="class or interface in java.util" class="externalLink">AbstractList</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>index</code> - the index in the [0 … <a href="#size()">size</a>-1] range.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the value at the given index (may be <code>null</code>).</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NumberFormatException</a></code> - if the value is stored as a <code>String</code> and can not be parsed.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="set(int,java.lang.Number)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>set</h4> |
| <pre class="methodSignature">public abstract <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a> set​(int index, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a> value)</pre> |
| <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> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#set(int,E)" title="class or interface in java.util" class="externalLink">set</a></code> in interface <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></code></dd> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true#set(int,E)" title="class or interface in java.util" class="externalLink">set</a></code> in class <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true" title="class or interface in java.util" class="externalLink">AbstractList</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></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><span class="returnLabel">Returns:</span></dt> |
| <dd>the value previously stored at the given index.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang" class="externalLink">UnsupportedOperationException</a></code> - if this vector is read-only.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NumberFormatException</a></code> - if the previous value was stored as a <code>String</code> and can not be parsed.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">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> |
| </li> |
| </ul> |
| <a id="repetitions(int...)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>repetitions</h4> |
| <pre class="methodSignature">public int[] repetitions​(int... candidates)</pre> |
| <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 sometime 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> |
| <dt><span class="paramLabel">Parameters:</span></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 guarantees that the values returned by this |
| method will be among the given candidates.</dd> |
| <dt><span class="returnLabel">Returns:</span></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><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.0</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#repeat(boolean,int)"><code>repeat(boolean, int)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="increment(double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>increment</h4> |
| <pre class="methodSignature">public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a> increment​(double tolerance)</pre> |
| <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/javase/8/docs/api/java/lang/Math.html?is-external=true#abs(double)" title="class or interface in java.lang" class="externalLink">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> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>tolerance</code> - the tolerance threshold for verifying if the increment is constant.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the increment as a signed value, or <code>null</code> if the increment is not constant.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="range()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>range</h4> |
| <pre class="methodSignature">public <a href="../measure/NumberRange.html" title="class in org.apache.sis.measure">NumberRange</a><?> range()</pre> |
| <div class="block">Returns the minimal and maximal values found in this vector.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>minimal and maximal values found in this vector.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="subList(int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>subList</h4> |
| <pre class="methodSignature">public final <a href="Vector.html" title="class in org.apache.sis.math">Vector</a> subList​(int lower, |
| int upper)</pre> |
| <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> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#subList(int,int)" title="class or interface in java.util" class="externalLink">subList</a></code> in interface <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></code></dd> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true#subList(int,int)" title="class or interface in java.util" class="externalLink">subList</a></code> in class <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true" title="class or interface in java.util" class="externalLink">AbstractList</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></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><span class="returnLabel">Returns:</span></dt> |
| <dd>a view of this vector containing values in the given index range.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IndexOutOfBoundsException</a></code> - if an index is outside the [0 … <a href="#size()">size</a>-1] range.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="subSampling(int,int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>subSampling</h4> |
| <pre class="methodSignature">public <a href="Vector.html" title="class in org.apache.sis.math">Vector</a> subSampling​(int first, |
| int step, |
| int length)</pre> |
| <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> |
| <dt><span class="paramLabel">Parameters:</span></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. Can not be greater than |
| the length of this vector, except if the <code>step</code> is zero.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a view of this vector containing values in the given index range.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang" class="externalLink">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> |
| </li> |
| </ul> |
| <a id="pick(int...)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>pick</h4> |
| <pre class="methodSignature">public <a href="Vector.html" title="class in org.apache.sis.math">Vector</a> pick​(int... indices)</pre> |
| <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> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>indices</code> - indexes of the values to be returned.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a view of this vector containing values at the given indexes.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IndexOutOfBoundsException</a></code> - if at least one index is out of bounds.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="concatenate(org.apache.sis.math.Vector)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>concatenate</h4> |
| <pre class="methodSignature">public <a href="Vector.html" title="class in org.apache.sis.math">Vector</a> concatenate​(<a href="Vector.html" title="class in org.apache.sis.math">Vector</a> toAppend)</pre> |
| <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> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>toAppend</code> - the vector to concatenate at the end of this vector.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the concatenation of this vector with the given vector.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="repeat(boolean,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>repeat</h4> |
| <pre class="methodSignature">public <a href="Vector.html" title="class in org.apache.sis.math">Vector</a> repeat​(boolean eachValue, |
| int count)</pre> |
| <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> |
| <dt><span class="paramLabel">Parameters:</span></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><span class="returnLabel">Returns:</span></dt> |
| <dd>this vector repeated <var>count</var> time.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.0</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#repetitions(int...)"><code>repetitions(int...)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="reverse()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>reverse</h4> |
| <pre class="methodSignature">public final <a href="Vector.html" title="class in org.apache.sis.math">Vector</a> reverse()</pre> |
| <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> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the vector values in reverse order.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="transform(double,double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>transform</h4> |
| <pre class="methodSignature">public <a href="Vector.html" title="class in org.apache.sis.math">Vector</a> transform​(double scale, |
| double offset)</pre> |
| <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> |
| <dt><span class="paramLabel">Parameters:</span></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><span class="returnLabel">Returns:</span></dt> |
| <dd>a vector with values computed by <code>doubleValue(i)</code> × <code>scale</code> + <code>offset</code>.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - if an argument is NaN or infinite.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="compress(double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>compress</h4> |
| <pre class="methodSignature">public <a href="Vector.html" title="class in org.apache.sis.math">Vector</a> compress​(double tolerance)</pre> |
| <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 can not 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). |
| |
| <div class="section">When to use</div> |
| 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> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>tolerance</code> - maximal difference allowed between original and compressed vectors (can be zero).</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a more compact vector with the same data than this vector, or <code>this</code>.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="buffer()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>buffer</h4> |
| <pre class="methodSignature">public <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html?is-external=true" title="class or interface in java.util" class="externalLink">Optional</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/Buffer.html?is-external=true" title="class or interface in java.nio" class="externalLink">Buffer</a>> buffer()</pre> |
| <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/javase/8/docs/api/java/lang/Integer.html?is-external=true#toUnsignedLong(int)" title="class or interface in java.lang" class="externalLink"><code>Integer.toUnsignedLong(int)</code></a> if needed.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the vector data as a buffer. Absent if this vector is not backed by an array or a buffer.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="doubleValues()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>doubleValues</h4> |
| <pre class="methodSignature">public double[] doubleValues()</pre> |
| <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> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a copy of all floating point values in this vector.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#doubleValue(int)"><code>doubleValue(int)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="floatValues()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>floatValues</h4> |
| <pre class="methodSignature">public float[] floatValues()</pre> |
| <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> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a copy of all floating point values in this vector.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#floatValue(int)"><code>floatValue(int)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toString()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toString</h4> |
| <pre class="methodSignature">public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> toString()</pre> |
| <div class="block">Returns a string representation of this vector.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractCollection.html?is-external=true#toString()" title="class or interface in java.util" class="externalLink">toString</a></code> in class <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractCollection.html?is-external=true" title="class or interface in java.util" class="externalLink">AbstractCollection</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></code></dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a string representation of this vector.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#stringValue(int)"><code>stringValue(int)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="hashCode()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>hashCode</h4> |
| <pre class="methodSignature">public int hashCode()</pre> |
| <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/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>Number</code></a>s, then the <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Arrays.html?is-external=true#hashCode(java.lang.Object%5B%5D)" title="class or interface in java.util" class="externalLink"><code>Arrays.hashCode(Object[])</code></a> method invoked for that array. |
| This contract is defined for compatibility with <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#hashCode()" title="class or interface in java.util" class="externalLink"><code>List.hashCode()</code></a> contract.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#hashCode()" title="class or interface in java.util" class="externalLink">hashCode</a></code> in interface <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></code></dd> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#hashCode()" title="class or interface in java.util" class="externalLink">hashCode</a></code> in interface <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></code></dd> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true#hashCode()" title="class or interface in java.util" class="externalLink">hashCode</a></code> in class <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true" title="class or interface in java.util" class="externalLink">AbstractList</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></code></dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a hash code value for the values in this vector.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="equals(java.lang.Object)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>equals</h4> |
| <pre class="methodSignature">public boolean equals​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> object)</pre> |
| <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/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>Number</code></a>s, |
| then the <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Arrays.html?is-external=true#equals(java.lang.Object%5B%5D,java.lang.Object%5B%5D)" title="class or interface in java.util" class="externalLink"><code>Arrays.equals(Object[], Object[])</code></a> method invoked for those arrays.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.util" class="externalLink">equals</a></code> in interface <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></code></dd> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.util" class="externalLink">equals</a></code> in interface <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></code></dd> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.util" class="externalLink">equals</a></code> in class <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html?is-external=true" title="class or interface in java.util" class="externalLink">AbstractList</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a>></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>object</code> - the other object to compare with this vector.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if the given object is a vector containing the same values than this vector.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.0</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/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">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </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="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 2010–2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |