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),
59  OPTIMAL(4),
61  ;
62 
71  public static final int UNKNOWN_VALUE = 0;
80  public static final int MODEL_INVALID_VALUE = 1;
89  public static final int FEASIBLE_VALUE = 2;
97  public static final int INFEASIBLE_VALUE = 3;
107  public static final int OPTIMAL_VALUE = 4;
108 
109 
110  public final int getNumber() {
111  if (this == UNRECOGNIZED) {
112  throw new java.lang.IllegalArgumentException(
113  "Can't get the number of an unknown enum value.");
114  }
115  return value;
116  }
117 
123  @java.lang.Deprecated
124  public static CpSolverStatus valueOf(int value) {
125  return forNumber(value);
126  }
127 
132  public static CpSolverStatus forNumber(int value) {
133  switch (value) {
134  case 0: return UNKNOWN;
135  case 1: return MODEL_INVALID;
136  case 2: return FEASIBLE;
137  case 3: return INFEASIBLE;
138  case 4: return OPTIMAL;
139  default: return null;
140  }
141  }
142 
143  public static com.google.protobuf.Internal.EnumLiteMap<CpSolverStatus>
145  return internalValueMap;
146  }
147  private static final com.google.protobuf.Internal.EnumLiteMap<
148  CpSolverStatus> internalValueMap =
149  new com.google.protobuf.Internal.EnumLiteMap<CpSolverStatus>() {
150  public CpSolverStatus findValueByNumber(int number) {
151  return CpSolverStatus.forNumber(number);
152  }
153  };
154 
155  public final com.google.protobuf.Descriptors.EnumValueDescriptor
157  return getDescriptor().getValues().get(ordinal());
158  }
159  public final com.google.protobuf.Descriptors.EnumDescriptor
161  return getDescriptor();
162  }
163  public static final com.google.protobuf.Descriptors.EnumDescriptor
165  return com.google.ortools.sat.CpModelProtobuf.getDescriptor().getEnumTypes().get(0);
166  }
167 
168  private static final CpSolverStatus[] VALUES = values();
169 
170  public static CpSolverStatus valueOf(
171  com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
172  if (desc.getType() != getDescriptor()) {
173  throw new java.lang.IllegalArgumentException(
174  "EnumValueDescriptor is not for this type.");
175  }
176  if (desc.getIndex() == -1) {
177  return UNRECOGNIZED;
178  }
179  return VALUES[desc.getIndex()];
180  }
181 
182  private final int value;
183 
184  private CpSolverStatus(int value) {
185  this.value = value;
186  }
187 
188  // @@protoc_insertion_point(enum_scope:operations_research.sat.CpSolverStatus)
189 }
190 
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)