本文整理汇总了Java中org.fosstrak.ale.util.ECTimeUnit类的典型用法代码示例。如果您正苦于以下问题:Java ECTimeUnit类的具体用法?Java ECTimeUnit怎么用?Java ECTimeUnit使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ECTimeUnit类属于org.fosstrak.ale.util包,在下文中一共展示了ECTimeUnit类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDurationValue
import org.fosstrak.ale.util.ECTimeUnit; //导入依赖的package包/类
/**
* This method returns the duration value extracted from the event cycle
* specification.
* @return duration value in milliseconds
* @throws ImplementationException if an implementation exception occurs
*/
private long getDurationValue() throws ImplementationException {
if (spec.getBoundarySpec() != null) {
ECTime duration = spec.getBoundarySpec().getDuration();
if (duration != null) {
if (duration.getUnit().compareToIgnoreCase(ECTimeUnit.MS) == 0) {
return duration.getValue();
} else {
throw new ImplementationException(
"The only ECTimeUnit allowed is milliseconds (MS).");
}
}
}
return -1;
}
示例2: getRepeatPeriodValue
import org.fosstrak.ale.util.ECTimeUnit; //导入依赖的package包/类
/**
* This method returns the repeat period value on the basis of the event
* cycle specification.
* @return repeat period value
* @throws ImplementationException if the time unit in use is unknown
*/
private long getRepeatPeriodValue() throws ImplementationException {
if (spec.getBoundarySpec() != null) {
ECTime repeatPeriod = spec.getBoundarySpec().getRepeatPeriod();
if (repeatPeriod != null) {
if (repeatPeriod.getUnit().compareToIgnoreCase(ECTimeUnit.MS) != 0) {
throw new ImplementationException(
"The only ECTimeUnit allowed is milliseconds (MS).");
} else {
return repeatPeriod.getValue();
}
}
}
return -1;
}
示例3: getRepeatPeriodValue
import org.fosstrak.ale.util.ECTimeUnit; //导入依赖的package包/类
/**
* This method returns the repeat period value on the basis of the event
* cycle specification.
* @return repeat period value or NO_REPEAT_PERIOD if none set.
* @throws ImplementationException if the time unit in use is unknown
*/
private long getRepeatPeriodValue() throws ImplementationException {
ECTime repeatPeriod = spec.getBoundarySpec().getRepeatPeriod();
if (repeatPeriod != null) {
if (repeatPeriod.getUnit().compareToIgnoreCase(ECTimeUnit.MS) != 0) {
throw new ImplementationException("The only ECTimeUnit allowed is milliseconds (MS).");
} else {
return repeatPeriod.getValue();
}
}
return INTERVAL_NOT_SET;
}
示例4: getDurationValue
import org.fosstrak.ale.util.ECTimeUnit; //导入依赖的package包/类
/**
* This method returns the duration value extracted from the command cycle
* specification.
* @return duration value in milliseconds
* @throws ImplementationException if an implementation exception occurs
*/
private long getDurationValue() throws ImplementationException {
if (ccspec.getBoundarySpec() != null) {
ECTime duration = ccspec.getBoundarySpec().getDuration();
if (duration != null) {
if (duration.getUnit().compareToIgnoreCase(ECTimeUnit.MS) == 0) {
return duration.getValue();
} else {
throw new ImplementationException(
"The only ECTimeUnit allowed is milliseconds (MS).");
}
}
}
return -1;
}
示例5: getRepeatPeriodValue
import org.fosstrak.ale.util.ECTimeUnit; //导入依赖的package包/类
/**
* This method returns the repeat period value on the basis of the command
* cycle specification.
* @return repeat period value
* @throws ImplementationException if the time unit in use is unknown
*/
private long getRepeatPeriodValue() throws ImplementationException {
if (ccspec.getBoundarySpec() != null) {
ECTime repeatPeriod = ccspec.getBoundarySpec().getRepeatPeriod();
if (repeatPeriod != null) {
if (repeatPeriod.getUnit().compareToIgnoreCase(ECTimeUnit.MS) != 0) {
throw new ImplementationException(
"The only ECTimeUnit allowed is milliseconds (MS).");
} else {
return repeatPeriod.getValue();
}
}
}
return -1;
}
示例6: getRepeatPeriodValue
import org.fosstrak.ale.util.ECTimeUnit; //导入依赖的package包/类
/**
* This method returns the repeat period value on the basis of the command
* cycle specification.
* @return repeat period value or NO_REPEAT_PERIOD if none set.
* @throws ImplementationException if the time unit in use is unknown
*/
private long getRepeatPeriodValue() throws ImplementationException {
ECTime repeatPeriod = ccspec.getBoundarySpec().getRepeatPeriod();
if (repeatPeriod != null) {
if (repeatPeriod.getUnit().compareToIgnoreCase(ECTimeUnit.MS) != 0) {
throw new ImplementationException("The only ECTimeUnit allowed is milliseconds (MS).");
} else {
return repeatPeriod.getValue();
}
}
return INTERVAL_NOT_SET;
}
示例7: createDummyECTime
import org.fosstrak.ale.util.ECTimeUnit; //导入依赖的package包/类
public ECTime createDummyECTime(long t) {
ECTime time = new ECTime();
time.setUnit(ECTimeUnit.MS);
time.setValue(t);
return time;
}
示例8: getECTimeInMS
import org.fosstrak.ale.util.ECTimeUnit; //导入依赖的package包/类
public static ECTime getECTimeInMS(long value) {
ECTime time = new ECTime();
time.setUnit(ECTimeUnit.MS);
time.setValue(value);
return time;
}