public class Spacer extends Object
Constructor and Description |
---|
Spacer()
Creates a Spacer with zero spaces.
|
Spacer(int n)
Creates a Spacer with a given number of spaces.
|
Modifier and Type | Method and Description |
---|---|
Spacer |
add(int n)
Increases the current number of spaces by
n . |
int |
get()
Returns the current number of spaces.
|
String |
padRight(String string)
Returns a string that is padded on the right with spaces to the current
length.
|
Spacer |
set(int n)
Sets the current number of spaces.
|
StringBuilder |
spaces(StringBuilder buf)
Appends current number of spaces to a
StringBuilder . |
Spacer |
subtract(int n)
Reduces the current number of spaces by
n . |
String |
toString()
Returns a string of the current number of spaces.
|
public Spacer()
public Spacer(int n)
public Spacer set(int n)
public int get()
public Spacer add(int n)
n
.public Spacer subtract(int n)
n
.public String toString()
public StringBuilder spaces(StringBuilder buf)
StringBuilder
.Copyright © 2012-2024 Apache Software Foundation. All Rights Reserved.