Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
89f0fbd2
Commit
89f0fbd2
authored
5 months ago
by
Riegel
Browse files
Options
Download
Email Patches
Plain Diff
Make LibraryObject and RelativeGeometry thread-safe
parent
84797654
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/LibraryObject.java
+3
-2
...ft/stuttgart/citydoctor2/datastructure/LibraryObject.java
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/RelativeGeometry.java
+3
-2
...stuttgart/citydoctor2/datastructure/RelativeGeometry.java
with
6 additions
and
4 deletions
+6
-4
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/LibraryObject.java
+
3
-
2
View file @
89f0fbd2
...
...
@@ -9,8 +9,9 @@ import org.apache.logging.log4j.Logger;
import
java.io.Serial
;
import
java.nio.file.Path
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
/**
* Reference object for handling of implicit geometries with a library object contained in an external file
...
...
@@ -24,7 +25,7 @@ public class LibraryObject extends Geometry {
private
static
final
long
serialVersionUID
=
-
50293435187454911L
;
private
final
String
filepath
;
private
final
ParserConfiguration
config
;
private
static
Hash
Map
<
String
,
LibraryObject
>
libraryObjects
=
new
HashMap
<>();
private
static
Map
<
String
,
LibraryObject
>
libraryObjects
=
new
Concurrent
HashMap
<>();
public
static
LibraryObject
of
(
Path
path
,
ParserConfiguration
config
)
{
if
(
libraryObjects
.
containsKey
(
path
.
toString
()))
{
...
...
This diff is collapsed.
Click to expand it.
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/RelativeGeometry.java
+
3
-
2
View file @
89f0fbd2
...
...
@@ -5,7 +5,8 @@ import org.apache.logging.log4j.LogManager;
import
org.apache.logging.log4j.Logger
;
import
java.io.Serial
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
/**
* Reference object for handling of implicit geometries with a relative geometry
...
...
@@ -18,7 +19,7 @@ public class RelativeGeometry extends Geometry {
@Serial
private
static
final
long
serialVersionUID
=
-
686112245455298977L
;
private
static
Hash
Map
<
Geometry
,
RelativeGeometry
>
relativeGeometries
=
new
HashMap
<>();
private
static
Map
<
Geometry
,
RelativeGeometry
>
relativeGeometries
=
new
Concurrent
HashMap
<>();
public
static
RelativeGeometry
of
(
Geometry
geom
)
{
if
(
relativeGeometries
.
containsKey
(
geom
))
{
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets