Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Devrim Gunyel
core
Commits
2eee9b94
Commit
2eee9b94
authored
Mar 11, 2019
by
Piotr Gawron
Browse files
function returns list instead of modifying parameter
parent
c2e88a2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
service/src/main/java/lcsb/mapviewer/services/utils/ColorSchemaReader.java
View file @
2eee9b94
...
@@ -152,8 +152,8 @@ public class ColorSchemaReader {
...
@@ -152,8 +152,8 @@ public class ColorSchemaReader {
String
[]
columns
=
line
.
split
(
"\t"
);
String
[]
columns
=
line
.
split
(
"\t"
);
Map
<
ColorSchemaColumn
,
Integer
>
schemaColumns
=
new
HashMap
<>();
Map
<
ColorSchemaColumn
,
Integer
>
schemaColumns
=
new
HashMap
<>();
List
<
Pair
<
MiriamType
,
Integer
>>
customIdentifiers
=
new
ArrayList
<>();
List
<
Pair
<
MiriamType
,
Integer
>>
customIdentifiers
=
parseColumns
(
columns
,
schemaColumns
,
parseColumns
(
columns
,
schemaColumns
,
customIdentifiers
,
ColorSchemaType
.
GENETIC_VARIANT
);
ColorSchemaType
.
GENETIC_VARIANT
);
Integer
colorColumn
=
schemaColumns
.
get
(
ColorSchemaColumn
.
COLOR
);
Integer
colorColumn
=
schemaColumns
.
get
(
ColorSchemaColumn
.
COLOR
);
Integer
contigColumn
=
schemaColumns
.
get
(
ColorSchemaColumn
.
CONTIG
);
Integer
contigColumn
=
schemaColumns
.
get
(
ColorSchemaColumn
.
CONTIG
);
if
(
contigColumn
==
null
)
{
if
(
contigColumn
==
null
)
{
...
@@ -481,8 +481,7 @@ public class ColorSchemaReader {
...
@@ -481,8 +481,7 @@ public class ColorSchemaReader {
String
[]
columns
=
line
.
split
(
"\t"
);
String
[]
columns
=
line
.
split
(
"\t"
);
Map
<
ColorSchemaColumn
,
Integer
>
schemaColumns
=
new
HashMap
<>();
Map
<
ColorSchemaColumn
,
Integer
>
schemaColumns
=
new
HashMap
<>();
List
<
Pair
<
MiriamType
,
Integer
>>
customIdentifiers
=
new
ArrayList
<>();
List
<
Pair
<
MiriamType
,
Integer
>>
customIdentifiers
=
parseColumns
(
columns
,
schemaColumns
,
ColorSchemaType
.
GENERIC
);
parseColumns
(
columns
,
schemaColumns
,
customIdentifiers
,
ColorSchemaType
.
GENERIC
);
Integer
valueColumn
=
schemaColumns
.
get
(
ColorSchemaColumn
.
VALUE
);
Integer
valueColumn
=
schemaColumns
.
get
(
ColorSchemaColumn
.
VALUE
);
Integer
colorColumn
=
schemaColumns
.
get
(
ColorSchemaColumn
.
COLOR
);
Integer
colorColumn
=
schemaColumns
.
get
(
ColorSchemaColumn
.
COLOR
);
...
@@ -680,8 +679,9 @@ public class ColorSchemaReader {
...
@@ -680,8 +679,9 @@ public class ColorSchemaReader {
* @throws InvalidColorSchemaException
* @throws InvalidColorSchemaException
* thrown when the list of column headers contain invalid value
* thrown when the list of column headers contain invalid value
*/
*/
public
void
parseColumns
(
String
[]
columns
,
Map
<
ColorSchemaColumn
,
Integer
>
schemaColumns
,
public
List
<
Pair
<
MiriamType
,
Integer
>>
parseColumns
(
String
[]
columns
,
Map
<
ColorSchemaColumn
,
Integer
>
schemaColumns
,
List
<
Pair
<
MiriamType
,
Integer
>>
customIdentifiers
,
ColorSchemaType
type
)
throws
InvalidColorSchemaException
{
ColorSchemaType
type
)
throws
InvalidColorSchemaException
{
List
<
Pair
<
MiriamType
,
Integer
>>
result
=
new
ArrayList
<>();
Map
<
String
,
MiriamType
>
acceptableIdentifiers
=
new
HashMap
<>();
Map
<
String
,
MiriamType
>
acceptableIdentifiers
=
new
HashMap
<>();
Map
<
String
,
MiriamType
>
deprecatedIdentifiers
=
new
HashMap
<>();
Map
<
String
,
MiriamType
>
deprecatedIdentifiers
=
new
HashMap
<>();
for
(
MiriamType
miriamType
:
MiriamType
.
values
())
{
for
(
MiriamType
miriamType
:
MiriamType
.
values
())
{
...
@@ -701,9 +701,9 @@ public class ColorSchemaReader {
...
@@ -701,9 +701,9 @@ public class ColorSchemaReader {
}
}
if
(!
found
)
{
if
(!
found
)
{
if
(
acceptableIdentifiers
.
keySet
().
contains
(
columns
[
i
].
toLowerCase
()))
{
if
(
acceptableIdentifiers
.
keySet
().
contains
(
columns
[
i
].
toLowerCase
()))
{
customIdentifiers
.
add
(
new
Pair
<>(
acceptableIdentifiers
.
get
(
columns
[
i
].
toLowerCase
()),
i
));
result
.
add
(
new
Pair
<>(
acceptableIdentifiers
.
get
(
columns
[
i
].
toLowerCase
()),
i
));
}
else
if
(
deprecatedIdentifiers
.
keySet
().
contains
(
columns
[
i
].
toLowerCase
()))
{
}
else
if
(
deprecatedIdentifiers
.
keySet
().
contains
(
columns
[
i
].
toLowerCase
()))
{
customIdentifiers
.
add
(
new
Pair
<>(
deprecatedIdentifiers
.
get
(
columns
[
i
].
toLowerCase
()),
i
));
result
.
add
(
new
Pair
<>(
deprecatedIdentifiers
.
get
(
columns
[
i
].
toLowerCase
()),
i
));
}
else
{
}
else
{
String
columnNames
=
""
;
String
columnNames
=
""
;
for
(
ColorSchemaColumn
schemaColumn
:
ColorSchemaColumn
.
values
())
{
for
(
ColorSchemaColumn
schemaColumn
:
ColorSchemaColumn
.
values
())
{
...
@@ -719,6 +719,7 @@ public class ColorSchemaReader {
...
@@ -719,6 +719,7 @@ public class ColorSchemaReader {
}
}
}
}
}
}
return
result
;
}
}
/**
/**
...
...
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