All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hfg.automation.platelayer.PlateLayer Maven / Gradle / Ivy

There is a newer version: 20240423
Show newest version
package com.hfg.automation.platelayer;

import java.lang.reflect.Constructor;
import java.util.Collection;

import com.hfg.automation.AutomationXML;
import com.hfg.automation.PlateLayout;
import com.hfg.automation.WellRef;
import com.hfg.bio.HfgBioXML;
import com.hfg.util.StringUtil;
import com.hfg.xml.XMLNode;


public interface PlateLayer extends Cloneable, Comparable
{
   public PlateLayer clone();

   public PlateLayer setPlate(LayerPlate inValue);

   public PlateLayer setLayout(PlateLayout inValue);
   public PlateLayout getLayout();

   public Collection getOccupiedWellRefs();

   public WellRef getNextAvailableWellRef();

   public WellLayer getWellLayer(WellRef inWellRef);

   public XMLNode toXMLNode();

   public PlateLayer setName(String inValue);
   public String     name();

   //--------------------------------------------------------------------------
   public static PlateLayer instantiate(XMLNode inXMLNode)
   {
      inXMLNode.verifyTagName(AutomationXML.PLATE_LAYER);

      String classname = inXMLNode.getAttributeValue(HfgBioXML.CLASS_ATT);
      if (! StringUtil.isSet(classname))
      {
         throw new RuntimeException("No " + AutomationXML.CLASS_ATT + " specified on plate layer's XML tag!");
      }

      PlateLayer layer = null;

      try
      {
         Class clazz = Class.forName(classname);
         Constructor constructor = clazz.getConstructor(XMLNode.class);
         layer = (PlateLayer) constructor.newInstance(inXMLNode);
      }
      catch (Exception e)
      {
         throw new RuntimeException("Error during plate layer instantiation from its XML tag!", e);
      }

      return layer;
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy