Class Violation

java.lang.Object
com.dna.jopt.member.unit.violation.Violation
All Implemented Interfaces:
IViolation, Serializable, Cloneable

public class Violation extends Object implements IViolation
See Also:
  • Constructor Details

    • Violation

      public Violation(String category, String attribute, String subAttribute, int violationCode)
  • Method Details

    • setViolationActors

      public void setViolationActors(List<IOptimizationElement> elements)
      Description copied from interface: IViolation
      Gets the violationActors.
      Specified by:
      setViolationActors in interface IViolation
      Parameters:
      elements - the arrayList containing IOptimizationElements
    • getViolationActors

      public List<IOptimizationElement> getViolationActors()
      Description copied from interface: IViolation
      Gets the violationActors.
      Specified by:
      getViolationActors in interface IViolation
      Returns:
      the arraylist violationActors containing IOptimizationElements
    • setViolationActorRoutes

      public void setViolationActorRoutes(List<ILogicEntityRoute> routes)
      Description copied from interface: IViolation
      Sets the routes, which are triggering the violation.
      Specified by:
      setViolationActorRoutes in interface IViolation
      Parameters:
      routes - the new violation actor routes
    • getViolationActorRoutes

      public List<ILogicEntityRoute> getViolationActorRoutes()
      Description copied from interface: IViolation
      Gets the routes, which are triggering the violation. This method may return an empty list even though violations are present
      Specified by:
      getViolationActorRoutes in interface IViolation
      Returns:
      the violation actor routes
    • getCategory

      public String getCategory()
      Description copied from interface: IViolation
      Gets the category.
      Specified by:
      getCategory in interface IViolation
      Returns:
      the category
    • getAttribute

      public String getAttribute()
      Description copied from interface: IViolation
      Gets the attribute.
      Specified by:
      getAttribute in interface IViolation
      Returns:
      the attribute
    • getSubAttribute

      public String getSubAttribute()
      Description copied from interface: IViolation
      Gets the subAttribute.
      Specified by:
      getSubAttribute in interface IViolation
      Returns:
      the subAttribute
    • setValue

      public void setValue(String violationDesc, String violationValue)
      Description copied from interface: IViolation
      Sets the value.
      Specified by:
      setValue in interface IViolation
      Parameters:
      violationDesc - the value desc
      violationValue - the violation value
    • getValue

      @Deprecated public String getValue()
      Deprecated.
      Specified by:
      getValue in interface IViolation
      Returns:
      the value
    • getViolationDescription

      public String getViolationDescription()
      Description copied from interface: IViolation
      Gets the violation description.
      Specified by:
      getViolationDescription in interface IViolation
      Returns:
      the violation description
    • getCode

      public int getCode()
      Description copied from interface: IViolation
      Gets the code that is identifying this IViolation
      Specified by:
      getCode in interface IViolation
      Returns:
      the code
    • toString

      public String toString()
      Description copied from interface: IViolation
      Returns the category, the attribute, the value and the violationValue. If getViolationActors() is not empty adds all the ids of all current actors.
      Specified by:
      toString in interface IViolation
      Overrides:
      toString in class Object
      Returns:
      category, attribute, value and id of all actors
    • copy

      public Violation copy()
      Description copied from interface: IViolation
      Returns a new Violation with the values of getCategory(), getAttribute(), getValue() and getCode().
      Specified by:
      copy in interface IViolation
      Returns:
      a copy of the Violation with the category, attribute, value and code
    • getViolationValue

      public String getViolationValue()
      Description copied from interface: IViolation
      Gets the violationValue, the default value is "".
      Specified by:
      getViolationValue in interface IViolation
      Returns:
      the violationvalue