2.17.2: 2011-06-17

net.sf.basedb.util.bfs
Class MetadataModel.Section

java.lang.Object
  extended by net.sf.basedb.util.bfs.MetadataModel.Section
Enclosing class:
MetadataModel

public static class MetadataModel.Section
extends Object

Holds information about a section.


Field Summary
private  List<MetadataModel.SectionEntry> entries
           
private  String name
           
 
Constructor Summary
MetadataModel.Section(String name)
          Create a new section.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

private String name

entries

private List<MetadataModel.SectionEntry> entries
Constructor Detail

MetadataModel.Section

public MetadataModel.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 entry
values - 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 and getEntryCount() - 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 and getEntryCount() - 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 and getEntryCount() - 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 and getEntryCount() - 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

getValues

public String[] getValues(String key)
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

2.17.2: 2011-06-17