/** * {@inheritDoc} */ @Override public void setConfigOrder(int cfg) { value = getConfigClass() | cfg; }
@Override public ITetrahedralChirality map(Map<IAtom, IAtom> atoms, Map<IBond, IBond> bonds) { return (ITetrahedralChirality) super.map(atoms, bonds); }
@Override public void setBuilder(IChemObjectBuilder builder) { super.setBuilder(builder); }
AbstractStereo(F focus, C[] carriers, int value) { if (focus == null) throw new NullPointerException("Focus of stereochemistry can not be null!"); if (carriers == null) throw new NullPointerException("Carriers of the configuration can not be null!"); if (carriers.length != numCarriers(value)) throw new IllegalArgumentException("Unexpected number of stereo carriers! expected " + ((value >>> 12) & 0xf) + " was " + carriers.length); for (C carrier : carriers) { if (carrier == null) throw new NullPointerException("A carrier was undefined!"); } this.value = value; this.focus = focus; this.carriers = new ArrayList<>(); Collections.addAll(this.carriers, carriers); }
@Override @SuppressWarnings("unchecked") public IStereoElement<F, C> map(Map<IChemObject, IChemObject> chemobjs) { if (chemobjs == null) throw new NullPointerException("chemobj map was not provided!"); F newfocus = (F) chemobjs.get(focus); if (newfocus == null) newfocus = focus; List<C> newcarriers = carriers; for (int i = 0; i < newcarriers.size(); i++) { C newcarrier = (C) chemobjs.get(newcarriers.get(i)); if (newcarrier != null) { // make a copy if this is the first change if (newcarriers == carriers) newcarriers = new ArrayList<>(carriers); newcarriers.set(i, newcarrier); } } // no change, return self if (newfocus == focus && newcarriers == carriers) return this; return create(newfocus, newcarriers, value); }
AbstractStereo(F focus, C[] carriers, int value) { if (focus == null) throw new NullPointerException("Focus of stereochemistry can not be null!"); if (carriers == null) throw new NullPointerException("Carriers of the configuration can not be null!"); if (carriers.length != numCarriers(value)) throw new IllegalArgumentException("Unexpected number of stereo carriers! expected " + ((value >>> 12) & 0xf) + " was " + carriers.length); for (C carrier : carriers) { if (carrier == null) throw new NullPointerException("A carrier was undefined!"); } this.value = value; this.focus = focus; this.carriers = new ArrayList<>(); Collections.addAll(this.carriers, carriers); }
@Override @SuppressWarnings("unchecked") public IStereoElement<F, C> map(Map<IChemObject, IChemObject> chemobjs) { if (chemobjs == null) throw new NullPointerException("chemobj map was not provided!"); F newfocus = (F) chemobjs.get(focus); if (newfocus == null) newfocus = focus; List<C> newcarriers = carriers; for (int i = 0; i < newcarriers.size(); i++) { C newcarrier = (C) chemobjs.get(newcarriers.get(i)); if (newcarrier != null) { // make a copy if this is the first change if (newcarriers == carriers) newcarriers = new ArrayList<>(carriers); newcarriers.set(i, newcarrier); } } // no change, return self if (newfocus == focus && newcarriers == carriers) return this; return create(newfocus, newcarriers, value); }
@Override public IDoubleBondStereochemistry map(Map<IAtom, IAtom> atoms, Map<IBond, IBond> bonds) { return (IDoubleBondStereochemistry) super.map(atoms, bonds); }
@Override public void setBuilder(IChemObjectBuilder builder) { super.setBuilder(builder); }
/** * {@inheritDoc} */ @Override public void setConfigOrder(int cfg) { value = getConfigClass() | cfg; }
@Override public IDoubleBondStereochemistry map(Map<IAtom, IAtom> atoms, Map<IBond, IBond> bonds) { return (IDoubleBondStereochemistry) super.map(atoms, bonds); }
public void setBuilder(IChemObjectBuilder builder) { super.setBuilder(builder); }
@Override public ITetrahedralChirality map(Map<IAtom, IAtom> atoms, Map<IBond, IBond> bonds) { return (ITetrahedralChirality) super.map(atoms, bonds); }
public void setBuilder(IChemObjectBuilder builder) { super.setBuilder(builder); }
@Override public ITetrahedralChirality map(Map<IChemObject, IChemObject> chemobjs) { return (ITetrahedralChirality) super.map(chemobjs); }
@Override public ITetrahedralChirality map(Map<IChemObject, IChemObject> chemobjs) { return (ITetrahedralChirality) super.map(chemobjs); }
/** * {@inheritDoc} */ @Override public IStereoElement<F,C> map(Map<IAtom, IAtom> atoms, Map<IBond, IBond> bonds) { if (atoms == null) throw new IllegalArgumentException("Atom map should be non-null"); if (bonds == null) throw new IllegalArgumentException("Bond map should be non-null"); Map<IChemObject,IChemObject> map = new HashMap<>(atoms.size() + bonds.size()); map.putAll(atoms); map.putAll(bonds); return map(map); }
/** * {@inheritDoc} */ @Override public IStereoElement<F,C> map(Map<IAtom, IAtom> atoms, Map<IBond, IBond> bonds) { if (atoms == null) throw new IllegalArgumentException("Atom map should be non-null"); if (bonds == null) throw new IllegalArgumentException("Bond map should be non-null"); Map<IChemObject,IChemObject> map = new HashMap<>(atoms.size() + bonds.size()); map.putAll(atoms); map.putAll(bonds); return map(map); }