
com.bethecoder.table.AsciiTableInstance Maven / Gradle / Ivy
/**
* Copyright (C) 2011 K Venkata Sudhakar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.bethecoder.table;
import com.bethecoder.table.impl.SimpleTable;
import com.bethecoder.table.spec.AsciiTable;
import com.bethecoder.table.spec.IASCIITableAware;
/**
* The entry point to this framework which acts as a singleton.
*
* @author K Venkata Sudhakar ([email protected])
* @version 1.0
*
*/
public enum AsciiTableInstance implements AsciiTable {
instance;
private AsciiTable asciiTable = new SimpleTable();
public static AsciiTable get() {
return instance;
}
@Override
public String getTable(String[] header, String[][] data) {
return asciiTable.getTable(header, data);
}
@Override
public String getTable(String[] header, String[][] data, int dataAlign) {
return asciiTable.getTable(header, data, dataAlign);
}
@Override
public String getTable(String[] header, int headerAlign, String[][] data, int dataAlign) {
return asciiTable.getTable(header, headerAlign, data, dataAlign);
}
public void printTable(String[] header, String[][] data) {
asciiTable.printTable(header, data);
}
@Override
public void printTable(String[] header, String[][] data, int dataAlign) {
asciiTable.printTable(header, data, dataAlign);
}
@Override
public void printTable(String[] header, int headerAlign, String[][] data, int dataAlign) {
asciiTable.printTable(header, headerAlign, data, dataAlign);
}
public String getTable(ASCIITableHeader[] headerObjs, String[][] data) {
return asciiTable.getTable(headerObjs, data);
}
public void printTable(ASCIITableHeader[] headerObjs, String[][] data) {
asciiTable.printTable(headerObjs, data);
}
@Override
public String getTable(IASCIITableAware asciiTableAware) {
return asciiTable.getTable(asciiTableAware);
}
@Override
public void printTable(IASCIITableAware asciiTableAware) {
asciiTable.printTable(asciiTableAware);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy