public static class MetadataModel.Section extends Object
Modifier and Type | Field and Description |
---|---|
private List<MetadataModel.SectionEntry> |
entries |
private String |
name |
Constructor and Description |
---|
Section(String name)
Create a new section.
|
Modifier and Type | Method and Description |
---|---|
void |
addEntry(MetadataModel.SectionEntry entry)
Add a new entry to this section.
|
MetadataModel.SectionEntry |
addEntry(String key,
String... values)
Add a new entry to this section.
|
MetadataModel.SectionEntry |
getEntry(int index)
Get the entry in this section with the given index.
|
MetadataModel.SectionEntry |
getEntry(String key)
Get the first entry in this section with a given key.
|
int |
getEntryCount()
Get the number of entries in this section.
|
int |
getIndex(String key)
Get the index of the first entry with the given key.
|
String |
getKey(int index)
Get the key of the entry at the given index.
|
String |
getName()
Get the name of the section.
|
String |
getValue(int index)
Get the value of the entry at the given index.
|
String |
getValue(String key)
Get the value of the first entry with a given key.
|
String[] |
getValues(int index)
Get the values of the entry at the given index.
|
String[] |
getValues(String key)
Get the values of the first entry with a given key.
|
private String name
private List<MetadataModel.SectionEntry> entries
public Section(String name)
name
- The name of the sectionpublic String getName()
public int getEntryCount()
public void addEntry(MetadataModel.SectionEntry entry)
public MetadataModel.SectionEntry addEntry(String key, String... values)
key
- The key of the entryvalues
- The valuespublic MetadataModel.SectionEntry getEntry(int index)
index
- The index of the entry, a value between 0 and
getEntryCount()
- 1public MetadataModel.SectionEntry getEntry(String key)
key
- The key to look forpublic String getKey(int index)
index
- The index of the entry, a value between 0 and
getEntryCount()
- 1public int getIndex(String key)
key
- The key to look forpublic String getValue(int index)
index
- The index of the entry, a value between 0 and
getEntryCount()
- 1public String[] getValues(int index)
index
- The index of the entry, a value between 0 and
getEntryCount()
- 1public String getValue(String key)
key
- The key of the entry