Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
eaae85d9
Commit
eaae85d9
authored
Nov 17, 2025
by
Luna Riegel
Browse files
Refactor: Delete useless class
parent
3ba87aec
Changes
1
Show whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/check/CheckerThreadsSynchronizer.java
deleted
100644 → 0
View file @
3ba87aec
package
de.hft.stuttgart.citydoctor2.check
;
import
de.hft.stuttgart.citydoctor2.datastructure.CityDoctorModel
;
import
de.hft.stuttgart.citydoctor2.datastructure.CityObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.GmlId
;
import
de.hft.stuttgart.citydoctor2.parser.ProgressListener
;
import
java.util.EmptyStackException
;
import
java.util.Stack
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.concurrent.locks.ReentrantLock
;
public
class
CheckerThreadsSynchronizer
{
private
AtomicInteger
checkedCount
=
new
AtomicInteger
(
0
);
private
final
float
featureCount
;
private
CityDoctorModel
model
;
private
ProgressListener
listener
;
private
ReentrantLock
lock
=
new
ReentrantLock
();
private
Stack
<
GmlId
>
ids
;
public
CheckerThreadsSynchronizer
(
CityDoctorModel
model
,
ProgressListener
listener
)
{
this
.
model
=
model
;
this
.
listener
=
listener
;
featureCount
=
model
.
getNumberOfFeatures
();
ids
=
new
Stack
<>();
ids
.
addAll
(
model
.
getFeatureIds
());
}
public
CityObject
getNext
()
{
// lock.lock();
// try {
if
(!
ids
.
isEmpty
()){
return
model
.
getCache
().
get
(
ids
.
pop
());
}
return
null
;
// } finally {
// lock.unlock();
// }
};
public
void
updateFeature
(
CityObject
feature
)
{
model
.
getCache
().
put
(
feature
);
}
public
boolean
hasNext
(){
// lock.lock();
try
{
ids
.
peek
();
return
true
;
}
catch
(
EmptyStackException
e
)
{
return
false
;
}
finally
{
// lock.unlock();
}
}
public
void
updateCheckedCount
(){
checkedCount
.
getAndIncrement
();
if
(
listener
!=
null
){
listener
.
updateProgress
(
checkedCount
.
get
()
/
featureCount
);
}
}
}
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment