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
-
Method Summary
All Methods Instance Methods Concrete Methods 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 Detail
-
name
private String name
-
entries
private List<MetadataModel.SectionEntry> entries
-
-
Constructor Detail
-
Section
public Section(String name)
Create a new section.- Parameters:
name
- The name of the section
-
-
Method Detail
-
getName
public String getName()
Get the name of the section.
-
getEntryCount
public int getEntryCount()
Get the number of entries in this section.
-
addEntry
public void addEntry(MetadataModel.SectionEntry entry)
Add a new entry to this section.
-
addEntry
public MetadataModel.SectionEntry addEntry(String key, String... values)
Add a new entry to this section.- Parameters:
key
- The key of the entryvalues
- The values
-
getEntry
public MetadataModel.SectionEntry getEntry(int index)
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
public MetadataModel.SectionEntry getEntry(String key)
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
public String getKey(int index)
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
public int getIndex(String key)
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
public String getValue(int index)
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
public String[] getValues(int index)
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
public String getValue(String key)
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
-
-