View Javadoc

1   /**
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  package org.apache.hadoop.hbase.hbtop.terminal;
19  
20  public abstract class AbstractTerminalPrinter implements TerminalPrinter {
21  
22    @Override
23    public TerminalPrinter print(Object value) {
24      print(value.toString());
25      return this;
26    }
27  
28    @Override
29    public TerminalPrinter print(char value) {
30      print(Character.toString(value));
31      return this;
32    }
33  
34    @Override
35    public TerminalPrinter print(short value) {
36      print(Short.toString(value));
37      return this;
38    }
39  
40    @Override
41    public TerminalPrinter print(int value) {
42      print(Integer.toString(value));
43      return this;
44    }
45  
46    @Override
47    public TerminalPrinter print(long value) {
48      print(Long.toString(value));
49      return this;
50    }
51  
52    @Override
53    public TerminalPrinter print(float value) {
54      print(Float.toString(value));
55      return this;
56    }
57  
58    @Override
59    public TerminalPrinter print(double value) {
60      print(Double.toString(value));
61      return this;
62    }
63  
64    @Override
65    public TerminalPrinter printFormat(String format, Object... args) {
66      print(String.format(format, args));
67      return this;
68    }
69  }