15 using System.Collections;
17 public class UtilInt64Vector : global::System.IDisposable, global::System.Collections.IEnumerable
18 , global::System.Collections.Generic.IList<long>
20 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
25 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
this, cPtr);
28 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(
UtilInt64Vector obj) {
29 return (obj ==
null) ?
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero) : obj.swigCPtr;
38 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
43 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero);
45 global::System.GC.SuppressFinalize(
this);
51 throw new global::System.ArgumentNullException(
"c");
52 foreach (
long element
in c) {
69 public long this[
int index] {
71 return getitem(index);
74 setitem(index, value);
80 return (
int)capacity();
84 throw new global::System.ArgumentOutOfRangeException(
"Capacity");
106 public void CopyTo(
long[] array,
int arrayIndex)
111 public void CopyTo(
int index,
long[] array,
int arrayIndex,
int count)
114 throw new global::System.ArgumentNullException(
"array");
116 throw new global::System.ArgumentOutOfRangeException(
"index",
"Value is less than zero");
118 throw new global::System.ArgumentOutOfRangeException(
"arrayIndex",
"Value is less than zero");
120 throw new global::System.ArgumentOutOfRangeException(
"count",
"Value is less than zero");
122 throw new global::System.ArgumentException(
"Multi dimensional array.",
"array");
123 if (index+count > this.
Count || arrayIndex+count > array.Length)
124 throw new global::System.ArgumentException(
"Number of elements to copy is too large.");
125 for (
int i=0; i<count; i++)
126 array.SetValue(getitemcopy(index+i), arrayIndex+i);
129 global::System.Collections.Generic.IEnumerator<
long> global::System.Collections.Generic.IEnumerable<
long>.GetEnumerator() {
130 return new UtilInt64VectorEnumerator(
this);
133 global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
134 return new UtilInt64VectorEnumerator(
this);
147 , global::System.Collections.Generic.IEnumerator<long>
150 private int currentIndex;
151 private object currentObject;
152 private int currentSize;
155 collectionRef = collection;
157 currentObject =
null;
158 currentSize = collectionRef.
Count;
164 if (currentIndex == -1)
165 throw new global::System.InvalidOperationException(
"Enumeration not started.");
166 if (currentIndex > currentSize - 1)
167 throw new global::System.InvalidOperationException(
"Enumeration finished.");
168 if (currentObject ==
null)
169 throw new global::System.InvalidOperationException(
"Collection modified.");
170 return (
long)currentObject;
175 object global::System.Collections.IEnumerator.Current {
182 int size = collectionRef.Count;
183 bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
186 currentObject = collectionRef[currentIndex];
188 currentObject =
null;
195 currentObject =
null;
196 if (collectionRef.Count != currentSize) {
197 throw new global::System.InvalidOperationException(
"Collection modified.");
203 currentObject =
null;
215 private uint size() {
220 private uint capacity() {
221 uint ret = operations_research_utilPINVOKE.UtilInt64Vector_capacity(swigCPtr);
225 private void reserve(uint n) {
226 operations_research_utilPINVOKE.UtilInt64Vector_reserve(swigCPtr, n);
240 private long getitemcopy(
int index) {
246 private long getitem(
int index) {
247 long ret = operations_research_utilPINVOKE.UtilInt64Vector_getitem(swigCPtr, index);
248 if (operations_research_utilPINVOKE.SWIGPendingException.Pending)
throw operations_research_utilPINVOKE.SWIGPendingException.Retrieve();
252 private void setitem(
int index,
long val) {
253 operations_research_utilPINVOKE.UtilInt64Vector_setitem(swigCPtr, index, val);
254 if (operations_research_utilPINVOKE.SWIGPendingException.Pending)
throw operations_research_utilPINVOKE.SWIGPendingException.Retrieve();