Package net.sf.basedb.util.bfs
Class MetadataModel.Section
java.lang.Object
net.sf.basedb.util.bfs.MetadataModel.Section
- Enclosing class:
- MetadataModel
public static class MetadataModel.Section extends Object
Holds information about a section.
-
Field Summary
Fields Modifier and Type Field Description private List<MetadataModel.SectionEntry>
entries
private String
name
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description MetadataModel.SectionEntry
addEntry(String key, String... values)
Add a new entry to this section.void
addEntry(MetadataModel.SectionEntry entry)
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.
-
Field Details
-
name
-
entries
-
-
Constructor Details
-
Section
Create a new section.- Parameters:
name
- The name of the section
-
-
Method Details
-
getName
Get the name of the section. -
getEntryCount
public int getEntryCount()Get the number of entries in this section. -
addEntry
Add a new entry to this section. -
addEntry
Add a new entry to this section.- Parameters:
key
- The key of the entryvalues
- The values
-
getEntry
Get the entry in this section with the given index.- Parameters:
index
- The index of the entry, a value between 0 andgetEntryCount()
- 1- Returns:
- A section entry
-
getEntry
Get the first entry in this section with a given key.- Parameters:
key
- The key to look for- Returns:
- A section entry, or null if no entry with the given key exists
-
getKey
Get the key of the entry at the given index.- Parameters:
index
- The index of the entry, a value between 0 andgetEntryCount()
- 1- Returns:
- The key of the entry
-
getIndex
Get the index of the first entry with the given key.- Parameters:
key
- The key to look for- Returns:
- The index of the entry, or -1 if the key is not found
-
getValue
Get the value of the entry at the given index.- Parameters:
index
- The index of the entry, a value between 0 andgetEntryCount()
- 1- Returns:
- The value of the entry
-
getValues
Get the values of the entry at the given index.- Parameters:
index
- The index of the entry, a value between 0 andgetEntryCount()
- 1- Returns:
- The value of the entry
-
getValue
Get the value of the first entry with a given key.- Parameters:
key
- The key of the entry- Returns:
- The value, or null if no entry for the given key exists
-
getValues
Get the values of the first entry with a given key.- Parameters:
key
- The key of the entry- Returns:
- The value, or null if no entry for the given key exists
-