|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
K
- the key type.V
- the value type.public interface MapFormat<K,V>
This interface is used to represent formats for maps.
There are multiple ways to represent maps as strings. One way is to store the key-value pairs as a single unit, such as key = value. Another way is to store the keys separately from their values, such as
key1 ... keyn
value1 ... valuen
This interface provides methods to deal with these possibilities.
Method Summary | ||
---|---|---|
|
formatKey(T key)
Returns a formatted string representation of the provided key. |
|
java.lang.String |
formatKeys(java.util.Set<? extends K> keys)
Returns a formatted string representation of the provided set of keys. |
|
java.lang.String |
formatPair(java.util.Map.Entry<? extends K,? extends V> keyValuePair)
Returns a formatted string representation of the provided key-value pair. |
|
|
formatPair(S key,
T value)
Returns a formatted string representation of the provided key-value pair. |
|
|
formatValue(T value)
Returns a formatted string representation of the provided value. |
|
java.lang.String |
formatValues(java.util.List<? extends V> values)
Returns a string representation of the provided list of values. |
|
java.lang.String |
formatValues(java.util.Map<? extends K,? extends V> map)
Returns a string representation of the values in the provided map formatted as a list. |
|
java.util.LinkedHashSet<K> |
parseAllKeys(java.lang.String allKeys)
Parses the provided string and returns its corresponding set of keys. |
|
java.util.Map<K,V> |
parseAllPairs(java.lang.String allKeys,
java.lang.String allValues)
Parses the provided set of keys and list of values and returns a corresponding map of key-value pairs. |
|
java.util.Map<K,V> |
parseAllValues(java.util.LinkedHashSet<? extends K> keys,
java.lang.String allValues)
Parses the provided string of values and returns a corresponding map of key-value pairs using the provided set of keys. |
|
java.util.List<V> |
parseAllValues(java.lang.String allValues)
Parses the provided string and returns its corresponding list of values. |
|
K |
parseKey(java.lang.String key)
Parses the provided string and returns its corresponding key. |
|
java.util.Map.Entry<K,V> |
parsePair(java.lang.String keyValuePair)
Parses the provided string and returns a corresponding map entry. |
|
V |
parseValue(java.lang.String value)
Parses the provided string and returns its corresponding value. |
Method Detail |
---|
<T extends K> java.lang.String formatKey(T key)
T
- a type that extends the primary key
type of this format.key
- the key to be formatted.
<T extends V> java.lang.String formatValue(T value)
T
- a type that extends the primary value
type of this format.value
- the value to be formatted.
java.lang.String formatKeys(java.util.Set<? extends K> keys)
keys
- the set of keys to be formatted.
java.lang.String formatValues(java.util.List<? extends V> values)
values
- the list of values to be formatted.
java.lang.String formatValues(java.util.Map<? extends K,? extends V> map)
java.util.Map
for further details.
map
- keys mapped to their respective values.
<S extends K,T extends V> java.lang.String formatPair(S key, T value)
S
- a type extending the primary key type.T
- a type extending the primary value type.key
- the key.value
- the value.
java.lang.String formatPair(java.util.Map.Entry<? extends K,? extends V> keyValuePair)
keyValuePair
- the key-value pair
to be formatted.
K parseKey(java.lang.String key)
key
- a string representation of a key.
V parseValue(java.lang.String value)
value
- a string representation of a value.
java.util.Map.Entry<K,V> parsePair(java.lang.String keyValuePair)
keyValuePair
- a string representation of
a key-value pair, or in other words, a map entry.
java.util.LinkedHashSet<K> parseAllKeys(java.lang.String allKeys)
allKeys
- a string representation of a set
of keys.
java.util.List<V> parseAllValues(java.lang.String allValues)
allValues
- a string representation of a list
of values.
java.util.Map<K,V> parseAllValues(java.util.LinkedHashSet<? extends K> keys, java.lang.String allValues)
keys
- the set of keys with which
to associate the parsed values.allValues
- a string representation of a list
of values.
java.util.Map<K,V> parseAllPairs(java.lang.String allKeys, java.lang.String allValues)
allKeys
- a string representation of a set
of variables.allValues
- a string representation of a list of
values.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |