Record Class Paths.CpdagCheckResult
java.lang.Object
java.lang.Record
edu.cmu.tetrad.graph.Paths.CpdagCheckResult
- Record Components:
isLegal- Indicates whether the CPDAG is legal. A value oftruemeans the CPDAG is legal, whilefalsemeans it is not.violation- The violation encountered in the CPDAG if it is illegal. This value isnullwhenisLegalistrue.detail- Additional information providing specific details about the violation, if any. This value isnullwhenisLegalistrue.
- Enclosing class:
Paths
public static record Paths.CpdagCheckResult(boolean isLegal, Paths.CpdagViolation violation, String detail)
extends Record
Represents the result of a CPDAG legality check.
This class encapsulates the status of whether the CPDAG is legal or not, the specific violation if it is not legal, and an optional detailed explanation.
- Version:
- $Id: $Id
- Author:
- josephramsey
-
Constructor Summary
ConstructorsConstructorDescriptionCpdagCheckResult(boolean isLegal, Paths.CpdagViolation violation, String detail) Creates an instance of aCpdagCheckResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondetail()Returns the value of thedetailrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static Paths.CpdagCheckResultillegal(Paths.CpdagViolation violation, String detail) Creates anCpdagCheckResultinstance indicating an illegal CPDAG.booleanisLegal()Returns the value of theisLegalrecord component.static Paths.CpdagCheckResultlegal()Creates aCpdagCheckResultinstance representing a legal CPDAG.toString()Returns a string representation of the CPDAG legality check result.Returns the value of theviolationrecord component.
-
Constructor Details
-
Method Details
-
legal
Creates aCpdagCheckResultinstance representing a legal CPDAG.This method provides a standardized way to indicate the legality of a CPDAG when no violations or additional details exist.
- Returns:
- A
CpdagCheckResultobject withisLegalset totrue, and bothviolationanddetailset tonull.
-
illegal
Creates anCpdagCheckResultinstance indicating an illegal CPDAG.This method is used when a CPDAG check fails due to a violation. It encapsulates the specific violation and an optional detailed explanation.
- Parameters:
violation- The specificCpdagViolationencountered. This parameter must not benull.detail- Additional details about the violation, which can provide more context or clarification. This may benullif no further details are necessary.- Returns:
- A
CpdagCheckResultobject withisLegalset tofalse, containing the specified violation and detail.
-
toString
Returns a string representation of the CPDAG legality check result.If the CPDAG is legal, the string "Legal CPDAG" is returned. Otherwise, a string describing the violation and any additional details is returned.
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
isLegal
-
violation
-
detail
-