kz.greetgo.msoffice.xlsx.gen.Styles Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of greetgo.msoffice Show documentation
Show all versions of greetgo.msoffice Show documentation
greetgo library to generate or parse MS Office files
package kz.greetgo.msoffice.xlsx.gen;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
class Styles {
private final List fills = new ArrayList();
int fillIndex(Fill fill) {
if (fill == null) fill = new PatternFill(PatternFillType.none);
int index = 0;
for (Fill f : fills) {
if (f.equals(fill)) return index;
index++;
}
fills.add(fill.copy());
return index;
}
private final List bordersList = new ArrayList();
int bordersIndex(Borders borders) {
if (borders == null) borders = new Borders();
int index = 0;
for (Borders b : bordersList) {
if (b.equals(borders)) return index;
index++;
}
bordersList.add(new Borders(borders));
return index;
}
private final List fonts = new ArrayList();
int fontIndex(Font font) {
if (font == null) font = new Font();
int index = 0;
for (Font f : fonts) {
if (f.equals(font)) return index;
index++;
}
fonts.add(new Font(font));
return index;
}
private final List