Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If your keys are unique, use a <a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html" rel="nofollow"><code>Map</code></a>.</p> <pre><code>Map&lt;String, String&gt; mak = new HashMap&lt;String, String&gt;(); map.put("rId11","image3"); map.put("rId10","image2"); map.put("rId9","image1"); </code></pre> <p><strong>Reference:</strong></p> <ul> <li><a href="http://download.oracle.com/javase/tutorial/collections/interfaces/map.html" rel="nofollow">Java Tutorial > The Map Interface</a></li> </ul> <p>Otherwise, create a custom Object that holds key and value and create a <a href="http://download.oracle.com/javase/6/docs/api/java/util/List.html" rel="nofollow"><code>List</code></a> (or <a href="http://download.oracle.com/javase/6/docs/api/java/util/Set.html" rel="nofollow"><code>Set</code></a>???) of these.</p> <pre><code>public class Entry { private final String id; private final String value; public Entry(String id, String value) { this.id = id; this.value = value; } public String getId() { return id; } public String getValue() { return value; } // also implement equals() and hashCode(), please } List&lt;Entry&gt; entries = new ArrayList&lt;Entry&gt;(); entries.add(new Entry("rId11","image3")); </code></pre> <p><strong>Reference:</strong></p> <ul> <li><a href="http://download.oracle.com/javase/tutorial/collections/interfaces/list.html" rel="nofollow">Java Tutorial > The List Interface</a></li> <li><a href="http://download.oracle.com/javase/tutorial/collections/interfaces/set.html" rel="nofollow">Java Tutorial > The Set Interface</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload