Skip to content

Commit

Permalink
Merge branch 'master' into topo_concurrency_issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mathbagu committed Sep 6, 2016
2 parents 8f4ca22 + 8297375 commit 94ad4bf
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 19 deletions.
Expand Up @@ -13,7 +13,7 @@
*
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
public interface Connectable<I extends Identifiable<I>> extends Identifiable<I> {
public interface Connectable<I extends Connectable<I>> extends Identifiable<I> {

/**
* Get the connectable type.
Expand Down
Expand Up @@ -11,7 +11,7 @@
*
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
public interface SingleTerminalConnectable<I extends Identifiable<I>> extends Connectable<I> {
public interface SingleTerminalConnectable<I extends SingleTerminalConnectable<I>> extends Connectable<I> {

/**
* Get the terminal.
Expand Down
Expand Up @@ -11,7 +11,7 @@
*
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
public interface TwoTerminalsConnectable<I extends Identifiable<I>> extends Connectable<I> {
public interface TwoTerminalsConnectable<I extends TwoTerminalsConnectable<I>> extends Connectable<I> {

enum Side {
ONE,
Expand Down
Expand Up @@ -15,7 +15,7 @@
*
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
abstract class AbstractTwoTerminalsConnectable<I extends Identifiable<I>> extends ConnectableImpl<I> implements CurrentLimitsOwner<Side> {
abstract class AbstractTwoTerminalsConnectable<I extends Connectable<I>> extends ConnectableImpl<I> implements CurrentLimitsOwner<Side> {

private CurrentLimits limits1;

Expand Down
Expand Up @@ -16,7 +16,7 @@
*
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
abstract class ConnectableImpl<I extends Identifiable<I>> extends IdentifiableImpl<I> implements Connectable<I>, Stateful {
abstract class ConnectableImpl<I extends Connectable<I>> extends IdentifiableImpl<I> implements Connectable<I>, Stateful {

protected final List<TerminalExt> terminals = new ArrayList<>();

Expand Down
Expand Up @@ -17,7 +17,7 @@
*
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
class CurrentLimitsAdderImpl<SIDE, OWNER extends CurrentLimitsOwner<SIDE> & Validable> implements CurrentLimitsAdder {
public class CurrentLimitsAdderImpl<SIDE, OWNER extends CurrentLimitsOwner<SIDE> & Validable> implements CurrentLimitsAdder {

private static final Comparator<Integer> ACCEPTABLE_DURATION_COMPARATOR = new Comparator<Integer>() {
@Override
Expand Down Expand Up @@ -72,7 +72,7 @@ public CurrentLimitsAdder endTemporaryLimit() {

}

CurrentLimitsAdderImpl(SIDE side, OWNER owner) {
public CurrentLimitsAdderImpl(SIDE side, OWNER owner) {
this.side = side;
this.owner = owner;
}
Expand Down
Expand Up @@ -14,7 +14,7 @@
*
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
class CurrentLimitsImpl implements CurrentLimits {
public class CurrentLimitsImpl implements CurrentLimits {

private final float permanentLimit;

Expand Down
Expand Up @@ -10,7 +10,7 @@
*
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
interface CurrentLimitsOwner<SIDE> {
public interface CurrentLimitsOwner<SIDE> {

void setCurrentLimits(SIDE side, CurrentLimitsImpl limits);

Expand Down
Expand Up @@ -10,7 +10,7 @@
*
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
interface Validable {
public interface Validable {

String getMessageHeader();

Expand Down
Expand Up @@ -17,7 +17,7 @@
*
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
abstract class ConnectableXml<T extends Connectable, A extends IdentifiableAdder<A>, P extends Container> extends IdentifiableXml<T, A, P> {
public abstract class ConnectableXml<T extends Connectable, A extends IdentifiableAdder<A>, P extends Container> extends IdentifiableXml<T, A, P> {

private static String indexToString(Integer index) {
return index != null ? index.toString() : "";
Expand Down Expand Up @@ -122,7 +122,7 @@ protected static void readPQ(Integer index, Terminal t, XMLStreamReader reader)
.setQ(q);
}

protected void readCurrentLimits(Integer index, Supplier<CurrentLimitsAdder> currentLimitOwner, XMLStreamReader reader) throws XMLStreamException {
public static void readCurrentLimits(Integer index, Supplier<CurrentLimitsAdder> currentLimitOwner, XMLStreamReader reader) throws XMLStreamException {
CurrentLimitsAdder adder = currentLimitOwner.get();
float permanentLimit = XmlUtil.readOptionalFloatAttribute(reader, "permanentLimit");
adder.setPermanentLimit(permanentLimit);
Expand All @@ -139,13 +139,17 @@ protected void readCurrentLimits(Integer index, Supplier<CurrentLimitsAdder> cur
adder.add();
}

protected static void writeCurrentLimits(Integer index, CurrentLimits limits, XMLStreamWriter writer) throws XMLStreamException {
public static void writeCurrentLimits(Integer index, CurrentLimits limits, XMLStreamWriter writer) throws XMLStreamException {
writeCurrentLimits(index, limits, writer, IIDM_URI);
}

public static void writeCurrentLimits(Integer index, CurrentLimits limits, XMLStreamWriter writer, String nsUri) throws XMLStreamException {
if (!Float.isNaN(limits.getPermanentLimit())
|| limits.getTemporaryLimits().size() > 0) {
if (limits.getTemporaryLimits().isEmpty()) {
writer.writeEmptyElement(IIDM_URI, "currentLimits" + indexToString(index));
writer.writeEmptyElement(nsUri, "currentLimits" + indexToString(index));
} else {
writer.writeStartElement(IIDM_URI, "currentLimits" + indexToString(index));
writer.writeStartElement(nsUri, "currentLimits" + indexToString(index));
}
XmlUtil.writeFloat("permanentLimit", limits.getPermanentLimit(), writer);
for (CurrentLimits.TemporaryLimit tl : limits.getTemporaryLimits()) {
Expand Down
Expand Up @@ -15,7 +15,7 @@
/**
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
public interface ExtensionXml<I extends Identifiable<I>, E extends Identifiable.Extension<I>> {
public interface ExtensionXml<I extends Identifiable, E extends Identifiable.Extension<I>> {

String getExtensionName();

Expand All @@ -31,5 +31,5 @@ public interface ExtensionXml<I extends Identifiable<I>, E extends Identifiable.

void write(E extension, XmlWriterContext context) throws XMLStreamException;

E read(I identifiable, XMLStreamReader reader);
E read(I identifiable, XMLStreamReader reader) throws XMLStreamException;
}
Expand Up @@ -14,7 +14,7 @@
*
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
interface XmlConstants {
public interface XmlConstants {

String INDENT = " ";

Expand Down
Expand Up @@ -19,7 +19,7 @@ public class XmlUtil {
private XmlUtil() {
}

interface XmlEventHandler {
public interface XmlEventHandler {

void onStartElement() throws XMLStreamException;

Expand Down

0 comments on commit 94ad4bf

Please sign in to comment.