Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 65476545 authored by PECHOUX Romain's avatar PECHOUX Romain
Browse files

TierArray.java reformat

parent d8e87c3a
Branches
Tags
No related merge requests found
......@@ -17,27 +17,25 @@ limitations under the License.
package lib;
import complexityparser.Tier;
import java.util.Arrays;
/**
* a simple array containing tier types to simplify it's incrementation
* A simple array containing tiers.
*/
public class TierArray {
private Tier[] array;
public TierArray(int size) {
array = new Tier[size];
for(int i = 0; i < size; i++) {
array[i] = Tier.T0;
}
}
/**
* sets the value at index i (no checks are done on the index)
* @param i
* @param v
* Sets the value at index i to tier v in the array (no checks are done on the index).
* @param i - an index.
* @param v - a tier.
*/
public void set(int i, Tier v) {
array[i] = v;
......@@ -45,8 +43,8 @@ public class TierArray {
/**
*
* @param i
* @return the value at index i (no checks are done on the index)
* @param i - an index.
* @return the value at index i (no checks are done on the index).
*/
public Tier get(int i) {
return array[i];
......@@ -54,7 +52,7 @@ public class TierArray {
/**
*
* @return a deep copy of the contained array
* @return a deep copy of the array.
*/
public Tier[] getArray() {
return array.clone();
......@@ -69,7 +67,7 @@ public class TierArray {
}
/**
* increments the 'bitfield' by 1
* Computes the bitwise negation.
*/
public void increment() {
for(int i = 0; i < size(); i++) {
......@@ -90,12 +88,4 @@ public class TierArray {
public String toString() {
return Arrays.toString(array);
}
public static void main(String[] args) {
TierArray tmp = new TierArray(3);
for(int i = 0; i < 9; i++) {
System.out.println(i + " ; " + tmp);
tmp.increment();
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment