de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.Flag.getOptionID()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(205)

本文整理了Java中de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.Flag.getOptionID()方法的一些代码示例,展示了Flag.getOptionID()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Flag.getOptionID()方法的具体详情如下:
包路径:de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.Flag
类名称:Flag
方法名:getOptionID

Flag.getOptionID介绍

暂无

代码示例

代码示例来源:origin: elki-project/elki

@Override
protected Boolean parseValue(Object obj) throws ParameterException {
 if(SET.equals(obj)) {
  return Boolean.TRUE;
 }
 if(NOT_SET.equals(obj)) {
  return Boolean.FALSE;
 }
 if(obj instanceof Boolean) {
  return (Boolean) obj;
 }
 if(obj != null && SET.equals(obj.toString())) {
  return Boolean.TRUE;
 }
 if(obj != null && NOT_SET.equals(obj.toString())) {
  return Boolean.FALSE;
 }
 throw new WrongParameterValueException("Wrong value for flag \"" + getOptionID().getName() + "\". Allowed values:\n" + SET + " or " + NOT_SET);
}

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-core-util

@Override
protected Boolean parseValue(Object obj) throws ParameterException {
 if(SET.equals(obj)) {
  return Boolean.TRUE;
 }
 if(NOT_SET.equals(obj)) {
  return Boolean.FALSE;
 }
 if(obj instanceof Boolean) {
  return (Boolean) obj;
 }
 if(obj != null && SET.equals(obj.toString())) {
  return Boolean.TRUE;
 }
 if(obj != null && NOT_SET.equals(obj.toString())) {
  return Boolean.FALSE;
 }
 throw new WrongParameterValueException("Wrong value for flag \"" + getOptionID().getName() + "\". Allowed values:\n" + SET + " or " + NOT_SET);
}

代码示例来源:origin: elki-project/elki

@Override
protected boolean validate(Boolean obj) throws ParameterException {
 if(obj == null) {
  throw new WrongParameterValueException("Boolean option '" + getOptionID().getName() + "' got 'null' value.");
 }
 return true;
}

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-core-util

@Override
protected boolean validate(Boolean obj) throws ParameterException {
 if(obj == null) {
  throw new WrongParameterValueException("Boolean option '" + getOptionID().getName() + "' got 'null' value.");
 }
 return true;
}

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki

/**
 * Convenience - add a Flag option directly.
 * 
 * @param flag Flag to add, if set
 */
public void forwardOption(Flag flag) {
 if(flag.isDefined() && flag.getValue().booleanValue()) {
  addFlag(flag.getOptionID());
 }
}

代码示例来源:origin: elki-project/elki

public FlagParameterConfigurator(Flag param, JComponent parent) {
 super(param, parent);
 // Input field
 GridBagConstraints constraints = new GridBagConstraints();
 constraints.gridwidth = 2;
 constraints.fill = GridBagConstraints.HORIZONTAL;
 constraints.weightx = 1.0;
 value = new JCheckBox(param.getOptionID().getName());
 if(param.isDefined() && !param.tookDefaultValue()) {
  value.setSelected(param.isTrue());
 }
 value.setToolTipText(param.getShortDescription());
 parent.add(value, constraints);
 finishGridRow();
 
 value.addActionListener(this);
}

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-gui-minigui

public FlagParameterConfigurator(Flag param, JComponent parent) {
 super(param, parent);
 // Input field
 GridBagConstraints constraints = new GridBagConstraints();
 constraints.gridwidth = 2;
 constraints.fill = GridBagConstraints.HORIZONTAL;
 constraints.weightx = 1.0;
 value = new JCheckBox(param.getOptionID().getName());
 if(param.isDefined() && !param.tookDefaultValue()) {
  value.setSelected(param.isTrue());
 }
 value.setToolTipText(param.getShortDescription());
 parent.add(value, constraints);
 finishGridRow();
 
 value.addActionListener(this);
}

相关文章