Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
RoutingIndexManager.java
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (https://www.swig.org).
3 * Version 4.4.0
4 *
5 * Do not make changes to this file unless you know what you are doing - modify
6 * the SWIG interface file instead.
7 * ----------------------------------------------------------------------------- */
8
9package com.google.ortools.constraintsolver;
10
36public class RoutingIndexManager {
37 private transient long swigCPtr;
38 protected transient boolean swigCMemOwn;
39
40 public RoutingIndexManager(long cPtr, boolean cMemoryOwn) {
41 swigCMemOwn = cMemoryOwn;
42 swigCPtr = cPtr;
43 }
44
45 public static long getCPtr(RoutingIndexManager obj) {
46 return (obj == null) ? 0 : obj.swigCPtr;
47 }
48
49 public static long swigRelease(RoutingIndexManager obj) {
50 long ptr = 0;
51 if (obj != null) {
52 if (!obj.swigCMemOwn)
53 throw new RuntimeException("Cannot release ownership as memory is not owned");
54 ptr = obj.swigCPtr;
55 obj.swigCMemOwn = false;
56 obj.delete();
57 }
58 return ptr;
59 }
60
61 @SuppressWarnings({"deprecation", "removal"})
62 protected void finalize() {
63 delete();
64 }
65
66 public synchronized void delete() {
67 if (swigCPtr != 0) {
68 if (swigCMemOwn) {
69 swigCMemOwn = false;
70 mainJNI.delete_RoutingIndexManager(swigCPtr);
71 }
72 swigCPtr = 0;
73 }
74 }
75
86 public RoutingIndexManager(int num_nodes, int num_vehicles, int depot) {
87 this(mainJNI.new_RoutingIndexManager__SWIG_0(num_nodes, num_vehicles, depot), true);
88 }
89
99 public RoutingIndexManager(int num_nodes, int num_vehicles, int[] starts, int[] ends) {
100 this(mainJNI.new_RoutingIndexManager__SWIG_1(num_nodes, num_vehicles, starts, ends), true);
101 }
102
103 public int getNumberOfNodes() {
104 return mainJNI.RoutingIndexManager_getNumberOfNodes(swigCPtr, this);
105 }
106
107 public int getNumberOfVehicles() {
108 return mainJNI.RoutingIndexManager_getNumberOfVehicles(swigCPtr, this);
109 }
110
111 public int getNumberOfIndices() {
112 return mainJNI.RoutingIndexManager_getNumberOfIndices(swigCPtr, this);
113 }
114
115 public long getStartIndex(int vehicle) {
116 return mainJNI.RoutingIndexManager_getStartIndex(swigCPtr, this, vehicle);
117 }
118
119 public long getEndIndex(int vehicle) {
120 return mainJNI.RoutingIndexManager_getEndIndex(swigCPtr, this, vehicle);
121 }
122
123 public long nodeToIndex(int node) {
124 return mainJNI.RoutingIndexManager_nodeToIndex(swigCPtr, this, node);
125 }
126
127 public long[] nodesToIndices(int[] nodes) {
128 return mainJNI.RoutingIndexManager_nodesToIndices(swigCPtr, this, nodes);
129}
130
131 public int indexToNode(long index) {
132 return mainJNI.RoutingIndexManager_indexToNode(swigCPtr, this, index);
133}
134
135}
RoutingIndexManager(int num_nodes, int num_vehicles, int depot)
RoutingIndexManager(int num_nodes, int num_vehicles, int[] starts, int[] ends)