DoubleExportSink.java

/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.mklab.tool.control.system.sink;

import org.mklab.tool.control.system.parameter.Parameter;
import org.mklab.tool.control.system.parameter.ParameterUpdator;
import org.mklab.tool.control.system.parameter.StringExternalizable;


/**
 * 信号の出力先を表すクラスです。
 * 
 * @author Yuhi Ishikura
 */
public abstract class DoubleExportSink extends DoubleContinuousSink implements Exporter, ParameterUpdator, StringExternalizable {

  /** エキスポート可能ならばtrue */
  @Parameter(name = "exportable", description = "ExportSink.1", update = true, internationalization = true)
  private boolean exportable = true;

  /**
   * {@link DoubleExportSink}オブジェクトを構築します。
   */
  public DoubleExportSink() {
    super();
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public void setExportable(final boolean exportable) {
    this.exportable = exportable;
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public boolean isExportable() {
    return this.exportable;
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public String getString(String key) {
    return Messages.getString(key);
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public boolean updateWith(String parameter) {
    if (parameter.equals("exportable")) { //$NON-NLS-1$
      setExportable(this.exportable);
      return true;
    }

    return false;
  }

}