📄 summaryattribute.java
字号:
package org.momeunit.ant.taskdefs;import org.momeunit.ant.core.EnumType;/** * Summary attribute representation. Contains method for accessing attribute * value as <code>boolean</code> {@link #asBoolean()}. Contains method to * check whether to include the output of emulator and tests run written to * <code>System.out</code> and <code>System.err</code> * {@link #isWithOutAndErr()}. * * @author Sergio Morozov * @version 1.1.2 */public class SummaryAttribute extends EnumType{ private final static String[] VALUES = { "true", "yes", "false", "no", "on", "off", "withoutanderr" }; private final static boolean[] BOOLEAN_VALUES = { true, true, false, false, true, false, true }; private final static boolean[] WITHOUTANDERR = { false, false, false, false, false, false, true }; /** * Instantiates SummaryAttribute initialized with given value. * * @param value * SummaryAttribute to be initialized with. * @since 1.1.2 */ public SummaryAttribute(String value) { super(value); } /* * (non-Javadoc) * * @see org.drmoro.ant.EnumType#getValues() */ protected String[] getValues() { return VALUES; } /** * Returns summary attribute as boolean. * * @return <code>false</code> if summary attribute is set to * <code>false, no, off</code> and <code>true</code> otherwise. * @since 1.1.1 */ public boolean asBoolean() { return BOOLEAN_VALUES[getIndex()]; } /** * Checks whether to include the output of emulator and tests run written to * <code>System.out</code> and <code>System.err</code>. * * @return <code>true</code> if summary attribute is set to * <code>withOutAndErr</code>, <code>false</code> otherwise. * @since 1.1.1 */ public boolean isWithOutAndErr() { return WITHOUTANDERR[getIndex()]; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -