us.ihmc.simulationconstructionset.gui.config.VarGroupList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of simulation-construction-set
Show all versions of simulation-construction-set
Simulation Construction Set
package us.ihmc.simulationconstructionset.gui.config;
//~--- JDK imports ------------------------------------------------------------
import java.util.ArrayList;
import java.util.List;
public class VarGroupList
{
private List groups = new ArrayList<>();
public VarGroupList()
{
}
public void addVarGroup(VarGroup group)
{
groups.add(group);
}
public String[] getVarGroupNames()
{
int n = groups.size();
String[] ret = new String[n];
for (int i = 0; i < n; i++)
{
ret[i] = (groups.get(i)).getName();
}
return ret;
}
public VarGroup getVarGroup(String name)
{
int n = groups.size();
for (int i = 0; i < n; i++)
{
VarGroup group = (groups.get(i));
if (group.getName().equals(name))
{
return group;
}
}
return null;
}
public void setupVarGroup(String name, String[] vars)
{
VarGroup group = new VarGroup(name);
group.addVars(vars);
addVarGroup(group);
}
public void setupVarGroup(String name, String[] vars, String[] regularExpressions)
{
VarGroup group = new VarGroup(name);
group.addVars(vars);
group.addRegularExpressions(regularExpressions);
addVarGroup(group);
}
/*
* public void setupVarGroup(String name, String regex) { VarGroup group = new VarGroup(name);
* group.addRegularExpression(regex); addVarGroup(group); }
*/
}