Class LinearConstraintProto.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<LinearConstraintProto.Builder>
com.google.protobuf.GeneratedMessage.Builder<LinearConstraintProto.Builder>
com.google.ortools.sat.LinearConstraintProto.Builder
All Implemented Interfaces:
LinearConstraintProtoOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
LinearConstraintProto

public static final class LinearConstraintProto.Builder extends com.google.protobuf.GeneratedMessage.Builder<LinearConstraintProto.Builder> implements LinearConstraintProtoOrBuilder
 The linear sum vars[i] * coeffs[i] must fall in the given domain. The domain
 has the same format as the one in IntegerVariableProto.

 Note that the validation code currently checks using the domain of the
 involved variables that the sum can always be computed without integer
 overflow and throws an error otherwise.
 
Protobuf type operations_research.sat.LinearConstraintProto
  • Method Details

    • getDescriptor

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

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<LinearConstraintProto.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.GeneratedMessage.Builder<LinearConstraintProto.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.GeneratedMessage.Builder<LinearConstraintProto.Builder>
    • getDefaultInstanceForType

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

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

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

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

    • isInitialized

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

      public LinearConstraintProto.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws 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<LinearConstraintProto.Builder>
      Throws:
      IOException
    • getVarsList

      public List<Integer> getVarsList()
      repeated int32 vars = 1;
      Specified by:
      getVarsList in interface LinearConstraintProtoOrBuilder
      Returns:
      A list containing the vars.
    • getVarsCount

      public int getVarsCount()
      repeated int32 vars = 1;
      Specified by:
      getVarsCount in interface LinearConstraintProtoOrBuilder
      Returns:
      The count of vars.
    • getVars

      public int getVars(int index)
      repeated int32 vars = 1;
      Specified by:
      getVars in interface LinearConstraintProtoOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The vars at the given index.
    • setVars

      public LinearConstraintProto.Builder setVars(int index, int value)
      repeated int32 vars = 1;
      Parameters:
      index - The index to set the value at.
      value - The vars to set.
      Returns:
      This builder for chaining.
    • addVars

      public LinearConstraintProto.Builder addVars(int value)
      repeated int32 vars = 1;
      Parameters:
      value - The vars to add.
      Returns:
      This builder for chaining.
    • addAllVars

      public LinearConstraintProto.Builder addAllVars(Iterable<? extends Integer> values)
      repeated int32 vars = 1;
      Parameters:
      values - The vars to add.
      Returns:
      This builder for chaining.
    • clearVars

      public LinearConstraintProto.Builder clearVars()
      repeated int32 vars = 1;
      Returns:
      This builder for chaining.
    • getCoeffsList

      public List<Long> getCoeffsList()
       Same size as vars.
       
      repeated int64 coeffs = 2;
      Specified by:
      getCoeffsList in interface LinearConstraintProtoOrBuilder
      Returns:
      A list containing the coeffs.
    • getCoeffsCount

      public int getCoeffsCount()
       Same size as vars.
       
      repeated int64 coeffs = 2;
      Specified by:
      getCoeffsCount in interface LinearConstraintProtoOrBuilder
      Returns:
      The count of coeffs.
    • getCoeffs

      public long getCoeffs(int index)
       Same size as vars.
       
      repeated int64 coeffs = 2;
      Specified by:
      getCoeffs in interface LinearConstraintProtoOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The coeffs at the given index.
    • setCoeffs

      public LinearConstraintProto.Builder setCoeffs(int index, long value)
       Same size as vars.
       
      repeated int64 coeffs = 2;
      Parameters:
      index - The index to set the value at.
      value - The coeffs to set.
      Returns:
      This builder for chaining.
    • addCoeffs

      public LinearConstraintProto.Builder addCoeffs(long value)
       Same size as vars.
       
      repeated int64 coeffs = 2;
      Parameters:
      value - The coeffs to add.
      Returns:
      This builder for chaining.
    • addAllCoeffs

      public LinearConstraintProto.Builder addAllCoeffs(Iterable<? extends Long> values)
       Same size as vars.
       
      repeated int64 coeffs = 2;
      Parameters:
      values - The coeffs to add.
      Returns:
      This builder for chaining.
    • clearCoeffs

      public LinearConstraintProto.Builder clearCoeffs()
       Same size as vars.
       
      repeated int64 coeffs = 2;
      Returns:
      This builder for chaining.
    • getDomainList

      public List<Long> getDomainList()
      repeated int64 domain = 3;
      Specified by:
      getDomainList in interface LinearConstraintProtoOrBuilder
      Returns:
      A list containing the domain.
    • getDomainCount

      public int getDomainCount()
      repeated int64 domain = 3;
      Specified by:
      getDomainCount in interface LinearConstraintProtoOrBuilder
      Returns:
      The count of domain.
    • getDomain

      public long getDomain(int index)
      repeated int64 domain = 3;
      Specified by:
      getDomain in interface LinearConstraintProtoOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The domain at the given index.
    • setDomain

      public LinearConstraintProto.Builder setDomain(int index, long value)
      repeated int64 domain = 3;
      Parameters:
      index - The index to set the value at.
      value - The domain to set.
      Returns:
      This builder for chaining.
    • addDomain

      public LinearConstraintProto.Builder addDomain(long value)
      repeated int64 domain = 3;
      Parameters:
      value - The domain to add.
      Returns:
      This builder for chaining.
    • addAllDomain

      public LinearConstraintProto.Builder addAllDomain(Iterable<? extends Long> values)
      repeated int64 domain = 3;
      Parameters:
      values - The domain to add.
      Returns:
      This builder for chaining.
    • clearDomain

      public LinearConstraintProto.Builder clearDomain()
      repeated int64 domain = 3;
      Returns:
      This builder for chaining.