blob: 4afcefa1c80cb096a4603721a63fa4f2703dbb55 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_80) on Mon Mar 05 08:19:28 EST 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Slice (The Eclipse January API Documentation)</title>
<meta name="date" content="2018-03-05">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Slice (The Eclipse January API Documentation)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Slice.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">
<li><a href="../../../../org/eclipse/january/dataset/SingleItemIterator.html" title="class in org.eclipse.january.dataset"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/eclipse/january/dataset/SliceIterator.html" title="class in org.eclipse.january.dataset"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/eclipse/january/dataset/Slice.html" target="_top">Frames</a></li>
<li><a href="Slice.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></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>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.eclipse.january.dataset</div>
<h2 title="Class Slice" class="title">Class Slice</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.eclipse.january.dataset.Slice</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="https://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang">Cloneable</a></dd>
</dl>
<hr>
<br>
<pre>public class <a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.47">Slice</a>
extends <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
implements <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang">Cloneable</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></pre>
<div class="block">The <code>Slice</code> class represents the set of indices (start, stop, step), that are used to extract specifics subsets of <a href="../../../../org/eclipse/january/dataset/Dataset.html" title="interface in org.eclipse.january.dataset"><code>Dataset</code></a>.<br><br>
The start argument default to 0, stop argument default to the stop argument default to the end of the dimension that the slice is applied to, and the default argument for the step is 1.
<br><br>
The start index is inclusive, for example, if we want to get data from index 1, so sliceData will be <b>[2,3]</b> :
<pre>
<code>final Dataset onedData = DatasetFactory.createFromObject(new int[]{1,2,3});
Dataset sliceData = onedData.getSlice(new Slice(1, null, null));
</code>
</pre>
If Slice is specified with only one argument, this will be the stop index which is exclusive. In this case sliceData will be <b>[1,2]</b> :
<pre>
<code>final Dataset onedData = DatasetFactory.createFromObject(new int[]{1,2,3});
Dataset sliceData = onedData.getSlice(new Slice(2));
</code>
</pre>
To create a 1D Slice, so sliceData is : <b>[6, 5, 4]</b>, we will do :
<pre>
<code>final Dataset sliceData = DatasetFactory.createFromObject(new int[]{10,9,8,7,6,5,4,3,2,1,0});
Dataset newOnedData = sliceData.getSlice(new Slice(4, 7, 1));
</code>
</pre>
<br>
For more informations, see the sliceFrom1D example in SlicingExamples.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../serialized-form.html#org.eclipse.january.dataset.Slice">Serialized Form</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#Slice()">Slice</a></strong>()</code>
<div class="block">Constructs a Slice object with the start and the stop value representing
the entirety of the sliced dimension of the Dataset.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#Slice(java.lang.Integer)">Slice</a></strong>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;stop)</code>
<div class="block">Constructs a Slice object with, by default the start set to 0 and with a
step of 1.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#Slice(java.lang.Integer,%20java.lang.Integer)">Slice</a></strong>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;start,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;stop)</code>
<div class="block">Constructs a Slice object with, by default a step of 1.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#Slice(java.lang.Integer,%20java.lang.Integer,%20java.lang.Integer)">Slice</a></strong>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;start,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;stop,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;step)</code>
<div class="block">Constructs a Slice object on which it is possible to chooe the start, the
stop and the step.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#appendSliceToString(java.lang.StringBuilder,%20int,%20int,%20int,%20int)">appendSliceToString</a></strong>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/StringBuilder.html?is-external=true" title="class or interface in java.lang">StringBuilder</a>&nbsp;s,
int&nbsp;len,
int&nbsp;beg,
int&nbsp;end,
int&nbsp;del)</code>
<div class="block">Returns a String representation of the Slice comparable to the python
representation.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../org/eclipse/january/dataset/Slice.html" title="class in org.eclipse.january.dataset">Slice</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#clone()">clone</a></strong>()</code>
<div class="block">Creates a deep copy of the Slice.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#convertFromSlice(org.eclipse.january.dataset.Slice[],%20int[],%20int[],%20int[],%20int[])">convertFromSlice</a></strong>(<a href="../../../../org/eclipse/january/dataset/Slice.html" title="class in org.eclipse.january.dataset">Slice</a>[]&nbsp;slice,
int[]&nbsp;shape,
int[]&nbsp;start,
int[]&nbsp;stop,
int[]&nbsp;step)</code>
<div class="block">Populates given start, stop, step arrays from given slice array</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../org/eclipse/january/dataset/Slice.html" title="class in org.eclipse.january.dataset">Slice</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#convertFromString(java.lang.String)">convertFromString</a></strong>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;sliceString)</code>
<div class="block">Converts string in a Slice array</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../org/eclipse/january/dataset/Slice.html" title="class in org.eclipse.january.dataset">Slice</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#convertToSlice(int[],%20int[],%20int[])">convertToSlice</a></strong>(int[]&nbsp;start,
int[]&nbsp;stop,
int[]&nbsp;step)</code>
<div class="block">Converts a set of integer arrays in a slice array</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#createString(int[],%20int[],%20int[],%20int[])">createString</a></strong>(int[]&nbsp;shape,
int[]&nbsp;start,
int[]&nbsp;stop,
int[]&nbsp;step)</code>
<div class="block">Creates a string representing the slice taken from given shape</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#createString(org.eclipse.january.dataset.Slice...)">createString</a></strong>(<a href="../../../../org/eclipse/january/dataset/Slice.html" title="class in org.eclipse.january.dataset">Slice</a>...&nbsp;slices)</code>
<div class="block">Creates a string representation of slices.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../org/eclipse/january/dataset/Slice.html" title="class in org.eclipse.january.dataset">Slice</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#flip()">flip</a></strong>()</code>
<div class="block">Flips the Slice direction, after this operation, the slice begins at
previous end point, steps in the opposite direction, and finishes at the
previous start point.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#getEnd()">getEnd</a></strong>()</code>
<div class="block">Returns the last value inside of Slice.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#getLength()">getLength</a></strong>()</code>
<div class="block">Returns the maximum value of the slice.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#getNumSteps()">getNumSteps</a></strong>()</code>
<div class="block">Returns the number of steps inside of the Slice</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#getNumSteps(int,%20int)">getNumSteps</a></strong>(int&nbsp;beg,
int&nbsp;end)</code>
<div class="block">Returns the number of steps inside of the Slice from a point to an other
point minus 1 because this is an exclusive index</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#getPosition(int)">getPosition</a></strong>(int&nbsp;n)</code>
<div class="block">Returns the index of the n-th step inside of the slice</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#getStart()">getStart</a></strong>()</code>
<div class="block">Returns the starting index of the slice.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#getStep()">getStep</a></strong>()</code>
<div class="block">Returns the step of the slice.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#getStop()">getStop</a></strong>()</code>
<div class="block">Returns the stopping index of the slice.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#isSliceComplete()">isSliceComplete</a></strong>()</code>
<div class="block">Returns <code>true</code> if the slice has a maximum size equal to the current
size, else <code>false</code>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../org/eclipse/january/dataset/Slice.html" title="class in org.eclipse.january.dataset">Slice</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#setLength(int)">setLength</a></strong>(int&nbsp;length)</code>
<div class="block">Sets the maximal dimensions length of the Slice.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#setPosition(int)">setPosition</a></strong>(int&nbsp;beg)</code>
<div class="block">Move the start and end to an other index keeping the same step and the
same gap between the two values</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#setStart(java.lang.Integer)">setStart</a></strong>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;start)</code>
<div class="block">Set the starting index of the slice.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#setStep(int)">setStep</a></strong>(int&nbsp;step)</code>
<div class="block">Set the step size inside of the Slice.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#setStop(java.lang.Integer)">setStop</a></strong>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;stop)</code>
<div class="block">Set the stopping index of the slice.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/eclipse/january/dataset/Slice.html#toString()">toString</a></strong>()</code>
<div class="block">Returns a string construction of the slice with the python form.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="Slice()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Slice</h4>
<pre>public&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.60">Slice</a>()</pre>
<div class="block">Constructs a Slice object with the start and the stop value representing
the entirety of the sliced dimension of the Dataset.</div>
</li>
</ul>
<a name="Slice(java.lang.Integer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Slice</h4>
<pre>public&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.73">Slice</a>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;stop)</pre>
<div class="block">Constructs a Slice object with, by default the start set to 0 and with a
step of 1. If the stop point of the Slice is <code>null</code>, it will be set
to the stop argument default to the end of the dimension that the slice
is applied to.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>stop</code> - the stop point of the Slice</dd></dl>
</li>
</ul>
<a name="Slice(java.lang.Integer, java.lang.Integer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Slice</h4>
<pre>public&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.89">Slice</a>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;start,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;stop)</pre>
<div class="block">Constructs a Slice object with, by default a step of 1. If the start
point of the Slice is <code>null</code>, it will be set automatically to 0. If
the stop point of the Slice is <code>null</code>, it will be set to the stop
argument default to the end of the dimension that the slice is applied
to.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>start</code> - the start point of the Slice</dd><dd><code>stop</code> - the stop point of the Slice</dd></dl>
</li>
</ul>
<a name="Slice(java.lang.Integer, java.lang.Integer, java.lang.Integer)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Slice</h4>
<pre>public&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.108">Slice</a>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;start,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;stop,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;step)</pre>
<div class="block">Constructs a Slice object on which it is possible to chooe the start, the
stop and the step. If the start point of the Slice is <code>null</code>, it
will be set automatically to 0. If the stop point of the Slice is
<code>null</code>, it will be set to the stop argument default to the end of
the dimension that the slice is applied to. If the the wanted step is set
to <code>null</code>, it will be set by default to 1.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>start</code> - the start point of the Slice, may be <code>null</code></dd><dd><code>stop</code> - the stop point of the Slice, may be <code>null</code></dd><dd><code>step</code> - the step wanted to browse the Dataset, may be <code>null</code></dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="clone()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clone</h4>
<pre>public&nbsp;<a href="../../../../org/eclipse/january/dataset/Slice.html" title="class in org.eclipse.january.dataset">Slice</a>&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.133">clone</a>()</pre>
<div class="block">Creates a deep copy of the Slice.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>New Slice with the current Slice properties</dd></dl>
</li>
</ul>
<a name="setLength(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setLength</h4>
<pre>public&nbsp;<a href="../../../../org/eclipse/january/dataset/Slice.html" title="class in org.eclipse.january.dataset">Slice</a>&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.144">setLength</a>(int&nbsp;length)</pre>
<div class="block">Sets the maximal dimensions length of the Slice.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>length</code> - Wanted size of dimensions</dd>
<dt><span class="strong">Returns:</span></dt><dd>The Slice which the method is called on</dd></dl>
</li>
</ul>
<a name="isSliceComplete()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSliceComplete</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.162">isSliceComplete</a>()</pre>
<div class="block">Returns <code>true</code> if the slice has a maximum size equal to the current
size, else <code>false</code>.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd><code>true</code> if slice represents complete dimension,
<code>false</code> in the other case.</dd></dl>
</li>
</ul>
<a name="getLength()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLength</h4>
<pre>public&nbsp;int&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.177">getLength</a>()</pre>
<div class="block">Returns the maximum value of the slice.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Maximum value of the slice</dd></dl>
</li>
</ul>
<a name="getStart()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getStart</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.186">getStart</a>()</pre>
<div class="block">Returns the starting index of the slice.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Start point of the slice</dd></dl>
</li>
</ul>
<a name="getStop()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getStop</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.195">getStop</a>()</pre>
<div class="block">Returns the stopping index of the slice.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Stop point of the slice</dd></dl>
</li>
</ul>
<a name="getStep()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getStep</h4>
<pre>public&nbsp;int&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.204">getStep</a>()</pre>
<div class="block">Returns the step of the slice.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Step of the slice</dd></dl>
</li>
</ul>
<a name="setStart(java.lang.Integer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setStart</h4>
<pre>public&nbsp;void&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.215">setStart</a>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;start)</pre>
<div class="block">Set the starting index of the slice. If the start point of the Slice is
<code>null</code>, it will be set automatically to 0.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>start</code> - Starting index of the Slice, may be <code>null</code></dd></dl>
</li>
</ul>
<a name="setStop(java.lang.Integer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setStop</h4>
<pre>public&nbsp;void&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.240">setStop</a>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;stop)</pre>
<div class="block">Set the stopping index of the slice. If the stop point of the Slice is
<code>null</code>, it will be set to the stop argument default to the end of
the dimension that the slice is applied to.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>stop</code> - Stopping index of the Slice, may be <code>null</code></dd></dl>
</li>
</ul>
<a name="setPosition(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPosition</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.268">setPosition</a>(int&nbsp;beg)</pre>
<div class="block">Move the start and end to an other index keeping the same step and the
same gap between the two values</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>beg</code> - New starting point</dd>
<dt><span class="strong">Returns:</span></dt><dd>Return <code>true</code> if the end was reached, <code>false</code> in the
other case.</dd></dl>
</li>
</ul>
<a name="getPosition(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPosition</h4>
<pre>public&nbsp;int&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.288">getPosition</a>(int&nbsp;n)</pre>
<div class="block">Returns the index of the n-th step inside of the slice</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>n</code> - Wanted step index in the slice</dd>
<dt><span class="strong">Returns:</span></dt><dd>Return the index of the step inside of the Slice</dd></dl>
</li>
</ul>
<a name="setStep(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setStep</h4>
<pre>public&nbsp;void&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.320">setStep</a>(int&nbsp;step)</pre>
<div class="block">Set the step size inside of the Slice. If the the wanted step is set to
<code>null</code>, it will be set by default to 1.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>step</code> - New wanted step, may be <code>null</code></dd></dl>
</li>
</ul>
<a name="appendSliceToString(java.lang.StringBuilder, int, int, int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>appendSliceToString</h4>
<pre>public static&nbsp;void&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.342">appendSliceToString</a>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/StringBuilder.html?is-external=true" title="class or interface in java.lang">StringBuilder</a>&nbsp;s,
int&nbsp;len,
int&nbsp;beg,
int&nbsp;end,
int&nbsp;del)</pre>
<div class="block">Returns a String representation of the Slice comparable to the python
representation.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>s</code> - String builder</dd><dd><code>len</code> - Maximal length of the Slice, or -1 if not set</dd><dd><code>beg</code> - Start index of the Slice</dd><dd><code>end</code> - Stop index of the Slice</dd><dd><code>del</code> - Step of the Slice</dd></dl>
</li>
</ul>
<a name="toString()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.383">toString</a>()</pre>
<div class="block">Returns a string construction of the slice with the python form.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>Constructed String.</dd></dl>
</li>
</ul>
<a name="getNumSteps()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNumSteps</h4>
<pre>public&nbsp;int&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.395">getNumSteps</a>()</pre>
<div class="block">Returns the number of steps inside of the Slice</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Number of steps inside of the Slice</dd></dl>
</li>
</ul>
<a name="getNumSteps(int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNumSteps</h4>
<pre>public&nbsp;int&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.421">getNumSteps</a>(int&nbsp;beg,
int&nbsp;end)</pre>
<div class="block">Returns the number of steps inside of the Slice from a point to an other
point minus 1 because this is an exclusive index</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>beg</code> - Starting point</dd><dd><code>end</code> - (exclusive) Stopping point</dd>
<dt><span class="strong">Returns:</span></dt><dd>Numbers of steps between the 2 limits.</dd></dl>
</li>
</ul>
<a name="getEnd()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEnd</h4>
<pre>public&nbsp;int&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.436">getEnd</a>()</pre>
<div class="block">Returns the last value inside of Slice.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Last value in the slice, it can be a lower value than the start
if the step is going backward</dd></dl>
</li>
</ul>
<a name="flip()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>flip</h4>
<pre>public&nbsp;<a href="../../../../org/eclipse/january/dataset/Slice.html" title="class in org.eclipse.january.dataset">Slice</a>&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.454">flip</a>()</pre>
<div class="block">Flips the Slice direction, after this operation, the slice begins at
previous end point, steps in the opposite direction, and finishes at the
previous start point.
<p>
Note : the stop value may not be preserved across two flips
</p></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Flipped Slice.</dd></dl>
</li>
</ul>
<a name="convertFromSlice(org.eclipse.january.dataset.Slice[], int[], int[], int[], int[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>convertFromSlice</h4>
<pre>public static&nbsp;void&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.483">convertFromSlice</a>(<a href="../../../../org/eclipse/january/dataset/Slice.html" title="class in org.eclipse.january.dataset">Slice</a>[]&nbsp;slice,
int[]&nbsp;shape,
int[]&nbsp;start,
int[]&nbsp;stop,
int[]&nbsp;step)</pre>
<div class="block">Populates given start, stop, step arrays from given slice array</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>slice</code> - Input array of Slices wanted to convert</dd><dd><code>shape</code> - Input array of Slices shapes</dd><dd><code>start</code> - Output array of Slices starts</dd><dd><code>stop</code> - Output array of Slices stops</dd><dd><code>step</code> - Output array of Slices steps</dd></dl>
</li>
</ul>
<a name="convertToSlice(int[], int[], int[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>convertToSlice</h4>
<pre>public static&nbsp;<a href="../../../../org/eclipse/january/dataset/Slice.html" title="class in org.eclipse.january.dataset">Slice</a>[]&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.559">convertToSlice</a>(int[]&nbsp;start,
int[]&nbsp;stop,
int[]&nbsp;step)</pre>
<div class="block">Converts a set of integer arrays in a slice array</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>start</code> - Array of Slices starts</dd><dd><code>stop</code> - Array of Slices stops</dd><dd><code>step</code> - Array of Slices steps</dd>
<dt><span class="strong">Returns:</span></dt><dd>Slice array corresponding to the starts, stops and steps arrays
entered.</dd></dl>
</li>
</ul>
<a name="convertFromString(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>convertFromString</h4>
<pre>public static&nbsp;<a href="../../../../org/eclipse/january/dataset/Slice.html" title="class in org.eclipse.january.dataset">Slice</a>[]&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.582">convertFromString</a>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;sliceString)</pre>
<div class="block">Converts string in a Slice array</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>sliceString</code> - String of the Slice array</dd>
<dt><span class="strong">Returns:</span></dt><dd>Slice array created from the given string</dd></dl>
</li>
</ul>
<a name="createString(int[], int[], int[], int[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createString</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.644">createString</a>(int[]&nbsp;shape,
int[]&nbsp;start,
int[]&nbsp;stop,
int[]&nbsp;step)</pre>
<div class="block">Creates a string representing the slice taken from given shape</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>shape</code> - Array of Slices shapes</dd><dd><code>start</code> - Array of Slices starts</dd><dd><code>stop</code> - Array of Slices stops</dd><dd><code>step</code> - Array of Slices steps</dd>
<dt><span class="strong">Returns:</span></dt><dd>String representation of the Slice</dd></dl>
</li>
</ul>
<a name="createString(org.eclipse.january.dataset.Slice...)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>createString</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;<a href="../../../../src-html/org/eclipse/january/dataset/Slice.html#line.670">createString</a>(<a href="../../../../org/eclipse/january/dataset/Slice.html" title="class in org.eclipse.january.dataset">Slice</a>...&nbsp;slices)</pre>
<div class="block">Creates a string representation of slices.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>slices</code> - Wanted Slices to put inside of the string representation</dd>
<dt><span class="strong">Returns:</span></dt><dd>Return the string representation of the Slices entered.</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Slice.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">
<li><a href="../../../../org/eclipse/january/dataset/SingleItemIterator.html" title="class in org.eclipse.january.dataset"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/eclipse/january/dataset/SliceIterator.html" title="class in org.eclipse.january.dataset"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/eclipse/january/dataset/Slice.html" target="_top">Frames</a></li>
<li><a href="Slice.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.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>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2014&#x2013;2018 <a href="http://www.eclipse.org/">Eclipse Foundation</a>. All rights reserved.</small></p>
</body>
</html>