@Override public LoadImpl getLoad(String id) { return objectStore.get(id, LoadImpl.class); }
protected String checkAndGetUniqueId() { if (id == null) { throw new PowsyblException(getTypeDescription() + " id is not set"); } String uniqueId; if (ensureIdUnicity) { uniqueId = getNetwork().getObjectStore().getUniqueId(id); } else { if (getNetwork().getObjectStore().contains(id)) { Identifiable obj = getNetwork().getObjectStore().get(id); throw new PowsyblException("The network " + getNetwork().getId() + " already contains an object '" + obj.getClass().getSimpleName() + "' with the id '" + id + "'"); } uniqueId = id; } return uniqueId; }
@Override public StaticVarCompensatorImpl getStaticVarCompensator(String id) { return objectStore.get(id, StaticVarCompensatorImpl.class); }
@Override public BusbarSection getBusbarSection(String id) { return objectStore.get(id, BusbarSectionImpl.class); }
@Override public SubstationImpl getSubstation(String id) { return objectStore.get(id, SubstationImpl.class); }
@Override public ThreeWindingsTransformer getThreeWindingsTransformer(String id) { return objectStore.get(id, ThreeWindingsTransformerImpl.class); }
@Override public DanglingLineImpl getDanglingLine(String id) { return objectStore.get(id, DanglingLineImpl.class); }
@Override public TwoWindingsTransformer getTwoWindingsTransformer(String id) { return objectStore.get(id, TwoWindingsTransformerImpl.class); }
@Override public GeneratorImpl getGenerator(String id) { return objectStore.get(id, GeneratorImpl.class); }
@Override public ShuntCompensatorImpl getShuntCompensator(String id) { return objectStore.get(id, ShuntCompensatorImpl.class); }
@Override public Switch getSwitch(String id) { return objectStore.get(id, SwitchImpl.class); }
@Override public HvdcLine getHvdcLine(String id) { return objectStore.get(id, HvdcLineImpl.class); }
@Override public Identifiable<?> getIdentifiable(String id) { return objectStore.get(id, Identifiable.class); }
@Override public VoltageLevelExt getVoltageLevel(String id) { return objectStore.get(id, VoltageLevelExt.class); }
@Override public LccConverterStationImpl getLccConverterStation(String id) { return objectStore.get(id, LccConverterStationImpl.class); }
@Override public VscConverterStationImpl getVscConverterStation(String id) { return objectStore.get(id, VscConverterStationImpl.class); }
@Override public BusbarSection getBusbarSection(String id) { return getNetwork().getObjectStore().get(id, BusbarSection.class); }
@Override public <T extends Connectable> T getConnectable(String id, Class<T> aClass) { // the fastest way to get the equipment is to look in the object store // and then check if it is connected to this substation T connectable = substation.getNetwork().getObjectStore().get(id, aClass); if (connectable == null) { return null; } else if (connectable instanceof Injection) { return ((Injection) connectable).getTerminal().getVoltageLevel() == this ? connectable : null; } else if (connectable instanceof Branch) { return ((Branch) connectable).getTerminal1().getVoltageLevel() == this || ((Branch) connectable).getTerminal2().getVoltageLevel() == this ? connectable : null; } else if (connectable instanceof ThreeWindingsTransformer) { return ((ThreeWindingsTransformer) connectable).getLeg1().getTerminal().getVoltageLevel() == this || ((ThreeWindingsTransformer) connectable).getLeg2().getTerminal().getVoltageLevel() == this || ((ThreeWindingsTransformer) connectable).getLeg3().getTerminal().getVoltageLevel() == this ? connectable : null; } else { throw new AssertionError(); } }