public class AttributeHashMap extends java.lang.Object implements AttributeMap
AttributeMap that uses a hash map for storing attribute-value mappings.| Constructor and Description |
|---|
AttributeHashMap()
Creates an empty attribute map.
|
AttributeHashMap(int size)
Creates an empty attribute map with a specific size.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
@Nullable java.lang.Double |
getValue(int attributeIndex)
Returns the value that is associated with the
Attribute with a specific index. |
int |
hashCode() |
void |
putValue(@NotNull Attribute attribute,
double value)
Adds a new attribute-value mapping to the attribute map.
|
void |
putValue(int attributeIndex,
double value)
Adds a new attribute-value mapping to the attribute map.
|
int |
size()
Returns the number of attribute-value mappings that are contained by the map.
|
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcontains, contains, getValue, isEmptypublic AttributeHashMap()
public AttributeHashMap(int size)
size - The size of the attribute mappublic void putValue(@NotNull
@NotNull Attribute attribute,
double value)
attribute - The attribute, the value is associated withvalue - The value to be addedpublic void putValue(int attributeIndex,
double value)
attributeIndex - The index of the attribute, the value is associated withvalue - The value to be addedpublic int size()
AttributeMapsize in interface AttributeMap@Nullable public @Nullable java.lang.Double getValue(int attributeIndex)
AttributeMapAttribute with a specific index.getValue in interface AttributeMapattributeIndex - The index of the attribute for which the associated value should be
returnedpublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object