com.hfg.automation.platelayer.PlateLayer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com_hfg Show documentation
Show all versions of com_hfg Show documentation
com.hfg xml, html, svg, and bioinformatics utility library
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;
}
}