package de.spieleck.config;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.Iterator;
import de.spieleck.util.EmptyIterator;
public class EmptyConfigNode
implements ConfigNode
{
private static ConfigNode instance = new EmptyConfigNode();
private EmptyConfigNode() { };
public static ConfigNode getInstance()
{
return instance;
}
public ConfigNode node(String path)
{
return null; }
public ConfigNode nodeInh(String path)
{
return null; }
public ConfigFileNode getBranchNode()
{
return null; }
public String getName()
{
return "empty"; }
public String getPath()
{
return null; }
public ConfigNode getParent()
{
return null; }
public boolean getBoolean()
{
return false;
}
public int getInt()
{
return 0;
}
public double getDouble()
{
return 0.0;
}
public String getString()
{
return "";
}
public boolean getBoolean(String path, boolean deflt)
{
return deflt;
}
public int getInt(String path, int deflt)
{
return deflt;
}
public double getDouble(String path, double deflt)
{
return deflt;
}
public String getString(String path, String deflt)
{
return deflt;
}
public boolean getInhBoolean(String path, boolean deflt)
{
return deflt;
}
public int getInhInt(String path, int deflt)
{
return deflt;
}
public double getInhDouble(String path, double deflt)
{
return deflt;
}
public String getInhString(String path, String deflt)
{
return deflt;
}
public int countChildren()
{
return 0;
}
public Iterator children()
{
return EmptyIterator.getInstance();
}
public Iterator childrenNamed(String key)
{
return EmptyIterator.getInstance();
}
public int countChildrenNamed(String key)
{
return 0;
}
public void print(PrintWriter os)
throws IOException
{
os.print("<empty/>");
}
}