
package de.ivu.elect.business.gebietsbaum.control;

import java.util.Objects;

import de.ivu.elect.business.gebietsbaum.entity.Gebiet;

public class GebietByBreadthFirstUndNummerOhneParentComparator extends GebietByBreadthFirstComparator {

  private static final long serialVersionUID = 1L;

  public static final GebietByBreadthFirstUndNummerOhneParentComparator INSTANCE = new GebietByBreadthFirstUndNummerOhneParentComparator();

  public GebietByBreadthFirstUndNummerOhneParentComparator() {
    super();
  }

  @Override
  public int compare(Gebiet one, Gebiet another) {
    if (Objects.equals(one, another)) {
      return 0;
    }
    int result = compareDepth(one, another);

    if (result == 0) {
      result = compareNummer(one, another);
    }

    return result;
  }
}
