public class KeyValuesContainer<Type1,Type2>
extends java.lang.Object
implements java.lang.Iterable<java.util.Map.Entry<Type1,java.util.List<Type2>>>, java.io.Serializable
Constructor and Description |
---|
KeyValuesContainer()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addKeyValue(Type1 key,
Type2 value)
Append a new value to a given key.
|
void |
addKeyValues(Type1 key,
java.util.List<Type2> values)
Appends new values to a given key.
|
Type2 |
getFirstValue(Type1 key)
Get the first value of a given key.
|
java.util.List<Type2> |
getValues(Type1 key)
Lists the values of a given key.
|
java.util.Iterator<java.util.Map.Entry<Type1,java.util.List<Type2>>> |
iterator()
Gets an iterator for this collection.
|
void |
setKeyValue(Type1 key,
Type2 value)
Sets the value of a given key.
|
void |
setKeyValues(Type1 key,
java.util.List<Type2> values)
Sets the values of a given key.
|
int |
size() |
public void setKeyValues(Type1 key, java.util.List<Type2> values)
key
- the keyvalues
- the set of values to be associated with the specified keypublic void setKeyValue(Type1 key, Type2 value)
key
- the keyvalue
- the value to be associated with the specified keypublic void addKeyValues(Type1 key, java.util.List<Type2> values)
key
- the keyvalues
- the values to be appendedpublic void addKeyValue(Type1 key, Type2 value)
key
- the keyvalue
- the value to be appendedpublic java.util.List<Type2> getValues(Type1 key)
key
- the keynull
if the key does not exist.public Type2 getFirstValue(Type1 key)
key
- the keynull
if the key does not exist or if
it has no valuepublic java.util.Iterator<java.util.Map.Entry<Type1,java.util.List<Type2>>> iterator()
public int size()
Copyright © 2021 Dassault Systèmes, All Rights Reserved.