Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Verification for Decision Model and Notation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Container Registry
Model registry
Monitor
Service Desk
Analyze
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
Jonas Blatt
Verification for Decision Model and Notation
Commits
598e8615
Commit
598e8615
authored
5 years ago
by
Jonas Blatt
Browse files
Options
Downloads
Patches
Plain Diff
BugFix Compare to of String boundary
parent
7242d996
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dmnverifierapi/src/main/java/de/unikoblenz/fgbks/base/utils/boundary/impl/StringBoundary.java
+23
-3
23 additions, 3 deletions
...oblenz/fgbks/base/utils/boundary/impl/StringBoundary.java
with
23 additions
and
3 deletions
dmnverifierapi/src/main/java/de/unikoblenz/fgbks/base/utils/boundary/impl/StringBoundary.java
+
23
−
3
View file @
598e8615
...
...
@@ -57,8 +57,13 @@ import org.apache.commons.lang3.Validate;
* StringBoundary#matchesNoneOfValues} returns true, which are not in the boundary. <br>
*
* <p>Only value "a": <br>
* {@code "a"} <br> Value "a" or value "b": <br> {@code "a","b"} <br> Not value "a" and not value
* "b": <br> {@code not("a","b")} <br> All values: <br> {@code (empty String)}
* {@code "a"} <br>
* Value "a" or value "b": <br>
* {@code "a","b"} <br>
* Not value "a" and not value "b": <br>
* {@code not("a","b")} <br>
* All values: <br>
* {@code (empty String)}
*/
public
class
StringBoundary
extends
AbstractBoundary
<
String
>
{
...
...
@@ -105,7 +110,21 @@ public class StringBoundary extends AbstractBoundary<String> {
@Override
public
int
compareTo
(
Boundary
o
)
{
return
o
.
getText
().
compareTo
(
o
.
getText
());
if
(!(
o
instanceof
StringBoundary
))
{
return
0
;
}
StringBoundary
otherStringB
=
(
StringBoundary
)
o
;
if
(
matchesAny
()
||
matchesNoneOfValues
())
{
if
(
otherStringB
.
matchesAny
()
||
otherStringB
.
matchesNoneOfValues
())
{
return
0
;
}
else
{
return
-
1
;
}
}
if
(
otherStringB
.
matchesAny
()
||
otherStringB
.
matchesNoneOfValues
())
{
return
1
;
}
return
this
.
getValues
()[
0
].
compareTo
(
otherStringB
.
getValues
()[
0
]);
}
/**
...
...
@@ -178,6 +197,7 @@ public class StringBoundary extends AbstractBoundary<String> {
}
private
void
calcHashes
()
{
Arrays
.
sort
(
values
);
valuesHashes
=
new
int
[
values
.
length
];
for
(
int
i
=
0
;
i
<
values
.
length
;
i
++)
{
values
[
i
]
=
values
[
i
].
replace
(
'"'
,
'\0'
).
trim
();
...
...
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