Class NamedValues
- java.lang.Object
-
- org.epics.pvdata.util.namedValues.NamedValues
-
public class NamedValues extends Object
NamedValues is a particular implementation of a named value system, in which the value in each name/value pair is itself specifically a Vector of values.Functionally then, the name identifies a list of data.
named/value pairs are added to a NameValues object through the
addmethod. The list of names (in the system of name/value pairs) is acquired throughgetLabels. And the whole system (all the names, and all the values associated with each name, is acquired throughgetValues.In this way, a table can be thought of as a NamedValues system, where each column label and the values under it are a single named/value. A single NamedValues object holds a whole table.
- Author:
- Greg White and Chris Larrieu. 11-Dec-201, SLAC
-
-
Constructor Summary
Constructors Constructor Description NamedValues()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(String name, Vector value)Add a named Vector of values to a NameValues object.String[]getLabels()Gets all the names in the named/values system at once, as an array of Strings.String[][]getValues()Gets all the values in the named/values system.
-
-
-
Method Detail
-
add
public void add(String name, Vector value)
Add a named Vector of values to a NameValues object.- Parameters:
name- the name of the list of values to add, eg "girlscouts"value- the list of values associated with name, eg {"Caroline", "Mary", "Beth"}
-
getLabels
public String[] getLabels()
Gets all the names in the named/values system at once, as an array of Strings.- Returns:
- all names in the NamedValues object, ie the column headings in the table analogy
-
getValues
public String[][] getValues()
Gets all the values in the named/values system. Since each "value" is itself a list (supplied as a vector to the add method), this method returns a 2d array.- Returns:
- the values arrays presently in the NamedValues object, i.e. the contents of the table in the table analogy
-
-