public class KVMultiList
extends java.lang.Object
KVList
. Please note
that the comparison of section names is performed case-sensitive.
Therefore, all keys are expected to be lower-case normalized.Modifier and Type | Class and Description |
---|---|
private static class |
KVMultiList.Section
small class that represents a section.
|
Modifier and Type | Field and Description |
---|---|
private java.util.Map<KVList,KVMultiList.Section> |
listMap
the map from the list to the section
|
private KVList |
mainList
the main key-value list
|
private java.util.Map<java.lang.String,java.util.List<KVMultiList.Section>> |
nameMap
mapping from the section names to the sections
|
private java.util.Set<KVMultiList.Section> |
sections
the set of all sections
|
Constructor and Description |
---|
KVMultiList()
constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addSection(KVList list,
java.lang.String... names)
add the given list as a new section
|
KVList |
getFirstSection(java.lang.String name)
return the first section with the given name
|
KVList |
getMainSection()
return the main section
|
java.lang.String[] |
getSectionNames(KVList list)
return the subsection names of the given list.
|
java.util.List<KVList> |
getSections(java.lang.String name)
return the subsections with the given name
|
java.util.Iterator<KVList> |
getSubsections()
return an iterator over all subsections
|
KVList |
newSection(java.lang.String... names)
create a new section with the given name(s)
|
void |
removeSection(KVList list)
remove the section represented by the given list
|
private void |
removeSection(KVMultiList.Section s)
remove the given section
|
private KVList mainList
private java.util.Set<KVMultiList.Section> sections
private java.util.Map<java.lang.String,java.util.List<KVMultiList.Section>> nameMap
private java.util.Map<KVList,KVMultiList.Section> listMap
public KVList getMainSection()
public java.util.List<KVList> getSections(java.lang.String name)
name
- the namepublic KVList getFirstSection(java.lang.String name)
name
- the namenull
if
no section with the given name existsprivate void removeSection(KVMultiList.Section s)
s
- the section to removepublic void removeSection(KVList list)
list
- the list to removepublic KVList newSection(java.lang.String... names)
names
- the namespublic void addSection(KVList list, java.lang.String... names)
list
- the list to addnames
- the names for the sectionpublic java.lang.String[] getSectionNames(KVList list)
list
- the list of which the names shall be
returnnull
if the list
not a subsectionpublic java.util.Iterator<KVList> getSubsections()
Copyright © 2005-2013 Knipp Medien und Kommunikation GmbH