de.citec.tcs.alignment.visualization.StringColumn Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of visualization Show documentation
Show all versions of visualization Show documentation
This module contains means to visualize Alignments. The
most important interface is the Visualizer class. A trivial
implementation (essentially just using toString()) is the
StringVisualizer. A more sophisticated example that is recommended for
outside use is the HTMLVisualizer. All other classes are helper classes
for said HTMLVisualizer.
/*
* TCS Alignment Toolbox Version 3
*
* Copyright (C) 2016
* Benjamin Paaßen
* AG Theoretical Computer Science
* Centre of Excellence Cognitive Interaction Technology (CITEC)
* University of Bielefeld
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
package de.citec.tcs.alignment.visualization;
/**
* Applies 'toString' to visualize content in an HTML visualization.
*
* @author Benjamin Paassen - bpaassen(at)techfak.uni-bielefeld.de
* @param the class of the elements in the left input sequence.
* @param the class of the elements in the right input sequence.
*/
public class StringColumn extends AbstractHTMLColumn {
private static class ToStringVisualizer implements ElementHTMLVisualizer {
@Override
public String visualize(X object) {
return VisualizerUtils.smartObjectToString(object);
}
}
public StringColumn(String keyword) {
super(keyword, new ToStringVisualizer(), new ToStringVisualizer());
}
}