本文整理汇总了Java中com.rapidminer.gui.renderer.RendererService.getName方法的典型用法代码示例。如果您正苦于以下问题:Java RendererService.getName方法的具体用法?Java RendererService.getName怎么用?Java RendererService.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.rapidminer.gui.renderer.RendererService
的用法示例。
在下文中一共展示了RendererService.getName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getData
import com.rapidminer.gui.renderer.RendererService; //导入方法依赖的package包/类
/**
* Returns a list of non-null data of all input ports.
*
* @param unfold
* If true, collections are added as individual objects rather than as a collection.
* The unfolding is done recursively.
* @throws UserError
* */
@SuppressWarnings("unchecked")
public <T extends IOObject> List<T> getData(Class<T> desiredClass, boolean unfold) throws UserError {
List<T> results = new LinkedList<T>();
for (InputPort port : getManagedPorts()) {
IOObject data = port.getAnyDataOrNull();
if (data != null) {
if (unfold && (data instanceof IOObjectCollection)) {
unfold((IOObjectCollection) data, results, desiredClass, port);
} else {
if (desiredClass.isInstance(data)) {
results.add((T) data);
} else {
throw new UserError(getPorts().getOwner().getOperator(), 156, RendererService.getName(data
.getClass()), port.getName(), RendererService.getName(desiredClass));
}
}
}
}
return results;
}
示例2: unfold
import com.rapidminer.gui.renderer.RendererService; //导入方法依赖的package包/类
/**
* @param desiredClass
* method will throw unless all non-collection children are of type desired class
* @param port
* Used for error message only
*/
@SuppressWarnings("unchecked")
private <T extends IOObject> void unfold(IOObjectCollection<?> collection, List<T> results, Class<T> desiredClass,
Port port) throws UserError {
for (IOObject obj : collection.getObjects()) {
if (obj instanceof IOObjectCollection) {
unfold((IOObjectCollection) obj, results, desiredClass, port);
} else {
if (desiredClass.isInstance(obj)) {
results.add((T) obj);
} else {
throw new UserError(getPorts().getOwner().getOperator(), 156, RendererService.getName(obj.getClass()),
port.getName(), RendererService.getName(desiredClass));
}
}
}
}
示例3: getDescription
import com.rapidminer.gui.renderer.RendererService; //导入方法依赖的package包/类
public String getDescription() {
String name = RendererService.getName(dataClass);
if (name == null) {
name = dataClass.getSimpleName();
}
StringBuilder desc = new StringBuilder(name);
if (!keyValueMap.isEmpty()) {
desc.append("; ");
desc.append(keyValueMap);
}
if ((annotations != null) && !annotations.isEmpty()) {
desc.append("<ul>");
for (String key : annotations.getKeys()) {
desc.append("<li><em>").append(key).append(":</em> ").append(annotations.get(key));
}
desc.append("</ul>");
}
return desc.toString();
}
示例4: getTypeNameForType
import com.rapidminer.gui.renderer.RendererService; //导入方法依赖的package包/类
/**
* Returns the name of a type in exchange for its class' name.
*
* @param type
* the class' name as String
* @return the short name of the class as String
*/
@SuppressWarnings("unchecked")
public static String getTypeNameForType(String type) {
String typeName = null;
if (type == null || type.isEmpty()) {
typeName = "";
} else {
Class<? extends IOObject> typeClass;
try {
typeClass = (Class<? extends IOObject>) Class.forName(type);
typeName = " (" + RendererService.getName(typeClass) + ")";
} catch (ClassNotFoundException e) {
LogService.getRoot().finer("Failed to lookup class '" + type + "'. Reason: " + e.getLocalizedMessage());
typeName = "";
}
}
return typeName;
}
示例5: showResult
import com.rapidminer.gui.renderer.RendererService; //导入方法依赖的package包/类
/**
* Show result in a new tab.
*/
void showResult() {
if (resultObjects == null) return;
int i = 1;
for(IOObject result: resultObjects) {
if(result instanceof ResultObject) {
String resultName = result instanceof ExampleSet ?
((ResultObject) result).getName() :
RendererService.getName(result.getClass());
String tabName = prunedProcessName + " - " + resultName;
RapidMinerGUI.getMainFrame()
.getRemoteResultDisplay()
.showResultWithName((ResultObject) result, tabName);
i ++;
}
}
}
示例6: getData
import com.rapidminer.gui.renderer.RendererService; //导入方法依赖的package包/类
/**
* Returns a list of non-null data of all input ports.
*
* @param unfold
* If true, collections are added as individual objects rather than as a collection.
* The unfolding is done recursively.
* @throws UserError
*/
@SuppressWarnings("unchecked")
public <T extends IOObject> List<T> getData(Class<T> desiredClass, boolean unfold) throws UserError {
List<T> results = new ArrayList<T>();
for (InputPort port : getManagedPorts()) {
IOObject data = port.getAnyDataOrNull();
if (data != null) {
if (unfold && data instanceof IOObjectCollection) {
unfold((IOObjectCollection<?>) data, results, desiredClass, port);
} else {
if (desiredClass.isInstance(data)) {
results.add((T) data);
} else {
throw new UserError(getPorts().getOwner().getOperator(), 156,
RendererService.getName(data.getClass()), port.getName(),
RendererService.getName(desiredClass));
}
}
}
}
return results;
}
示例7: unfold
import com.rapidminer.gui.renderer.RendererService; //导入方法依赖的package包/类
/**
* @param desiredClass
* method will throw unless all non-collection children are of type desired class
* @param port
* Used for error message only
*/
@SuppressWarnings("unchecked")
private <T extends IOObject> void unfold(IOObjectCollection<?> collection, List<T> results, Class<T> desiredClass,
Port port) throws UserError {
for (IOObject obj : collection.getObjects()) {
if (obj instanceof IOObjectCollection) {
unfold((IOObjectCollection<?>) obj, results, desiredClass, port);
} else {
if (desiredClass.isInstance(obj)) {
results.add((T) obj);
} else {
throw new UserError(getPorts().getOwner().getOperator(), 156, RendererService.getName(obj.getClass()),
port.getName(), RendererService.getName(desiredClass));
}
}
}
}
示例8: getTypeNameForType
import com.rapidminer.gui.renderer.RendererService; //导入方法依赖的package包/类
static String getTypeNameForType(Class<? extends IOObject> typeClass) {
String typeName;
if (typeClass != null) {
typeName = RendererService.getName(typeClass);
if (typeName != null && !typeName.isEmpty()) {
typeName = " (" + typeName + ")";
} else {
LogService.getRoot().log(Level.FINER,
"com.rapidminer.gui.OperatorDocToHtmlConverter.getTypeNameForTypeFromClass_no_name", typeClass);
typeName = "";
}
} else {
LogService.getRoot().log(Level.FINER,
"com.rapidminer.gui.OperatorDocToHtmlConverter.getTypeNameForTypeFromClass_null", typeClass);
typeName = "";
}
return typeName;
}
示例9: getData
import com.rapidminer.gui.renderer.RendererService; //导入方法依赖的package包/类
/** Returns a list of non-null data of all input ports.
* @param unfold If true, collections are added as individual objects rather than as a collection. The unfolding is done recursively.
* @throws UserError
* */
@SuppressWarnings("unchecked")
public <T extends IOObject> List<T> getData(Class<T> desiredClass, boolean unfold) throws UserError {
List<T> results = new LinkedList<T>();
for (InputPort port : getManagedPorts()) {
IOObject data = port.getAnyDataOrNull();
if (data != null) {
if (unfold && (data instanceof IOObjectCollection)) {
unfold((IOObjectCollection)data, results, desiredClass, port);
} else {
if (desiredClass.isInstance(data)) {
results.add((T)data);
} else {
throw new UserError(getPorts().getOwner().getOperator(), 156, RendererService.getName(data.getClass()), port.getName(), RendererService.getName(desiredClass));
}
}
}
}
return results;
}
示例10: getDescription
import com.rapidminer.gui.renderer.RendererService; //导入方法依赖的package包/类
public String getDescription() {
String name = RendererService.getName(dataClass);
if (name == null)
name = dataClass.getSimpleName();
StringBuilder desc = new StringBuilder(name);
if (!keyValueMap.isEmpty()) {
desc.append("; ");
desc.append(keyValueMap);
}
if ((annotations != null) && !annotations.isEmpty()) {
desc.append("<ul>");
for (String key: annotations.getKeys()) {
desc.append("<li><em>").append(key).append(":</em> ").append(annotations.get(key));
}
desc.append("</ul>");
}
return desc.toString();
}
示例11: getTypeNameForType
import com.rapidminer.gui.renderer.RendererService; //导入方法依赖的package包/类
/**
* Returns the name of a type in exchange for its class' name.
*
* @param type the class' name as String
* @return the short name of the class as String
*/
@SuppressWarnings("unchecked")
public static String getTypeNameForType(String type) {
String typeName = null;
if ((type == null) || type.isEmpty()) {
typeName = "";
} else {
Class<? extends IOObject> typeClass;
try {
typeClass = (Class<? extends IOObject>) Class.forName(type);
typeName = " (" + RendererService.getName(typeClass) + ")";
} catch (ClassNotFoundException e) {
LogService.getRoot().finer("Failed to lookup class '" + type + "'. Reason: " + e.getLocalizedMessage());
typeName = "";
}
}
return typeName;
}
示例12: createComponent
import com.rapidminer.gui.renderer.RendererService; //导入方法依赖的package包/类
private JPanel createComponent(ResultObject resultObject, IOContainer resultContainer) {
final String resultName = RendererService.getName(resultObject.getClass());
String usedResultName = resultObject.getName();
if (usedResultName == null) {
usedResultName = resultName;
}
synchronized (currentResultNames) {
Integer oldCount = currentResultNames.get(usedResultName);
int myIndex;
if (oldCount == null) {
myIndex = 1;
} else {
myIndex = oldCount+1;
}
currentResultNames.put(usedResultName, myIndex);
if (myIndex > 1) {
usedResultName += "(" + myIndex + ")";
}
}
return ResultDisplayTools.createVisualizationComponent(resultObject, resultContainer, usedResultName);
}
示例13: doWork
import com.rapidminer.gui.renderer.RendererService; //导入方法依赖的package包/类
@Override
public void doWork() throws OperatorException {
// The old and new random forest model implementations are not related (class hierarchy).
// Thus, Port#getData() would fail for one or the other. For this reason, the implementation
// below request the common super-type Model and performs the compatibility check manually.
Model forest = forestInput.getData(Model.class);
if (!(forest instanceof MetaModel)
|| !(forest instanceof ConfigurableRandomForestModel || forest instanceof RandomForestModel)) {
PortUserError error = new PortUserError(forestInput, 156, RendererService.getName(forest.getClass()),
forestInput.getName(), RendererService.getName(ConfigurableRandomForestModel.class));
error.setExpectedType(ConfigurableRandomForestModel.class);
error.setActualType(forest.getClass());
throw error;
}
String[] labelValues = forest.getTrainingHeader().getAttributes().getLabel().getMapping().getValues()
.toArray(new String[0]);
// now start measuring weights
Criterion criterion = AbstractCriterion.createCriterion(this, 0);
HashMap<String, Double> attributeBenefitMap = new HashMap<>();
for (Model model : ((MetaModel) forest).getModels()) {
TreeModel treeModel = (TreeModel) model;
extractWeights(attributeBenefitMap, criterion, treeModel.getRoot(), labelValues);
}
AttributeWeights weights = new AttributeWeights();
int numberOfModels = ((MetaModel) forest).getModels().size();
for (Entry<String, Double> entry : attributeBenefitMap.entrySet()) {
weights.setWeight(entry.getKey(), entry.getValue() / numberOfModels);
}
if (getParameterAsBoolean(PARAMETER_NORMALIZE_WEIGHTS)) {
weights.normalize();
}
weightsOutput.deliver(weights);
forestOutput.deliver(forest);
}
示例14: getData
import com.rapidminer.gui.renderer.RendererService; //导入方法依赖的package包/类
@Override
public <T extends IOObject> T getData(Class<T> desiredClass) throws UserError {
IOObject data = getAnyDataOrNull();
if (data == null) {
throw new PortUserError(this, 149, getSpec() + (isConnected() ? " (connected)" : " (disconnected)"));
} else if (desiredClass.isAssignableFrom(data.getClass())) {
return desiredClass.cast(data);
} else {
PortUserError error = new PortUserError(this, 156, RendererService.getName(data.getClass()), this.getName(),
RendererService.getName(desiredClass));
error.setExpectedType(desiredClass);
error.setActualType(data.getClass());
throw error;
}
}
示例15: getDataOrNull
import com.rapidminer.gui.renderer.RendererService; //导入方法依赖的package包/类
@Override
public <T extends IOObject> T getDataOrNull(Class<T> desiredClass) throws UserError {
IOObject data = getAnyDataOrNull();
if (data == null) {
return null;
} else if (desiredClass.isAssignableFrom(data.getClass())) {
return desiredClass.cast(data);
} else {
PortUserError error = new PortUserError(this, 156, RendererService.getName(data.getClass()), this.getName(),
RendererService.getName(desiredClass));
error.setExpectedType(desiredClass);
error.setActualType(data.getClass());
throw error;
}
}