@Override public boolean contains(Object arg0) { // TODO Auto-generated method stub if (!(arg0 instanceof TissueLikeMembrane)) return false; TissueLikeMembrane tlm = (TissueLikeMembrane) arg0; if (!cells.containsKey(tlm.getLabel())) return false; return cells.get(tlm.getLabel()).contains(arg0); }
private boolean secureAdd(TissueLikeMembrane arg0) { String label = arg0.getLabel(); List<TissueLikeMembrane> l; if (!cells.containsKey(label)) { l = new ArrayList<TissueLikeMembrane>(); cells.put(label, l); } else l = cells.get(label); l.add(arg0); cellsById.put(arg0.getId(), arg0); return true; }
protected boolean add(TissueLikeMembrane arg0) { // TODO Auto-generated method stub if (arg0.getLabel().equals(getEnvironmentLabel())) throw new IllegalArgumentException("Environment label"); return secureAdd(arg0); }