本文整理了Java中java.lang.Integer.shortValue()
方法的一些代码示例,展示了Integer.shortValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Integer.shortValue()
方法的具体详情如下:
包路径:java.lang.Integer
类名称:Integer
方法名:shortValue
[英]Returns the value of this Integer as a short.
[中]以短字符串形式返回此整数的值。
代码示例来源:origin: goldmansachs/gs-collections
public short shortValueOf(Integer integer)
{
return integer.shortValue();
}
}
代码示例来源:origin: jfinal/jfinal
public Short toShort(Integer self) {
return self.shortValue();
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public short shortValueOf(Integer integer)
{
return integer.shortValue();
}
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public short shortValueOf(Integer integer)
{
return integer.shortValue();
}
}
代码示例来源:origin: linlinjava/litemall
public static Short parseShort(String body, String field) {
ObjectMapper mapper = new ObjectMapper();
JsonNode node = null;
try {
node = mapper.readTree(body);
JsonNode leaf = node.get(field);
if (leaf != null) {
Integer value = leaf.asInt();
return value.shortValue();
}
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
代码示例来源:origin: org.apache.poi/poi
@Override
public void setDx2(int dx2) {
_escherClientAnchor.setDx2(Integer.valueOf(dx2).shortValue());
}
}
代码示例来源:origin: drewnoakes/metadata-extractor
@Nullable
public String getPitchAngleDescription()
{
Integer value = _directory.getInteger(TAG_PITCH_ANGLE);
if (value == null)
return null;
DecimalFormat format = new DecimalFormat("0.#");
// converted to degrees of upward camera tilt
return format.format(-value.shortValue() / 10.0);
}
代码示例来源:origin: drewnoakes/metadata-extractor
@Nullable
public String getRollAngleDescription()
{
Integer value = _directory.getInteger(TAG_ROLL_ANGLE);
if (value == null)
return null;
DecimalFormat format = new DecimalFormat("0.#");
// converted to degrees of clockwise camera rotation
return format.format(value.shortValue() / 10.0);
}
代码示例来源:origin: drewnoakes/metadata-extractor
@Nullable
public String getAccelerometerZDescription()
{
Integer value = _directory.getInteger(TAG_ACCELEROMETER_Z);
if (value == null)
return null;
// positive is acceleration upwards
return String.valueOf(value.shortValue());
}
代码示例来源:origin: org.apache.poi/poi
/**
* @param row2 the row(0 based) of the second cell.
*/
public void setRow2(int row2) {
checkRange(row2, 0, MAX_ROW, "row2");
_escherClientAnchor.setRow2(Integer.valueOf(row2).shortValue());
}
代码示例来源:origin: drewnoakes/metadata-extractor
@Nullable
public String getAccelerometerXDescription()
{
Integer value = _directory.getInteger(TAG_ACCELEROMETER_X);
if (value == null)
return null;
// positive is acceleration to the left
return String.valueOf(value.shortValue());
}
代码示例来源:origin: org.apache.poi/poi
/**
* @param row1 0-based row of the first cell.
*/
public void setRow1(int row1) {
checkRange(row1, 0, MAX_ROW, "row1");
_escherClientAnchor.setRow1(Integer.valueOf(row1).shortValue());
}
代码示例来源:origin: drewnoakes/metadata-extractor
@Nullable
public String getAccelerometerYDescription()
{
Integer value = _directory.getInteger(TAG_ACCELEROMETER_Y);
if (value == null)
return null;
// positive is acceleration backwards
return String.valueOf(value.shortValue());
}
代码示例来源:origin: eclipse-vertx/vert.x
public StreamPriority(JsonObject json) {
this.weight = json.getInteger("weight", (int)DEFAULT_WEIGHT).shortValue();
this.dependency = json.getInteger("dependency", DEFAULT_DEPENDENCY);
this.exclusive = json.getBoolean("exclusive", DEFAULT_EXCLUSIVE);
}
代码示例来源:origin: org.postgresql/postgresql
public short getShort(int parameterIndex) throws SQLException {
checkClosed();
checkIndex(parameterIndex, Types.SMALLINT, "Short");
if (callResult[parameterIndex - 1] == null) {
return 0;
}
return ((Integer) callResult[parameterIndex - 1]).shortValue();
}
代码示例来源:origin: apache/flink
@Override
protected Short[] getSortedTestData() {
Random rnd = new Random(874597969123412338L);
short rndShort = Integer.valueOf(rnd.nextInt()).shortValue();
if (rndShort < 0) {
rndShort = Integer.valueOf(-rndShort).shortValue();
}
if (rndShort == Short.MAX_VALUE) {
rndShort -= 3;
}
if (rndShort <= 2) {
rndShort += 3;
}
return new Short[]{
Short.valueOf(Short.MIN_VALUE),
Short.valueOf(Integer.valueOf(-rndShort).shortValue()),
Short.valueOf(Integer.valueOf(-1).shortValue()),
Short.valueOf(Integer.valueOf(0).shortValue()),
Short.valueOf(Integer.valueOf(1).shortValue()),
Short.valueOf(Integer.valueOf(2).shortValue()),
Short.valueOf(Integer.valueOf(rndShort).shortValue()),
Short.valueOf(Short.MAX_VALUE)};
}
}
代码示例来源:origin: drewnoakes/metadata-extractor
@Nullable
public String getWbTypeDescription(int tagType)
{
Integer wbtype = _directory.getInteger(tagType);
if (wbtype == null)
return null;
return super.getLightSourceDescription(wbtype.shortValue());
}
代码示例来源:origin: drewnoakes/metadata-extractor
@Nullable
public String getWbTypeDescription(int tagType)
{
Integer wbtype = _directory.getInteger(tagType);
if (wbtype == null)
return null;
return super.getLightSourceDescription(wbtype.shortValue());
}
}
代码示例来源:origin: drewnoakes/metadata-extractor
@Nullable
public String getWbTypeDescription(int tagType)
{
Integer wbtype = _directory.getInteger(tagType);
if (wbtype == null)
return null;
return super.getLightSourceDescription(wbtype.shortValue());
}
}
代码示例来源:origin: apache/flink
@Override
protected ShortValue[] getSortedTestData() {
Random rnd = new Random(874597969123412338L);
short rndShort = Integer.valueOf(rnd.nextInt()).shortValue();
if (rndShort < 0) {
rndShort = Integer.valueOf(-rndShort).shortValue();
}
if (rndShort == Short.MAX_VALUE) {
rndShort -= 3;
}
if (rndShort <= 2) {
rndShort += 3;
}
return new ShortValue[]{
new ShortValue(Short.MIN_VALUE),
new ShortValue(Integer.valueOf(-rndShort).shortValue()),
new ShortValue(Integer.valueOf(-1).shortValue()),
new ShortValue(Integer.valueOf(0).shortValue()),
new ShortValue(Integer.valueOf(1).shortValue()),
new ShortValue(Integer.valueOf(2).shortValue()),
new ShortValue(Integer.valueOf(rndShort).shortValue()),
new ShortValue(Short.MAX_VALUE)};
}
}
内容来源于网络,如有侵权,请联系作者删除!