Commit 846d229e authored by Daniel Le Berre's avatar Daniel Le Berre

Fix javadoc and VecInt.remove(Integer) implementation.

parent 0dc06988
Pipeline #853 failed with stages
in 18 minutes and 33 seconds
......@@ -244,8 +244,7 @@ public final class Vec<T> implements IVec<T> {
}
/**
* Remove an element that belongs to the Vector. The method will break if
* the element does not belong to the vector.
* Remove an element that belongs to the Vector.
*
* @param elem
* an element from the vector.
......
......@@ -289,7 +289,7 @@ public final class VecInt implements IVecInt {
}
/**
* Insert an element at the very begining of the vector. The former first
* Insert an element at the very beginning of the vector. The former first
* element is appended to the end of the vector in order to have a constant
* time operation.
*
......@@ -306,16 +306,18 @@ public final class VecInt implements IVecInt {
}
/**
* Enleve un element qui se trouve dans le vecteur!!!
* Remove an element that belongs to the Vector. The method will break if
* the element does not belong to the vector.
*
* @param elem
* un element du vecteur
* an element from that VecInt
*/
public void remove(int elem) {
// assert size() > 0;
int j = 0;
for (; this.myarray[j] != elem; j++) {
assert j < size();
if (j == size())
throw new NoSuchElementException();
}
System.arraycopy(this.myarray, j + 1, this.myarray, j, size() - j - 1);
pop();
......
......@@ -31,6 +31,7 @@ package org.sat4j.specs;
import java.io.Serializable;
import java.util.Comparator;
import java.util.NoSuchElementException;
/**
* An abstraction for the vector of int used on the library.
......@@ -186,10 +187,12 @@ public interface IVecInt extends Serializable, Cloneable {
void insertFirst(final int elem);
/**
* Enleve un element qui se trouve dans le vecteur!!!
* Remove an element from the vector.
*
* @param elem
* un element du vecteur
* an element of the vector
* @throws NoSuchElementException
* if elem is not found in the vector.
*/
void remove(int elem);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment