Class ProblemFactory


  • public class ProblemFactory
    extends java.lang.Object
    Creates problems for the TaskTable.
    • Constructor Detail

      • ProblemFactory

        public ProblemFactory()
    • Method Detail

      • createProblem

        public static SimpleProblem createProblem​(Problem.Severity severity,
                                                  ProblemType type,
                                                  Region region,
                                                  Unit owner,
                                                  Faction faction,
                                                  java.lang.Object object,
                                                  Inspector inspector,
                                                  java.lang.String message,
                                                  int line)
        Creates a problem with all parameters given;
        Parameters:
        severity -
        type - One of Problem.Severity.INFORMATION, Problem.Severity.WARNING, Problem.Severity.ERROR
        region - A region where the problem occurs
        owner - The unit responsible for this problem or null. If line >= 0 , it refers to an order of this unit.
        faction - The faction this problem belongs to or null
        object - The object that this problem criticizes
        inspector - The Inspector that reported this problem
        message - The message text of the problem
        line - The line number in the orders of owner where the problem occured or -1 if no such order can be identified. The first line is line 1!
      • createProblem

        public static SimpleProblem createProblem​(Problem.Severity severity,
                                                  ProblemType type,
                                                  Unit unit,
                                                  Inspector inspector,
                                                  int line)
        Creates a problem. Tries to deduce region and faction from the Unit, and the message from the ProblemType.
        Parameters:
        severity -
        type -
        unit - The unit responsible for this problem or null. If line >= 0 , it refers to an order of this unit.
        inspector -
        line - The line number in the orders of owner where the problem occurred or -1 if no such order can be identified. The first line is line 1!
      • createProblem

        public static SimpleProblem createProblem​(Problem.Severity severity,
                                                  ProblemType type,
                                                  Unit unit,
                                                  Inspector inspector)
        Creates a problem without line. Tries to deduce region and faction from the Unit, and the message from the ProblemType.
        Parameters:
        severity -
        type -
        unit - The unit responsible for this problem or null. If line >= 0 , it refers to an order of this unit.
        inspector -
      • createProblem

        public static SimpleProblem createProblem​(Problem.Severity severity,
                                                  ProblemType type,
                                                  UnitContainer container,
                                                  Inspector inspector,
                                                  int line)
        Creates a problem. Tries to deduce unit, region and faction from the UnitContainer, and the message from the ProblemType.
        Parameters:
        severity -
        type -
        container -
        inspector -
        line - The line number in the orders of owner where the problem occured or -1 if no such order can be identified. The first line is line 1!
      • createProblem

        public static SimpleProblem createProblem​(Problem.Severity severity,
                                                  ProblemType type,
                                                  UnitContainer container,
                                                  Inspector inspector)
        Creates a problem without line. Tries to deduce unit, region and faction from the UnitContainer, and the message from the ProblemType.
        Parameters:
        severity -
        type -
        container -
        inspector -
      • createProblem

        public static SimpleProblem createProblem​(Problem.Severity severity,
                                                  ProblemType type,
                                                  Unit unit,
                                                  Inspector inspector,
                                                  java.lang.String message,
                                                  int line)
        Creates a problem. Tries to deduce region and faction from the Unit, but uses the given message.
        Parameters:
        severity -
        type -
        unit - The unit responsible for this problem or null. If line >= 0 , it refers to an order of this unit.
        inspector -
        message -
        line - The line number in the orders of owner where the problem occured or -1 if no such order can be identified. The first line is line 1!
      • createProblem

        public static Problem createProblem​(Problem.Severity severity,
                                            ProblemType type)
        Creates a dummy problem without object, inspector, or line.
        Parameters:
        severity -
        type -