本文整理汇总了Java中org.codehaus.groovy.runtime.dgmimpl.NumberNumberPlus类的典型用法代码示例。如果您正苦于以下问题:Java NumberNumberPlus类的具体用法?Java NumberNumberPlus怎么用?Java NumberNumberPlus使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NumberNumberPlus类属于org.codehaus.groovy.runtime.dgmimpl包,在下文中一共展示了NumberNumberPlus类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: next
import org.codehaus.groovy.runtime.dgmimpl.NumberNumberPlus; //导入依赖的package包/类
/**
* Increment a Number by one.
*
* @param self a Number
* @return an incremented Number
* @since 1.0
*/
public static Number next(Number self) {
return NumberNumberPlus.plus(self, ONE);
}
示例2: plus
import org.codehaus.groovy.runtime.dgmimpl.NumberNumberPlus; //导入依赖的package包/类
/**
* Add a Character and a Number. The ordinal value of the Character
* is used in the addition (the ordinal value is the unicode
* value which for simple character sets is the ASCII value).
* This operation will always create a new object for the result,
* while the operands remain unchanged.
*
* @see java.lang.Integer#valueOf(int)
* @param left a Character
* @param right a Number
* @return the Number corresponding to the addition of left and right
* @since 1.0
*/
public static Number plus(Character left, Number right) {
return NumberNumberPlus.plus(Integer.valueOf(left), right);
}