Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
e85cb91f
Commit
e85cb91f
authored
Jul 25, 2018
by
Stefan Schuhbaeck
Browse files
add new label method and remove static from nextVersion method
parent
6c604b86
Changes
1
Show whitespace changes
Inline
Side-by-side
VadereSimulator/src/org/vadere/simulator/entrypoints/Version.java
View file @
e85cb91f
...
...
@@ -23,6 +23,10 @@ public enum Version {
return
label
;
}
public
String
label
(
char
repalce
)
{
return
label
.
replace
(
' '
,
repalce
);
}
public
static
Version
fromString
(
String
versionStr
)
{
for
(
Version
v
:
values
())
{
if
(
v
.
label
.
equals
(
versionStr
))
...
...
@@ -41,8 +45,13 @@ public enum Version {
throw
new
IllegalArgumentException
(
"Value not in Version Enumeration "
+
curr
.
toString
());
}
public
static
Version
nextVersion
(
Version
curr
){
int
nextId
=
versionId
(
curr
)
==
(
values
().
length
-
1
)
?
versionId
(
curr
)
:
versionId
(
curr
)
+
1
;
public
Version
nextVersion
(){
int
nextId
=
versionId
(
this
)
==
(
values
().
length
-
1
)
?
versionId
(
this
)
:
versionId
(
this
)
+
1
;
return
values
()[
nextId
];
}
public
Version
previousVersion
(){
int
nextId
=
versionId
(
this
)
==
0
?
versionId
(
this
)
:
versionId
(
this
)
-
1
;
return
values
()[
nextId
];
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment