Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zmt-core
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
ecomod
zmt-core
Commits
fc9006b1
Commit
fc9006b1
authored
8 years ago
by
Christian Meyer
Browse files
Options
Downloads
Patches
Plain Diff
CategoryCollector.java: separator can only be changed in subclasses
parent
aeda4e2b
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
src/main/java/de/zmt/output/CategoryCollector.java
+16
-16
16 additions, 16 deletions
src/main/java/de/zmt/output/CategoryCollector.java
with
16 additions
and
16 deletions
src/main/java/de/zmt/output/CategoryCollector.java
+
16
−
16
View file @
fc9006b1
...
...
@@ -35,15 +35,15 @@ public abstract class CategoryCollector<K, V extends Collectable<U>, U>
@SuppressWarnings
(
"unused"
)
private
static
final
Logger
logger
=
Logger
.
getLogger
(
CategoryCollector
.
class
.
getName
());
private
static
final
long
serialVersionUID
=
1L
;
/**
* Separator in headers between category prefix and collectable's header.
*/
private
static
final
String
SEPARATOR
=
"$"
;
private
final
Map
<
K
,
V
>
collectablePerCategory
;
/** Accumulated size of all collectables. */
private
final
int
totalSize
;
/**
* Separator in headers between category prefix and collectable's header.
*/
private
String
separator
=
"$"
;
private
Collectable
<
U
>
mergingCollectable
=
new
MergingCollectable
();
private
final
Collectable
<
U
>
mergingCollectable
=
new
MergingCollectable
();
/**
* Constructs a new {@code DefinitionSeparatedCollector}. Each given
...
...
@@ -92,6 +92,16 @@ public abstract class CategoryCollector<K, V extends Collectable<U>, U>
return
category
.
toString
();
}
/**
* Separator in headers between category prefix and collectable's header.
* The default is '$'. Subclasses can provide a different one.
*
* @return the separator
*/
protected
String
getSeparator
()
{
return
SEPARATOR
;
}
/**
*
* @param category
...
...
@@ -100,16 +110,6 @@ public abstract class CategoryCollector<K, V extends Collectable<U>, U>
*/
protected
abstract
V
createCollectable
(
K
category
);
/**
* Sets the separator string in headers between category prefix and
* collectable's header.
*
* @param separator
*/
public
void
setSeparator
(
String
separator
)
{
this
.
separator
=
separator
;
}
@Override
public
void
beforeCollect
(
BeforeMessage
message
)
{
}
...
...
@@ -153,7 +153,7 @@ public abstract class CategoryCollector<K, V extends Collectable<U>, U>
Collection
<
String
>
headers
=
new
ArrayList
<>(
totalSize
);
for
(
K
key
:
collectablePerCategory
.
keySet
())
{
for
(
String
header
:
collectablePerCategory
.
get
(
key
).
obtainHeaders
())
{
headers
.
add
(
createCategoryHeaderPrefix
(
key
)
+
s
eparator
+
header
);
headers
.
add
(
createCategoryHeaderPrefix
(
key
)
+
getS
eparator
()
+
header
);
}
}
...
...
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