KEYTYPE - The key type.VALUETYPE - The value type.@NotThreadSafe public class SingleElementMap<KEYTYPE,VALUETYPE> extends Object implements ICommonsMap<KEYTYPE,VALUETYPE>
ICommonsMap implementation that can only keep 0 or 1 element.| Constructor and Description |
|---|
SingleElementMap() |
SingleElementMap(KEYTYPE aKey,
VALUETYPE aValue) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(Object aKey) |
boolean |
containsValue(Object aValue) |
ICommonsSet<Map.Entry<KEYTYPE,VALUETYPE>> |
entrySet() |
boolean |
equals(Object o) |
VALUETYPE |
get(Object aKey) |
SingleElementMap<KEYTYPE,VALUETYPE> |
getClone() |
int |
hashCode() |
boolean |
isEmpty() |
ICommonsSet<KEYTYPE> |
keySet() |
VALUETYPE |
put(KEYTYPE aKey,
VALUETYPE aElement) |
void |
putAll(Map<? extends KEYTYPE,? extends VALUETYPE> aMap) |
VALUETYPE |
remove(Object aKey) |
int |
size() |
String |
toString() |
ICommonsCollection<VALUETYPE> |
values() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAll, copyOfEntrySet, copyOfKeySet, copyOfValues, copyOfValues, copyOfValuesMapped, copyOfValuesMapped, findFirstEntry, findFirstKey, findFirstValue, getAsUnmodifiable, getFirstEntry, getFirstKey, getFirstValue, getSortedByKey, getSortedByValue, getSwappedKeyValues, isNotEmpty, putIf, putIfNotNull, removeAll, setAllcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll@Nonnull @ReturnsMutableCopy public SingleElementMap<KEYTYPE,VALUETYPE> getClone()
getClone in interface ICloneable<ICommonsMap<KEYTYPE,VALUETYPE>>public boolean containsKey(@Nullable Object aKey)
containsKey in interface Map<KEYTYPE,VALUETYPE>public boolean containsValue(@Nullable Object aValue)
containsValue in interface Map<KEYTYPE,VALUETYPE>@Nonnegative public int size()
@ReturnsImmutableObject @Nonnull public ICommonsSet<KEYTYPE> keySet()
@ReturnsImmutableObject @Nonnull public ICommonsCollection<VALUETYPE> values()
@Nonnull @ReturnsMutableCopy public ICommonsSet<Map.Entry<KEYTYPE,VALUETYPE>> entrySet()
public boolean equals(Object o)
public int hashCode()
Copyright © 2014–2016 Philip Helger. All rights reserved.