Java Reference

Java Reference

CpSolverStatus.java
Go to the documentation of this file.
1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: ortools/sat/cp_model.proto
3 
4 package com.google.ortools.sat;
5 
13 public enum CpSolverStatus
14  implements com.google.protobuf.ProtocolMessageEnum {
23  UNKNOWN(0),
64  OPTIMAL(4),
66  ;
67 
76  public static final int UNKNOWN_VALUE = 0;
85  public static final int MODEL_INVALID_VALUE = 1;
95  public static final int FEASIBLE_VALUE = 2;
103  public static final int INFEASIBLE_VALUE = 3;
117  public static final int OPTIMAL_VALUE = 4;
118 
119 
120  public final int getNumber() {
121  if (this == UNRECOGNIZED) {
122  throw new java.lang.IllegalArgumentException(
123  "Can't get the number of an unknown enum value.");
124  }
125  return value;
126  }
127 
133  @java.lang.Deprecated
134  public static CpSolverStatus valueOf(int value) {
135  return forNumber(value);
136  }
137 
142  public static CpSolverStatus forNumber(int value) {
143  switch (value) {
144  case 0: return UNKNOWN;
145  case 1: return MODEL_INVALID;
146  case 2: return FEASIBLE;
147  case 3: return INFEASIBLE;
148  case 4: return OPTIMAL;
149  default: return null;
150  }
151  }
152 
153  public static com.google.protobuf.Internal.EnumLiteMap<CpSolverStatus>
155  return internalValueMap;
156  }
157  private static final com.google.protobuf.Internal.EnumLiteMap<
158  CpSolverStatus> internalValueMap =
159  new com.google.protobuf.Internal.EnumLiteMap<CpSolverStatus>() {
160  public CpSolverStatus findValueByNumber(int number) {
161  return CpSolverStatus.forNumber(number);
162  }
163  };
164 
165  public final com.google.protobuf.Descriptors.EnumValueDescriptor
167  if (this == UNRECOGNIZED) {
168  throw new java.lang.IllegalStateException(
169  "Can't get the descriptor of an unrecognized enum value.");
170  }
171  return getDescriptor().getValues().get(ordinal());
172  }
173  public final com.google.protobuf.Descriptors.EnumDescriptor
175  return getDescriptor();
176  }
177  public static final com.google.protobuf.Descriptors.EnumDescriptor
179  return com.google.ortools.sat.CpModelProtobuf.getDescriptor().getEnumTypes().get(0);
180  }
181 
182  private static final CpSolverStatus[] VALUES = values();
183 
184  public static CpSolverStatus valueOf(
185  com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
186  if (desc.getType() != getDescriptor()) {
187  throw new java.lang.IllegalArgumentException(
188  "EnumValueDescriptor is not for this type.");
189  }
190  if (desc.getIndex() == -1) {
191  return UNRECOGNIZED;
192  }
193  return VALUES[desc.getIndex()];
194  }
195 
196  private final int value;
197 
198  private CpSolverStatus(int value) {
199  this.value = value;
200  }
201 
202  // @@protoc_insertion_point(enum_scope:operations_research.sat.CpSolverStatus)
203 }
204 
final int getNumber()
static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor()
static CpSolverStatus forNumber(int value)
UNRECOGNIZED
OPTIMAL
FEASIBLE
static com.google.protobuf.Descriptors.FileDescriptor getDescriptor()
static com.google.protobuf.Internal.EnumLiteMap< CpSolverStatus > internalGetValueMap()
final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()
MODEL_INVALID
INFEASIBLE
UNKNOWN
final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()
static CpSolverStatus valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)
.lang.Deprecated static CpSolverStatus valueOf(int value)