Class MPVariableProto.Builder

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

    public static final class MPVariableProto.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<MPVariableProto.Builder>
    implements MPVariableProtoOrBuilder
     A variable is always constrained in the form:
        lower_bound <= x <= upper_bound
     where lower_bound and upper_bound:
     - Can form a singleton: x = constant = lower_bound = upper_bound.
     - Can form a finite interval: lower_bound <= x <= upper_bound. (x is boxed.)
     - Can form a semi-infinite interval.
         - lower_bound = -infinity: x <= upper_bound.
         - upper_bound = +infinity: x >= lower_bound.
     - Can form the infinite interval: lower_bound = -infinity and
       upper_bound = +infinity, x is free.
     MPVariableProto furthermore stores:
      - The coefficient of the variable in the objective.
      - Whether the variable is integer.
     
    Protobuf type operations_research.MPVariableProto
    • 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<MPVariableProto.Builder>
      • clear

        public MPVariableProto.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<MPVariableProto.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<MPVariableProto.Builder>
      • getDefaultInstanceForType

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

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

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

        public MPVariableProto.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<MPVariableProto.Builder>
      • setField

        public MPVariableProto.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<MPVariableProto.Builder>
      • clearField

        public MPVariableProto.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<MPVariableProto.Builder>
      • clearOneof

        public MPVariableProto.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<MPVariableProto.Builder>
      • setRepeatedField

        public MPVariableProto.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<MPVariableProto.Builder>
      • addRepeatedField

        public MPVariableProto.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<MPVariableProto.Builder>
      • mergeFrom

        public MPVariableProto.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<MPVariableProto.Builder>
      • isInitialized

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

        public MPVariableProto.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<MPVariableProto.Builder>
        Throws:
        java.io.IOException
      • hasLowerBound

        public boolean hasLowerBound()
         lower_bound must be <= upper_bound.
         
        optional double lower_bound = 1 [default = -inf];
        Specified by:
        hasLowerBound in interface MPVariableProtoOrBuilder
        Returns:
        Whether the lowerBound field is set.
      • getLowerBound

        public double getLowerBound()
         lower_bound must be <= upper_bound.
         
        optional double lower_bound = 1 [default = -inf];
        Specified by:
        getLowerBound in interface MPVariableProtoOrBuilder
        Returns:
        The lowerBound.
      • setLowerBound

        public MPVariableProto.Builder setLowerBound​(double value)
         lower_bound must be <= upper_bound.
         
        optional double lower_bound = 1 [default = -inf];
        Parameters:
        value - The lowerBound to set.
        Returns:
        This builder for chaining.
      • clearLowerBound

        public MPVariableProto.Builder clearLowerBound()
         lower_bound must be <= upper_bound.
         
        optional double lower_bound = 1 [default = -inf];
        Returns:
        This builder for chaining.
      • hasUpperBound

        public boolean hasUpperBound()
        optional double upper_bound = 2 [default = inf];
        Specified by:
        hasUpperBound in interface MPVariableProtoOrBuilder
        Returns:
        Whether the upperBound field is set.
      • getUpperBound

        public double getUpperBound()
        optional double upper_bound = 2 [default = inf];
        Specified by:
        getUpperBound in interface MPVariableProtoOrBuilder
        Returns:
        The upperBound.
      • setUpperBound

        public MPVariableProto.Builder setUpperBound​(double value)
        optional double upper_bound = 2 [default = inf];
        Parameters:
        value - The upperBound to set.
        Returns:
        This builder for chaining.
      • clearUpperBound

        public MPVariableProto.Builder clearUpperBound()
        optional double upper_bound = 2 [default = inf];
        Returns:
        This builder for chaining.
      • hasObjectiveCoefficient

        public boolean hasObjectiveCoefficient()
         The coefficient of the variable in the objective. Must be finite.
         
        optional double objective_coefficient = 3 [default = 0];
        Specified by:
        hasObjectiveCoefficient in interface MPVariableProtoOrBuilder
        Returns:
        Whether the objectiveCoefficient field is set.
      • getObjectiveCoefficient

        public double getObjectiveCoefficient()
         The coefficient of the variable in the objective. Must be finite.
         
        optional double objective_coefficient = 3 [default = 0];
        Specified by:
        getObjectiveCoefficient in interface MPVariableProtoOrBuilder
        Returns:
        The objectiveCoefficient.
      • setObjectiveCoefficient

        public MPVariableProto.Builder setObjectiveCoefficient​(double value)
         The coefficient of the variable in the objective. Must be finite.
         
        optional double objective_coefficient = 3 [default = 0];
        Parameters:
        value - The objectiveCoefficient to set.
        Returns:
        This builder for chaining.
      • clearObjectiveCoefficient

        public MPVariableProto.Builder clearObjectiveCoefficient()
         The coefficient of the variable in the objective. Must be finite.
         
        optional double objective_coefficient = 3 [default = 0];
        Returns:
        This builder for chaining.
      • hasIsInteger

        public boolean hasIsInteger()
         True if the variable is constrained to be integer.
         Ignored if MPModelProto::solver_type is *LINEAR_PROGRAMMING*.
         
        optional bool is_integer = 4 [default = false];
        Specified by:
        hasIsInteger in interface MPVariableProtoOrBuilder
        Returns:
        Whether the isInteger field is set.
      • getIsInteger

        public boolean getIsInteger()
         True if the variable is constrained to be integer.
         Ignored if MPModelProto::solver_type is *LINEAR_PROGRAMMING*.
         
        optional bool is_integer = 4 [default = false];
        Specified by:
        getIsInteger in interface MPVariableProtoOrBuilder
        Returns:
        The isInteger.
      • setIsInteger

        public MPVariableProto.Builder setIsInteger​(boolean value)
         True if the variable is constrained to be integer.
         Ignored if MPModelProto::solver_type is *LINEAR_PROGRAMMING*.
         
        optional bool is_integer = 4 [default = false];
        Parameters:
        value - The isInteger to set.
        Returns:
        This builder for chaining.
      • clearIsInteger

        public MPVariableProto.Builder clearIsInteger()
         True if the variable is constrained to be integer.
         Ignored if MPModelProto::solver_type is *LINEAR_PROGRAMMING*.
         
        optional bool is_integer = 4 [default = false];
        Returns:
        This builder for chaining.
      • hasName

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

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

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

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

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

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

        public boolean hasBranchingPriority()
        optional int32 branching_priority = 6 [default = 0];
        Specified by:
        hasBranchingPriority in interface MPVariableProtoOrBuilder
        Returns:
        Whether the branchingPriority field is set.
      • setBranchingPriority

        public MPVariableProto.Builder setBranchingPriority​(int value)
        optional int32 branching_priority = 6 [default = 0];
        Parameters:
        value - The branchingPriority to set.
        Returns:
        This builder for chaining.
      • clearBranchingPriority

        public MPVariableProto.Builder clearBranchingPriority()
        optional int32 branching_priority = 6 [default = 0];
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final MPVariableProto.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<MPVariableProto.Builder>
      • mergeUnknownFields

        public final MPVariableProto.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<MPVariableProto.Builder>