MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / SimpleEntry

Class SimpleEntry

Ports/CLDC11/src/java/util/AbstractMap.java:164–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162 ///
163 /// 1.6
164 public static class SimpleEntry<K, V> implements Map.Entry<K, V> {
165
166 private static final long serialVersionUID = -8499721149061103585L;
167
168 private K key;
169
170 private V value;
171
172 /// Constructs a new instance by key and value.
173 ///
174 /// #### Parameters
175 ///
176 /// - `theKey`: the key
177 ///
178 /// - `theValue`: the value
179 public SimpleEntry(K theKey, V theValue) {
180 key = theKey;
181 value = theValue;
182 }
183
184 /// Constructs a new instance by an entry
185 ///
186 /// #### Parameters
187 ///
188 /// - `entry`: the entry
189 public SimpleEntry(Map.Entry<? extends K, ? extends V> entry) {
190 key = entry.getKey();
191 value = entry.getValue();
192 }
193
194 /// {@inheritDoc}
195 ///
196 /// #### See also
197 ///
198 /// - java.util.Map.Entry#getKey()
199 public K getKey() {
200 return key;
201 }
202
203 /// {@inheritDoc}
204 ///
205 /// #### See also
206 ///
207 /// - java.util.Map.Entry#getValue()
208 public V getValue() {
209 return value;
210 }
211
212 /// {@inheritDoc}
213 ///
214 /// #### See also
215 ///
216 /// - java.util.Map.Entry#setValue(java.lang.Object)
217 public V setValue(V object) {
218 V result = value;
219 value = object;
220 return result;
221 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected