public ProsePackage( String stfFile, String stfLabel, long tuObjectId, String tuStfFile, String tuStfLabel, String tuCustomString) { stf.setStfFilename(stfFile); stf.setStfName(stfLabel); this.tuObjectId = tuObjectId; tuStf.setStfFilename(tuStfFile); tuStf.setStfName(tuStfLabel); this.tuCustomString = tuCustomString; }
/* * Any parameters can be entered. * * Any integers set diInteger * Any floats set dfFloat * Any "@stfFile:label" sets the default stf * "TU" followed by objectId, "@stfFile:label" or customString * "TT" followed by objectId, "@stfFile:label" or customString * "TO" followed by objectId, "@stfFile:label" or customString */ public ProsePackage(Object... objects) { for (Object object : objects) { if (object instanceof Object[]) { objects = (Object[]) object; break; } } for (int i = 0; i < objects.length; i++) { Object object = objects[i]; if (object instanceof String) { String string = (String) object; if ((i + 1) < objects.length) { long objectId = 0; Stf stf = null; String customString = null; if (objects[i + 1] instanceof Long) { objectId = (Long) objects[i + 1]; } else if (objects[i + 1] instanceof String) { String str = (String) objects[i + 1]; if (str.startsWith("@") && str.contains(":") && !str.contains(" ")) { stf = new Stf(str); } else { customString = str; } } switch (string.toUpperCase()) { case "TU": tuObjectId = (objectId == 0) ? tuObjectId : objectId; tuStf = (stf == null) ? tuStf : stf; tuCustomString = (customString == null) ? tuCustomString : customString; continue; case "TT": ttObjectId = (objectId == 0) ? ttObjectId : objectId; ttStf = (stf == null) ? ttStf : stf; ttCustomString = (customString == null) ? ttCustomString : customString; continue; case "TO": toObjectId = (objectId == 0) ? toObjectId : objectId; toStf = (stf == null) ? toStf : stf; toCustomString = (customString == null) ? toCustomString : customString; continue; default: // } } stf.setString((String) object); } else if (object instanceof Integer) { diInteger = (Integer) object; } else if (object instanceof Float) { dfFloat = (Float) object; } } }
public ProsePackage(String stfFile, String stfLabel, String ttCustomString) { stf.setStfFilename(stfFile); stf.setStfName(stfLabel); this.ttCustomString = ttCustomString; }
public ProsePackage(String stfFile, String stfLabel) { stf.setStfFilename(stfFile); stf.setStfName(stfLabel); }