Exemple #1
0
  public Pads clone(Pads pads) {

    if (pads == null) return null;

    Pads newPads = new Pads();

    if (pads.getInstanceName() != null) newPads.setInstanceName(pads.getInstanceName());

    for (PadGroup pg : pads.getPadGroup()) newPads.getPadGroup().add(clone(pg));

    for (Pad p : pads.getPad()) newPads.getPad().add(clone(p));

    return newPads;
  }
Exemple #2
0
  public static Pad[] getPadsOfGroup(Pads cfg, String groupName) {
    ArrayList<Pad> res = new ArrayList<Pad>();

    for (Pad g : cfg.getPad())
      if (groupName == null && g.getGroup() == null
          || groupName != null && groupName.equals(g.getGroup())) res.add(g);

    return (Pad[]) res.toArray(new Pad[res.size()]);
  }
Exemple #3
0
  public static Pad getPad(Pads cfg, String groupName, String instName) {
    if (cfg == null) return null;

    for (Pad g : cfg.getPad())
      if ((groupName == null && g.getGroup() == null
              || groupName != null && groupName.equals(g.getGroup()))
          && (instName.equals(g.getInstanceName()))) return g;

    return null;
  }
Exemple #4
0
 /**
  * checks if a padData object still exists in the memory specification
  *
  * @param cfg
  * @param padData
  * @return
  */
 public static boolean existPadDataObject(Pads cfg, Pad padData) {
   for (Pad g : cfg.getPad()) {
     if (g == padData) return true;
   }
   return false;
 }