2 * collectd/java - org/collectd/api/OConfigItem.java
3 * Copyright (C) 2009 Florian octo Forster
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; only version 2 of the License is applicable.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 * Florian octo Forster <octo at verplant.org>
22 package org.collectd.api;
24 import java.util.List;
25 import java.util.ArrayList;
27 public class OConfigItem
29 private String _key = null;
30 private List<OConfigValue> _values = new ArrayList<OConfigValue> ();
31 private List<OConfigItem> _children = new ArrayList<OConfigItem> ();
33 public OConfigItem (String key)
36 } /* OConfigItem (String key) */
38 public String getKey ()
41 } /* String getKey () */
43 public void addValue (OConfigValue cv)
46 } /* void addValue (OConfigValue cv) */
48 public void addValue (String s)
50 _values.add (new OConfigValue (s));
51 } /* void addValue (String s) */
53 public void addValue (Number n)
55 _values.add (new OConfigValue (n));
56 } /* void addValue (String s) */
58 public void addValue (boolean b)
60 _values.add (new OConfigValue (b));
61 } /* void addValue (String s) */
63 public List<OConfigValue> getValues ()
66 } /* List<OConfigValue> getValues () */
68 public void addChild (OConfigItem ci)
71 } /* void addChild (OConfigItem ci) */
73 public List<OConfigItem> getChildren ()
76 } /* List<OConfigItem> getChildren () */
78 public String toString ()
80 return (new String ("{ key: " + _key + "; "
81 + "values: " + _values.toString () + "; "
82 + "children: " + _children.toString () + "; }"));
83 } /* String toString () */
84 } /* class OConfigItem */
86 /* vim: set sw=2 sts=2 et fdm=marker : */