Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kieker-TeeTime-Stages
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeeTime
Kieker-TeeTime-Stages
Commits
d6531126
Commit
d6531126
authored
8 years ago
by
Sören Henning
Browse files
Options
Downloads
Patches
Plain Diff
added IndentWriter
parent
0216fcd8
No related branches found
No related tags found
1 merge request
!17
Get impletemented stages and Java 8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/kieker/analysis/util/IndentWriter.java
+61
-0
61 additions, 0 deletions
src/main/java/kieker/analysis/util/IndentWriter.java
with
61 additions
and
0 deletions
src/main/java/kieker/analysis/util/IndentWriter.java
0 → 100644
+
61
−
0
View file @
d6531126
package
kieker.analysis.util
;
import
java.io.IOException
;
import
java.io.Writer
;
public
class
IndentWriter
extends
Writer
{
private
final
Writer
writer
;
private
int
indented
=
0
;
private
char
indentChar
=
DEFAULT_INDENT_CHAR
;
private
int
indentLength
=
DEFAULT_INDENT_LENGTH
;
public
static
final
char
DEFAULT_INDENT_CHAR
=
'\t'
;
public
static
final
int
DEFAULT_INDENT_LENGTH
=
1
;
public
IndentWriter
(
final
Writer
writer
)
{
super
();
this
.
writer
=
writer
;
}
public
IndentWriter
(
final
Writer
writer
,
final
char
indentChar
,
final
int
indentLength
)
{
this
(
writer
);
this
.
indentChar
=
indentChar
;
this
.
indentLength
=
indentLength
;
}
public
void
indent
()
{
indented
++;
}
public
void
unindent
()
{
if
(
indented
>
0
)
{
indented
--;
}
}
public
void
writeln
(
final
String
str
)
throws
IOException
{
writer
.
write
(
getIndentChars
()
+
str
+
'\n'
);
}
private
String
getIndentChars
()
{
return
new
String
(
new
char
[
indentLength
]).
replace
(
'\0'
,
indentChar
);
}
@Override
public
void
write
(
final
char
[]
cbuf
,
final
int
off
,
final
int
len
)
throws
IOException
{
writer
.
write
(
cbuf
,
off
,
len
);
}
@Override
public
void
flush
()
throws
IOException
{
writer
.
flush
();
}
@Override
public
void
close
()
throws
IOException
{
writer
.
close
();
}
}
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