cz.cuni.amis.utils
Class IniFile.Section

java.lang.Object
  extended by cz.cuni.amis.utils.IniFile.Section
Enclosing class:
IniFile

public static class IniFile.Section
extends java.lang.Object

Class representing one section of the ini file.


Constructor Summary
IniFile.Section(IniFile.Section section)
          Copy-constructor.
IniFile.Section(java.lang.String name)
          Creates a section of the given name.
 
Method Summary
 IniFile.Section add(IniFile.Section section)
          Adds all properties from 'section' into this one.
 IniFile.Section clear()
          Deletes all properties within this section.
 boolean containsKey(java.lang.String key)
          Whether the section contains property of the given key.
 java.lang.String get(java.lang.String key)
          Returns a value of the propety with 'key'.
 java.util.Set<java.lang.String> getKeys()
          Returns all keys stored within the map.
 java.lang.String getName()
          Returns name of the section.
 java.util.Set<java.lang.String> keySet()
          Alias for getKeys().
 void output(java.io.PrintWriter writer)
          Writes this section into the writer.
 IniFile.Section put(java.lang.String key, java.lang.String value)
          Sets a property key=value into the section.
 IniFile.Section remove(java.lang.String key)
          Removes a property under the 'key' from this section.
 IniFile.Section set(java.lang.String key, java.lang.String value)
          Alias for put(String, String).
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IniFile.Section

public IniFile.Section(java.lang.String name)
Creates a section of the given name.

Name can't be null!

Parameters:
name -

IniFile.Section

public IniFile.Section(IniFile.Section section)
Copy-constructor.

Parameters:
section -
Method Detail

getName

public java.lang.String getName()
Returns name of the section.

Returns:

put

public IniFile.Section put(java.lang.String key,
                           java.lang.String value)
Sets a property key=value into the section.

Parameters:
key -
value -
Returns:
this

get

public java.lang.String get(java.lang.String key)
Returns a value of the propety with 'key'.

Parameters:
key -
Returns:

containsKey

public boolean containsKey(java.lang.String key)
Whether the section contains property of the given key.

Parameters:
key -
Returns:

getKeys

public java.util.Set<java.lang.String> getKeys()
Returns all keys stored within the map.

Returns:

keySet

public java.util.Set<java.lang.String> keySet()
Alias for getKeys().

Returns:

remove

public IniFile.Section remove(java.lang.String key)
Removes a property under the 'key' from this section.

Parameters:
key -
Returns:
this

clear

public IniFile.Section clear()
Deletes all properties within this section.

Returns:

set

public IniFile.Section set(java.lang.String key,
                           java.lang.String value)
Alias for put(String, String).

Parameters:
key -
value -
Returns:
this

add

public IniFile.Section add(IniFile.Section section)
Adds all properties from 'section' into this one.

Parameters:
section -
Returns:

output

public void output(java.io.PrintWriter writer)
Writes this section into the writer.

Parameters:
writer -

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object