| <!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 (1.8.0_272) on Thu Nov 12 16:27:25 PST 2020 --> |
| <title>SelectResults (Apache Geode 1.13.1)</title> |
| <meta name="date" content="2020-11-12"> |
| <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| <script type="text/javascript" src="../../../../../script.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="SelectResults (Apache Geode 1.13.1)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <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="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/apache/geode/cache/query/RegionNotFoundException.html" title="class in org.apache.geode.cache.query"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/geode/cache/query/Struct.html" title="interface in org.apache.geode.cache.query"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/geode/cache/query/SelectResults.html" target="_top">Frames</a></li> |
| <li><a href="SelectResults.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: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </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.apache.geode.cache.query</div> |
| <h2 title="Interface SelectResults" class="title">Interface SelectResults<E></h2> |
| </div> |
| <div class="contentContainer"> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Superinterfaces:</dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><E>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a><E></dd> |
| </dl> |
| <dl> |
| <dt>All Known Subinterfaces:</dt> |
| <dd><a href="../../../../../org/apache/geode/cache/query/CqResults.html" title="interface in org.apache.geode.cache.query">CqResults</a><E></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>public interface <span class="typeNameLabel">SelectResults<E></span> |
| extends <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><E></pre> |
| <div class="block">Contains the results of a <a href="../../../../../org/apache/geode/cache/query/Query.html#execute--">executing</a> a |
| <code>SELECT</code> expression within a query. A <code>SELECT</code> expression results in |
| <code>SelectResults</code> that contain instances of <a href="../../../../../org/apache/geode/cache/query/Struct.html" title="interface in org.apache.geode.cache.query"><code>Struct</code></a> if: (a) there is more than |
| one projection in the projection attributes, or (b) if the projection is <code>*</code> and there |
| is more than one collection specified in the <code>FROM</code> clause. |
| <p> |
| |
| Otherwise, a <code>SELECT</code> expression over a collection of domain objects results in |
| <code>SelectResults</code> that contain domain objects, i.e. instances of domain classes such as |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang"><code>String</code></a> or <code>Address</code>. |
| <p> |
| |
| <pre> |
| QueryService qs = cacheView.getQueryService(); |
| |
| String select = "SELECT DISTINCT * FROM /root/employees " + "WHERE salary > 50000"; |
| Query query = qs.newQuery(select); |
| SelectResults results = query.execute(); |
| |
| for (Iterator iter = results.iterator(); iter.hasNext();) { |
| Employee emp = (Employee) iter.next(); |
| System.out.println("Highly compensated: " + emp); |
| } |
| |
| select = "SELECT DISTINCT age, address.zipCode FROM /root/employees " + "WHERE salary > 50000"; |
| query = qs.newQuery(select); |
| results = query.execute(); |
| |
| for (Iterator iter = results.iterator(); iter.hasNext();) { |
| Struct struct = (Struct) iter.next(); |
| int age = ((Integer) struct.get("age")).intValue(); |
| String zipCode = (String) struct.get("zipCode"); |
| System.out.println(age + " -> " + zipCode); |
| } |
| |
| </pre></div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>GemFire 4.0</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../org/apache/geode/cache/query/Query.html#execute--"><code>Query.execute()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</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></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><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">List</a><<a href="../../../../../org/apache/geode/cache/query/SelectResults.html" title="type parameter in SelectResults">E</a>></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/geode/cache/query/SelectResults.html#asList--">asList</a></span>()</code> |
| <div class="block">Returns this <code>SelectedResults</code> as a <code>java.util.List</code>.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a><<a href="../../../../../org/apache/geode/cache/query/SelectResults.html" title="type parameter in SelectResults">E</a>></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/geode/cache/query/SelectResults.html#asSet--">asSet</a></span>()</code> |
| <div class="block">Returns this <code>SelectResults</code> as a <code>java.util.Set</code>.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/geode/cache/query/types/CollectionType.html" title="interface in org.apache.geode.cache.query.types">CollectionType</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/geode/cache/query/SelectResults.html#getCollectionType--">getCollectionType</a></span>()</code> |
| <div class="block">Return the ObjectType for the type of collection this represents.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/geode/cache/query/SelectResults.html#isModifiable--">isModifiable</a></span>()</code> |
| <div class="block">Return whether this collection is modifiable.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/geode/cache/query/SelectResults.html#occurrences-E-">occurrences</a></span>(<a href="../../../../../org/apache/geode/cache/query/SelectResults.html" title="type parameter in SelectResults">E</a> element)</code> |
| <div class="block">Return the number of times element occurs in this collection, that is the number of duplicates |
| <code>element</code> has in this collection as defined by the <code>equals></code> method.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/geode/cache/query/SelectResults.html#setElementType-org.apache.geode.cache.query.types.ObjectType-">setElementType</a></span>(<a href="../../../../../org/apache/geode/cache/query/types/ObjectType.html" title="interface in org.apache.geode.cache.query.types">ObjectType</a> elementType)</code> |
| <div class="block">Specify a new elementType, overriding any existing known elementType.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.java.util.Collection"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from interface java.util.<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#add-E-" title="class or interface in java.util">add</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#addAll-java.util.Collection-" title="class or interface in java.util">addAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#clear--" title="class or interface in java.util">clear</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#contains-java.lang.Object-" title="class or interface in java.util">contains</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#containsAll-java.util.Collection-" title="class or interface in java.util">containsAll</a>, <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">equals</a>, <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">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#isEmpty--" title="class or interface in java.util">isEmpty</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#iterator--" title="class or interface in java.util">iterator</a>, <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">parallelStream</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#remove-java.lang.Object-" title="class or interface in java.util">remove</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#removeAll-java.util.Collection-" title="class or interface in java.util">removeAll</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">removeIf</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#retainAll-java.util.Collection-" title="class or interface in java.util">retainAll</a>, <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">size</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#spliterator--" title="class or interface in java.util">spliterator</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">stream</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#toArray--" title="class or interface in java.util">toArray</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#toArray-T:A-" title="class or interface in java.util">toArray</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.java.lang.Iterable"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from interface java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">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">forEach</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="isModifiable--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isModifiable</h4> |
| <pre>boolean isModifiable()</pre> |
| <div class="block">Return whether this collection is modifiable. The result of this method has no bearing on |
| whether the elements in the collection themselves are modifiable.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true if this collection is modifiable, false if not.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="occurrences-java.lang.Object-"> |
| <!-- --> |
| </a><a name="occurrences-E-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>occurrences</h4> |
| <pre>int occurrences(<a href="../../../../../org/apache/geode/cache/query/SelectResults.html" title="type parameter in SelectResults">E</a> element)</pre> |
| <div class="block">Return the number of times element occurs in this collection, that is the number of duplicates |
| <code>element</code> has in this collection as defined by the <code>equals></code> method. If |
| <code>element</code> is not present in this collection, then 0 is returned.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>element</code> - the element</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the number of occurrences of element</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>GemFire 5.1</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="asSet--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>asSet</h4> |
| <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a><<a href="../../../../../org/apache/geode/cache/query/SelectResults.html" title="type parameter in SelectResults">E</a>> asSet()</pre> |
| <div class="block">Returns this <code>SelectResults</code> as a <code>java.util.Set</code>. If this collection is |
| distinct and unordered, then no copying is necessary. Otherwise, the contents of this |
| collection will be copied into a new instance of java.util.HashSet.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>Is this collection as a <code>java.util.Set</code>?</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="asList--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>asList</h4> |
| <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../org/apache/geode/cache/query/SelectResults.html" title="type parameter in SelectResults">E</a>> asList()</pre> |
| <div class="block">Returns this <code>SelectedResults</code> as a <code>java.util.List</code>. If this collection |
| is ordered, then no copying is necessary. Otherwise, the contents of this collection will be |
| copied into a new instance of java.util.ArrayList.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>this collection as a java.util.List</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getCollectionType--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getCollectionType</h4> |
| <pre><a href="../../../../../org/apache/geode/cache/query/types/CollectionType.html" title="interface in org.apache.geode.cache.query.types">CollectionType</a> getCollectionType()</pre> |
| <div class="block">Return the ObjectType for the type of collection this represents.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the CollectionType for the type of collection this represents</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="setElementType-org.apache.geode.cache.query.types.ObjectType-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>setElementType</h4> |
| <pre>void setElementType(<a href="../../../../../org/apache/geode/cache/query/types/ObjectType.html" title="interface in org.apache.geode.cache.query.types">ObjectType</a> elementType)</pre> |
| <div class="block">Specify a new elementType, overriding any existing known elementType. This modifies the |
| CollectionType for this object to be the same collection type but with the newly specified |
| element type.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>elementType</code> - the new elementType</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> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <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="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/apache/geode/cache/query/RegionNotFoundException.html" title="class in org.apache.geode.cache.query"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/geode/cache/query/Struct.html" title="interface in org.apache.geode.cache.query"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/geode/cache/query/SelectResults.html" target="_top">Frames</a></li> |
| <li><a href="SelectResults.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: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </body> |
| </html> |