Class LinearBooleanProblem.Builder

  • All Implemented Interfaces:
    LinearBooleanProblemOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, java.lang.Cloneable
    Enclosing class:
    LinearBooleanProblem

    public static final class LinearBooleanProblem.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanProblem.Builder>
    implements LinearBooleanProblemOrBuilder
     A linear Boolean problem.
     
    Protobuf type operations_research.sat.LinearBooleanProblem
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanProblem.Builder>
      • clear

        public LinearBooleanProblem.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanProblem.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanProblem.Builder>
      • getDefaultInstanceForType

        public LinearBooleanProblem getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public LinearBooleanProblem build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public LinearBooleanProblem buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public LinearBooleanProblem.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanProblem.Builder>
      • setField

        public LinearBooleanProblem.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                     java.lang.Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanProblem.Builder>
      • clearField

        public LinearBooleanProblem.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanProblem.Builder>
      • clearOneof

        public LinearBooleanProblem.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanProblem.Builder>
      • setRepeatedField

        public LinearBooleanProblem.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                             int index,
                                                             java.lang.Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanProblem.Builder>
      • addRepeatedField

        public LinearBooleanProblem.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                             java.lang.Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanProblem.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanProblem.Builder>
      • mergeFrom

        public LinearBooleanProblem.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                                      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                               throws java.io.IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<LinearBooleanProblem.Builder>
        Throws:
        java.io.IOException
      • hasName

        public boolean hasName()
         The name of the problem.
         
        optional string name = 1 [default = ""];
        Specified by:
        hasName in interface LinearBooleanProblemOrBuilder
        Returns:
        Whether the name field is set.
      • getName

        public java.lang.String getName()
         The name of the problem.
         
        optional string name = 1 [default = ""];
        Specified by:
        getName in interface LinearBooleanProblemOrBuilder
        Returns:
        The name.
      • getNameBytes

        public com.google.protobuf.ByteString getNameBytes()
         The name of the problem.
         
        optional string name = 1 [default = ""];
        Specified by:
        getNameBytes in interface LinearBooleanProblemOrBuilder
        Returns:
        The bytes for name.
      • setName

        public LinearBooleanProblem.Builder setName​(java.lang.String value)
         The name of the problem.
         
        optional string name = 1 [default = ""];
        Parameters:
        value - The name to set.
        Returns:
        This builder for chaining.
      • clearName

        public LinearBooleanProblem.Builder clearName()
         The name of the problem.
         
        optional string name = 1 [default = ""];
        Returns:
        This builder for chaining.
      • setNameBytes

        public LinearBooleanProblem.Builder setNameBytes​(com.google.protobuf.ByteString value)
         The name of the problem.
         
        optional string name = 1 [default = ""];
        Parameters:
        value - The bytes for name to set.
        Returns:
        This builder for chaining.
      • hasNumVariables

        public boolean hasNumVariables()
         The number of variables in the problem.
         All the signed representation of the problem literals must be in
         [-num_variables, num_variables], excluding 0.
         
        optional int32 num_variables = 3;
        Specified by:
        hasNumVariables in interface LinearBooleanProblemOrBuilder
        Returns:
        Whether the numVariables field is set.
      • getNumVariables

        public int getNumVariables()
         The number of variables in the problem.
         All the signed representation of the problem literals must be in
         [-num_variables, num_variables], excluding 0.
         
        optional int32 num_variables = 3;
        Specified by:
        getNumVariables in interface LinearBooleanProblemOrBuilder
        Returns:
        The numVariables.
      • setNumVariables

        public LinearBooleanProblem.Builder setNumVariables​(int value)
         The number of variables in the problem.
         All the signed representation of the problem literals must be in
         [-num_variables, num_variables], excluding 0.
         
        optional int32 num_variables = 3;
        Parameters:
        value - The numVariables to set.
        Returns:
        This builder for chaining.
      • clearNumVariables

        public LinearBooleanProblem.Builder clearNumVariables()
         The number of variables in the problem.
         All the signed representation of the problem literals must be in
         [-num_variables, num_variables], excluding 0.
         
        optional int32 num_variables = 3;
        Returns:
        This builder for chaining.
      • getConstraintsCount

        public int getConstraintsCount()
         The constraints of the problem.
         
        repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
        Specified by:
        getConstraintsCount in interface LinearBooleanProblemOrBuilder
      • clearConstraints

        public LinearBooleanProblem.Builder clearConstraints()
         The constraints of the problem.
         
        repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
      • removeConstraints

        public LinearBooleanProblem.Builder removeConstraints​(int index)
         The constraints of the problem.
         
        repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
      • getConstraintsBuilder

        public LinearBooleanConstraint.Builder getConstraintsBuilder​(int index)
         The constraints of the problem.
         
        repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
      • addConstraintsBuilder

        public LinearBooleanConstraint.Builder addConstraintsBuilder()
         The constraints of the problem.
         
        repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
      • addConstraintsBuilder

        public LinearBooleanConstraint.Builder addConstraintsBuilder​(int index)
         The constraints of the problem.
         
        repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
      • getConstraintsBuilderList

        public java.util.List<LinearBooleanConstraint.Builder> getConstraintsBuilderList()
         The constraints of the problem.
         
        repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
      • hasObjective

        public boolean hasObjective()
         The objective of the problem.
         If left empty, we just have a satisfiability problem.
         
        optional .operations_research.sat.LinearObjective objective = 5;
        Specified by:
        hasObjective in interface LinearBooleanProblemOrBuilder
        Returns:
        Whether the objective field is set.
      • getObjective

        public LinearObjective getObjective()
         The objective of the problem.
         If left empty, we just have a satisfiability problem.
         
        optional .operations_research.sat.LinearObjective objective = 5;
        Specified by:
        getObjective in interface LinearBooleanProblemOrBuilder
        Returns:
        The objective.
      • setObjective

        public LinearBooleanProblem.Builder setObjective​(LinearObjective value)
         The objective of the problem.
         If left empty, we just have a satisfiability problem.
         
        optional .operations_research.sat.LinearObjective objective = 5;
      • setObjective

        public LinearBooleanProblem.Builder setObjective​(LinearObjective.Builder builderForValue)
         The objective of the problem.
         If left empty, we just have a satisfiability problem.
         
        optional .operations_research.sat.LinearObjective objective = 5;
      • mergeObjective

        public LinearBooleanProblem.Builder mergeObjective​(LinearObjective value)
         The objective of the problem.
         If left empty, we just have a satisfiability problem.
         
        optional .operations_research.sat.LinearObjective objective = 5;
      • clearObjective

        public LinearBooleanProblem.Builder clearObjective()
         The objective of the problem.
         If left empty, we just have a satisfiability problem.
         
        optional .operations_research.sat.LinearObjective objective = 5;
      • getObjectiveBuilder

        public LinearObjective.Builder getObjectiveBuilder()
         The objective of the problem.
         If left empty, we just have a satisfiability problem.
         
        optional .operations_research.sat.LinearObjective objective = 5;
      • getVarNamesList

        public com.google.protobuf.ProtocolStringList getVarNamesList()
         The names of the problem variables. The variables index are 0-based and
         var_names[i] will be the name of the i-th variable which correspond to
         literals +(i + 1) or -(i + 1). This is optional and can be left empty.
         
        repeated string var_names = 6;
        Specified by:
        getVarNamesList in interface LinearBooleanProblemOrBuilder
        Returns:
        A list containing the varNames.
      • getVarNamesCount

        public int getVarNamesCount()
         The names of the problem variables. The variables index are 0-based and
         var_names[i] will be the name of the i-th variable which correspond to
         literals +(i + 1) or -(i + 1). This is optional and can be left empty.
         
        repeated string var_names = 6;
        Specified by:
        getVarNamesCount in interface LinearBooleanProblemOrBuilder
        Returns:
        The count of varNames.
      • getVarNames

        public java.lang.String getVarNames​(int index)
         The names of the problem variables. The variables index are 0-based and
         var_names[i] will be the name of the i-th variable which correspond to
         literals +(i + 1) or -(i + 1). This is optional and can be left empty.
         
        repeated string var_names = 6;
        Specified by:
        getVarNames in interface LinearBooleanProblemOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The varNames at the given index.
      • getVarNamesBytes

        public com.google.protobuf.ByteString getVarNamesBytes​(int index)
         The names of the problem variables. The variables index are 0-based and
         var_names[i] will be the name of the i-th variable which correspond to
         literals +(i + 1) or -(i + 1). This is optional and can be left empty.
         
        repeated string var_names = 6;
        Specified by:
        getVarNamesBytes in interface LinearBooleanProblemOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the varNames at the given index.
      • setVarNames

        public LinearBooleanProblem.Builder setVarNames​(int index,
                                                        java.lang.String value)
         The names of the problem variables. The variables index are 0-based and
         var_names[i] will be the name of the i-th variable which correspond to
         literals +(i + 1) or -(i + 1). This is optional and can be left empty.
         
        repeated string var_names = 6;
        Parameters:
        index - The index to set the value at.
        value - The varNames to set.
        Returns:
        This builder for chaining.
      • addVarNames

        public LinearBooleanProblem.Builder addVarNames​(java.lang.String value)
         The names of the problem variables. The variables index are 0-based and
         var_names[i] will be the name of the i-th variable which correspond to
         literals +(i + 1) or -(i + 1). This is optional and can be left empty.
         
        repeated string var_names = 6;
        Parameters:
        value - The varNames to add.
        Returns:
        This builder for chaining.
      • addAllVarNames

        public LinearBooleanProblem.Builder addAllVarNames​(java.lang.Iterable<java.lang.String> values)
         The names of the problem variables. The variables index are 0-based and
         var_names[i] will be the name of the i-th variable which correspond to
         literals +(i + 1) or -(i + 1). This is optional and can be left empty.
         
        repeated string var_names = 6;
        Parameters:
        values - The varNames to add.
        Returns:
        This builder for chaining.
      • clearVarNames

        public LinearBooleanProblem.Builder clearVarNames()
         The names of the problem variables. The variables index are 0-based and
         var_names[i] will be the name of the i-th variable which correspond to
         literals +(i + 1) or -(i + 1). This is optional and can be left empty.
         
        repeated string var_names = 6;
        Returns:
        This builder for chaining.
      • addVarNamesBytes

        public LinearBooleanProblem.Builder addVarNamesBytes​(com.google.protobuf.ByteString value)
         The names of the problem variables. The variables index are 0-based and
         var_names[i] will be the name of the i-th variable which correspond to
         literals +(i + 1) or -(i + 1). This is optional and can be left empty.
         
        repeated string var_names = 6;
        Parameters:
        value - The bytes of the varNames to add.
        Returns:
        This builder for chaining.
      • hasAssignment

        public boolean hasAssignment()
         Stores an assignment of the problem variables. That may be an initial
         feasible solution, just a partial assignment or the optimal solution.
         
        optional .operations_research.sat.BooleanAssignment assignment = 7;
        Specified by:
        hasAssignment in interface LinearBooleanProblemOrBuilder
        Returns:
        Whether the assignment field is set.
      • getAssignment

        public BooleanAssignment getAssignment()
         Stores an assignment of the problem variables. That may be an initial
         feasible solution, just a partial assignment or the optimal solution.
         
        optional .operations_research.sat.BooleanAssignment assignment = 7;
        Specified by:
        getAssignment in interface LinearBooleanProblemOrBuilder
        Returns:
        The assignment.
      • setAssignment

        public LinearBooleanProblem.Builder setAssignment​(BooleanAssignment value)
         Stores an assignment of the problem variables. That may be an initial
         feasible solution, just a partial assignment or the optimal solution.
         
        optional .operations_research.sat.BooleanAssignment assignment = 7;
      • setAssignment

        public LinearBooleanProblem.Builder setAssignment​(BooleanAssignment.Builder builderForValue)
         Stores an assignment of the problem variables. That may be an initial
         feasible solution, just a partial assignment or the optimal solution.
         
        optional .operations_research.sat.BooleanAssignment assignment = 7;
      • mergeAssignment

        public LinearBooleanProblem.Builder mergeAssignment​(BooleanAssignment value)
         Stores an assignment of the problem variables. That may be an initial
         feasible solution, just a partial assignment or the optimal solution.
         
        optional .operations_research.sat.BooleanAssignment assignment = 7;
      • clearAssignment

        public LinearBooleanProblem.Builder clearAssignment()
         Stores an assignment of the problem variables. That may be an initial
         feasible solution, just a partial assignment or the optimal solution.
         
        optional .operations_research.sat.BooleanAssignment assignment = 7;
      • getAssignmentBuilder

        public BooleanAssignment.Builder getAssignmentBuilder()
         Stores an assignment of the problem variables. That may be an initial
         feasible solution, just a partial assignment or the optimal solution.
         
        optional .operations_research.sat.BooleanAssignment assignment = 7;
      • hasOriginalNumVariables

        public boolean hasOriginalNumVariables()
         Hack: When converting a wcnf formulat to a LinearBooleanProblem, extra
         variables need to be created. This stores the number of variables in the
         original problem (which are in one to one correspondence with the first
         variables of this problem).
         
        optional int32 original_num_variables = 8;
        Specified by:
        hasOriginalNumVariables in interface LinearBooleanProblemOrBuilder
        Returns:
        Whether the originalNumVariables field is set.
      • getOriginalNumVariables

        public int getOriginalNumVariables()
         Hack: When converting a wcnf formulat to a LinearBooleanProblem, extra
         variables need to be created. This stores the number of variables in the
         original problem (which are in one to one correspondence with the first
         variables of this problem).
         
        optional int32 original_num_variables = 8;
        Specified by:
        getOriginalNumVariables in interface LinearBooleanProblemOrBuilder
        Returns:
        The originalNumVariables.
      • setOriginalNumVariables

        public LinearBooleanProblem.Builder setOriginalNumVariables​(int value)
         Hack: When converting a wcnf formulat to a LinearBooleanProblem, extra
         variables need to be created. This stores the number of variables in the
         original problem (which are in one to one correspondence with the first
         variables of this problem).
         
        optional int32 original_num_variables = 8;
        Parameters:
        value - The originalNumVariables to set.
        Returns:
        This builder for chaining.
      • clearOriginalNumVariables

        public LinearBooleanProblem.Builder clearOriginalNumVariables()
         Hack: When converting a wcnf formulat to a LinearBooleanProblem, extra
         variables need to be created. This stores the number of variables in the
         original problem (which are in one to one correspondence with the first
         variables of this problem).
         
        optional int32 original_num_variables = 8;
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final LinearBooleanProblem.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanProblem.Builder>
      • mergeUnknownFields

        public final LinearBooleanProblem.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanProblem.Builder>