Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Analyst WebApp
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Insights
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
fidentis
Analyst WebApp
Commits
9a374c6f
There was an error fetching the commit references. Please try again later.
Commit
9a374c6f
authored
3 years ago
by
Matej Kovár
Browse files
Options
Downloads
Patches
Plain Diff
merged primaryFace and secondaryFaces to just one attribute, models
parent
813aeb3e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Comparison/src/main/java/cz/fidentis/analyst/Project.java
+35
-24
35 additions, 24 deletions
Comparison/src/main/java/cz/fidentis/analyst/Project.java
with
35 additions
and
24 deletions
Comparison/src/main/java/cz/fidentis/analyst/Project.java
+
35
−
24
View file @
9a374c6f
...
...
@@ -13,14 +13,15 @@ import java.util.List;
*/
public
class
Project
{
private
HumanFace
primaryFace
;
private
List
<
HumanFace
>
secondaryFaces
=
new
ArrayList
<>();
//private HumanFace primaryFace;
private
List
<
HumanFace
>
models
=
new
ArrayList
<>();
/**
* Returns primary face
*
* @return HumanFace primary face
*/
public HumanFace getPrimaryFace() {
return primaryFace;
}
...
...
@@ -30,7 +31,7 @@ public class Project {
*
* @param primaryFace which will be new primary face
* @throws IllegalArgumentException when argument primaryFace is null
*/
public void setPrimaryFace(HumanFace primaryFace) {
if (primaryFace == null) {
throw new IllegalArgumentException("Primary face is null");
...
...
@@ -40,18 +41,19 @@ public class Project {
/**
* Removes primary face and sets primaryFace attribute to null
*/
public void removePrimaryFace() {
this.primaryFace = null;
}
}*/
/**
* Returns list of HumanFace secondary faces
*
* @return list of secondary faces
*/
public
List
<
HumanFace
>
get
Secondary
Faces
()
{
return
Collections
.
unmodifiableList
(
secondaryFace
s
);
public
List
<
HumanFace
>
getFaces
()
{
return
Collections
.
unmodifiableList
(
model
s
);
}
/**
...
...
@@ -61,60 +63,69 @@ public class Project {
* secondary faces
* @throws IllegalArgumentException if one of faces from argument is null
*/
public
void
set
Secondary
Faces
(
List
<
HumanFace
>
secondaryFaces
)
{
this
.
secondaryFace
s
.
clear
();
public
void
setFaces
(
List
<
HumanFace
>
secondaryFaces
)
{
this
.
model
s
.
clear
();
for
(
int
i
=
0
;
i
<
secondaryFaces
.
size
();
i
++)
{
if
(
secondaryFaces
.
get
(
i
)
==
null
)
{
throw
new
IllegalArgumentException
(
"One of faces is null"
);
}
}
this
.
secondaryFace
s
.
addAll
(
secondaryFaces
);
this
.
model
s
.
addAll
(
secondaryFaces
);
}
/**
* Adds new face to
secondaryFace
s
* Adds new face to
model
s
*
* @param face HumanFace which will be added to list of secondary faces
* @throws IllegalArgumentException when argument face is null
*/
public
void
add
Secondary
Face
(
HumanFace
face
)
{
public
void
addFace
(
HumanFace
face
)
{
if
(
face
==
null
)
{
throw
new
IllegalArgumentException
(
"Face is null"
);
}
this
.
secondaryFace
s
.
add
(
face
);
this
.
model
s
.
add
(
face
);
}
/**
* Removes HumanFace from
secondaryFace
s
* Removes HumanFace from
model
s
*
* @param face HumanFace which will be removed from
secondaryFace
s
* @param face HumanFace which will be removed from
model
s
* @throws IllegalArgumentException when argument face is null
*/
public
void
remove
Secondary
Face
(
HumanFace
face
)
{
public
void
removeFace
(
HumanFace
face
)
{
if
(
face
==
null
)
{
throw
new
IllegalArgumentException
(
"Face is null"
);
}
for
(
int
i
=
0
;
i
<
secondaryFace
s
.
size
();
i
++)
{
if
(
secondaryFace
s
.
get
(
i
).
equals
(
face
))
{
secondaryFace
s
.
remove
(
i
);
for
(
int
i
=
0
;
i
<
model
s
.
size
();
i
++)
{
if
(
model
s
.
get
(
i
).
equals
(
face
))
{
model
s
.
remove
(
i
);
}
}
}
/**
* Removes faces which are sent to this function by list of HumanFace
* from
secondaryFace
s
* from
model
s
*
* @param faces List of HumanFace faces which should be removed from
*
secondaryFace
s
*
model
s
*/
public
void
removeSelected
(
List
<
HumanFace
>
faces
)
{
for
(
int
i
=
0
;
i
<
faces
.
size
();
i
++)
{
this
.
removeSecondaryFace
(
faces
.
get
(
i
));
this
.
removeFace
(
faces
.
get
(
i
));
}
}
public
HumanFace
getFaceByName
(
String
name
)
{
for
(
HumanFace
face
:
models
)
{
if
(
face
.
getShortName
().
equals
(
name
))
{
return
face
;
}
}
return
null
;
}
/* TODO implement comparable and create comparators for filtering
secondaryFace
s */
model
s */
}
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