// Path: src/main/java/com/inamik/text/tables/line/base/FunctionWithWidth.java
// public abstract class FunctionWithWidth
// {
//     public abstract String apply(Integer width, String line);
// 
//     public static final FunctionWithWidth IDENTITY =  new FunctionWithWidth() {
//         @Override
//         public Function withWidth(int _1) {
//             return Function.IDENTITY;
//         }
//         @Override
//         public String apply(Integer _1, String line) { return line; }
//     };
// 
//     public Function withWidth(final int width) {
//         // curry(this, width)
//         //
//         final FunctionWithWidth f = this;
//         return new Function() {
//             @Override
//             public String apply(String line) {
//                 return f.apply(width, line);
//             }
//         };
//     }
// 
// }


import com.inamik.text.tables.line.base.FunctionWithWidth;
/*
 * iNamik Text Tables for Java
 * 
 * Copyright (C) 2016 David Farrell (DavidPFarrell@yahoo.com)
 *
 * Licensed under The MIT License (MIT), see LICENSE.txt
 */
package com.inamik.text.tables.line;


public final class LeftTruncate extends FunctionWithWidth
{
    public static final LeftTruncate INSTANCE = new LeftTruncate();

    @Override
    public String apply(Integer width, String line) {
        if (line.length() > width) {
// Path: src/main/java/com/inamik/text/tables/line/base/FunctionWithWidth.java
// public abstract class FunctionWithWidth
// {
//     public abstract String apply(Integer width, String line);
// 
//     public static final FunctionWithWidth IDENTITY =  new FunctionWithWidth() {
//         @Override
//         public Function withWidth(int _1) {
//             return Function.IDENTITY;
//         }
//         @Override
//         public String apply(Integer _1, String line) { return line; }
//     };
// 
//     public Function withWidth(final int width) {
//         // curry(this, width)
//         //
//         final FunctionWithWidth f = this;
//         return new Function() {
//             @Override
//             public String apply(String line) {
//                 return f.apply(width, line);
//             }
//         };
//     }
// 
// }


// Path: src/main/java/com/inamik/text/tables/line/LeftTruncate.java
import com.inamik.text.tables.line.base.FunctionWithWidth;

/*
 * iNamik Text Tables for Java
 * 
 * Copyright (C) 2016 David Farrell (DavidPFarrell@yahoo.com)
 *
 * Licensed under The MIT License (MIT), see LICENSE.txt
 */
package com.inamik.text.tables.line;


public final class LeftTruncate extends FunctionWithWidth
{
    public static final LeftTruncate INSTANCE = new LeftTruncate();

    @Override
    public String apply(Integer width, String line) {
        if (line.length() > width) {
            return line.substring(line.length() - width);