Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ComplexityParser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Emmanuel Hainry
ComplexityParser
Commits
65476545
Commit
65476545
authored
5 years ago
by
PECHOUX Romain
Browse files
Options
Downloads
Patches
Plain Diff
TierArray.java reformat
parent
d8e87c3a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/lib/TierArray.java
+8
-18
8 additions, 18 deletions
src/main/java/lib/TierArray.java
with
8 additions
and
18 deletions
src/main/java/lib/TierArray.java
+
8
−
18
View file @
65476545
...
...
@@ -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 tier
s.
*/
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
;
}
}
/**
*
s
ets the value at index i (no checks are done on the index)
* @param i
* @param v
*
S
ets 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 {
}
/**
*
increment
s the
'
bit
field' by 1
*
Compute
s the bit
wise 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
();
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment