/** returns and identical copy of this object . * @return and identical copy of this object */ @Override public Object clone() { AtomImpl n = new AtomImpl(); n.setOccupancy(getOccupancy()); n.setTempFactor(getTempFactor()); n.altLoc = altLoc; // since char is a primitive we can do this (to avoid going through getter/setter that check for nulls) n.setCharge(getCharge()); double[] coords = getCoords(); n.setX(coords[0]); n.setY(coords[1]); n.setZ(coords[2]); n.setPDBserial(getPDBserial()); n.setName(getName()); n.setElement(getElement()); // NOTE bonds can't be cloned here, they would need to be cloned at the // chain or group level (depending if they are intra or inter group bonds) -- JD 2016-03-02 return n ; }