本文整理汇总了Java中com.neverwinterdp.util.text.TabularFormater.getFormatText方法的典型用法代码示例。如果您正苦于以下问题:Java TabularFormater.getFormatText方法的具体用法?Java TabularFormater.getFormatText怎么用?Java TabularFormater.getFormatText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.neverwinterdp.util.text.TabularFormater
的用法示例。
在下文中一共展示了TabularFormater.getFormatText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: format
import com.neverwinterdp.util.text.TabularFormater; //导入方法依赖的package包/类
static public String format(String title, List<VMDescriptor> descriptors) throws Exception {
TabularFormater formater = new TabularFormater("ID", "Path", "Roles", "Cores", "Memory");
formater.setIndent(" ");
for(int i = 0; i < descriptors.size(); i++) {
VMDescriptor descriptor = descriptors.get(i) ;
formater.addRow(
descriptor.getId(),
descriptor.getStoredPath(),
StringUtil.join(descriptor.getVmConfig().getRoles(), ","),
descriptor.getCpuCores(),
descriptor.getMemory()
);
}
formater.setTitle(title);
return formater.getFormatText();
}
示例2: format
import com.neverwinterdp.util.text.TabularFormater; //导入方法依赖的package包/类
public String format(String title, String ident) {
TabularFormater formater = new TabularFormater("Name", "App Home", "Workers", "Executor Per Worker");
formater.setIndent(" ");
for (int i = 0; i < descriptors.size(); i++) {
DataflowDescriptor descriptor = descriptors.get(i);
formater.addRow(
descriptor.getName(),
descriptor.getDataflowAppHome(),
descriptor.getNumberOfWorkers(),
descriptor.getNumberOfExecutorsPerWorker()
);
}
formater.setTitle(title);
return formater.getFormatText();
}