1. 程式人生 > >JDK1.8 API翻譯(第三彈:Number)

JDK1.8 API翻譯(第三彈:Number)

下面開始翻譯。

Class Number

java.lang.Object
    java.lang.Number

All Implemented Interfaces:
Serializable

Direct Known Subclasses:
AtomicInteger, AtomicLong, BigDecimal, BigInteger, Byte, Double, DoubleAccumulator, DoubleAdder, Float, Integer, Long, LongAccumulator, LongAdder, Short

public abstract class Number
extends Object
implements Serializable

The abstract class Number is the superclass of platform classes representing numeric values that are convertible to the primitive types byte, double, float, int, long, and short. The specific semantics of the conversion from the numeric value of a particular Number implementation to a given primitive type is defined by the Number implementation in question. For platform classes, the conversion is often analogous to a narrowing primitive conversion or a widening primitive conversion as defining in The Java Language Specification for converting between primitive types. Therefore, conversions may lose information about the overall magnitude of a numeric value, may lose precision, and may even return a result of a different sign than the input. See the documentation of a given Number implementation for conversion details.
抽象類Number是一些表示數字值的類的父類,這些類可轉換為byte, double, float, int, long, short這些基本資料型別。從一個特定的Number實現的數字值到一個給定的基本型別的轉換的語義是由這個Number實現定義的。對於平臺類,轉換往往是類似於縮窄原始轉換或擴充套件原始轉換,像Java語言規範中定義的基本型別之間的轉換一樣。 因此,轉換可能會丟失有關數值總體大小的資訊,可能會丟失精度,甚至可能會返回與輸入不同的正負號結果。轉換的詳細資訊,參閱給定的Number實現的文件。

Since:
JDK1.0
See Also:
Serialized Form
See The Java Language Specification:
5.1.2 Widening Primitive Conversions, 5.1.3 Narrowing Primitive Conversions

Number

public Number()

intValue

public abstract int intValue()
Returns the value of the specified number as an int, which may involve rounding or truncation.
返回指定數字的值為int ,可能產生四捨五入或截斷。

Returns:
the numeric value represented by this object after conversion to type int.
該物件在轉換為int之後所表示的數字值。

longValue

public abstract long longValue()
Returns the value of the specified number as a long, which may involve rounding or truncation.
返回指定數字的值為long ,可能產生四捨五入或截斷。

Returns:
the numeric value represented by this object after conversion to type long.
該物件在轉換為long之後所表示的數字值。

floatValue

public abstract float floatValue()
Returns the value of the specified number as a float, which may involve rounding.
返回指定數字的值為float ,可能產生四捨五入。

Returns:
the numeric value represented by this object after conversion to type float.
該物件在轉換為float之後所表示的數字值。

doubleValue

public abstract double doubleValue()
Returns the value of the specified number as a double, which may involve rounding.
返回指定數字的值為double,可能產生四捨五入。

Returns:
the numeric value represented by this object after conversion to type double.
該物件在轉換為double之後所表示的數字值。

byteValue

public byte byteValue()
Returns the value of the specified number as a byte, which may involve rounding or truncation.
This implementation returns the result of intValue() cast to a byte.
返回指定數字的值為byte ,可能產生四捨五入或截斷。
這個實現返回intValue()轉換為byte後的結果。

Returns:
the numeric value represented by this object after conversion to type byte.
該物件在轉換為byte之後所表示的數字值。

Since:
JDK1.1

shortValue

public short shortValue()
Returns the value of the specified number as a short, which may involve rounding or truncation.
This implementation returns the result of intValue() cast to a short.
返回指定數字的值為short,可能產生四捨五入或截斷。
這個實現返回intValue()轉換為short後的結果。

Returns:
the numeric value represented by this object after conversion to type short.
該物件在轉換為short之後所表示的數字值。

Since:
JDK1.1

相關推薦

JDK1.8 API翻譯Number

下面開始翻譯。 Class Number java.lang.Object     java.lang.Number All Implemented Interfaces: Serializable Direct Known Subclasses

程式設計師表白程式,開放原始碼,不斷更新第二

首先感謝hackerzhou同志,是他給了我激情和想法,感謝他的開源精神,造福大家。這一波主要內容集中在網頁這裡,我一直想找一個通用或簡易辦法,能使大部分人都能使用“表白”這份禮物,如果使用網頁,那麼就要會建站,要伺服器,要域名,除了程式碼還需要配置,有點麻煩,我這裡使用的都

Asp.net Web Api開發自定義異常過濾器

如果不自定義異常過濾器,客戶端呼叫API出現錯誤時,將只能得到一個500之類的錯誤狀態,以及一句:出現錯誤。而服務端卻無法攔截到任何異常程式碼,當然你也可以在所有Action裡面寫try-catch來捕獲處理。但這不是我想要的,我們可以自定義一個異常過濾器來捕獲單個Acti

企業訂餐系統次周總結

src ges ket cnblogs 頁面設計 log images 實現 技術 第三次周總結   本周大家都基本開始了項目實現的步驟   王潔學姐做了後端有關登錄、註冊部分以及查看和修改信息功能。   項詩茹學姐在構思我們網站的設計圖   王賢國學長在實現文件上傳部分

ssm框架整合-過程總結次周總結

項目 功能實現 SSM框架 模板 .com 完成 eight 幫助 spa 本周主要是完成前端界面和後端的整合。 猶豫前後端的工作完成程度不一致,只實現了部分整合。 登錄界面。 可能自己最近沒有把重心放在短學期的項目上,導致我們工作的總體進度都要比別慢。 雖然我們只是

python3多線程應用詳解圖解多線程中join,守護線程應用

圖解 pytho inf bubuko post 圖片 clas info blog python3多線程應用詳解(第三卷:圖解多線程中join,守護線程應用)

自動化運維-Ansible Playbook 介紹

blog comm 擴展性 變量 wal ansi .com 基礎 fire 前言 之前有兩篇文章分別講了 Ansible 的部署、Ansible 的 模塊使用,對 Ansible 有了最初的了解,這篇文章最主要是要介紹 Playbook。需要了解 Ansible 的部署請

《SQL入門經典》筆記建立資料庫之管理資料庫物件

1. 什麼是資料庫物件? 資料庫物件用於儲存或引用資料,需要被定義,例如表、試圖、簇、序列、索引和異名(讓表具有另一個名稱)。   2. 什麼是規劃? 規劃是與資料庫某個使用者名稱相關聯的資料庫物件集合。相應的使用者名稱被稱為“規劃所有人”/“關聯物件組的所有人”。 同

JDK原始碼解讀Integer之toString方法

上一篇只講了Integer的幾個屬性,這一次我們來看一下toString方法。 toString總共有3個過載,先來看兩個引數的toStirng方法: public static String toString(int i, int radix) {

深入解讀Spring Framework IoC容器p名稱空間和c名稱空間

原文 p名稱空間 使用p名稱空間可以用bean 元素的屬性代替<property/>元素。 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="ht

老鼠屎地理資訊視覺化Plotly+Pyecharts繪製地理座標系線圖

    由於最近老鼠屎做的東西和地圖上的線型圖相關,因此在這裡做一點簡單總結。很多地方都除錯得很不理想,希望成功的地方可以給大家帶來一點點啟發,不理想的地方也歡迎大神們賜教。 1 Plotly 1.1 地圖上繪製線     有關pyplot的相關在老鼠屎的博文使用plo

Oracle PL/SQL進階程式設計包的進階技術

包過載 包過載實際上就是對包中的子程式的過載,之前我們已經對子程式的過載做過介紹,這裡簡單看下程式碼。 定義包規範: CREATE OR REPLACE PACKAGE emp_action_pkg_overload IS --定義一個增加新員工

scala學習scala實戰

需要安裝的軟體jdk scala sbt repl sbt(simple build tools)為scala而設計 scala的互動式介面叫做repl介面 進入互動介面:命令列輸入scala 退出互

Android探索之旅十六篇Android中使用者反饋需要開發?不存在的

作為一個合格的Android開發者,我們時不時會碰到產品給使用者反饋功能需求,你大概需要一天?兩天?三天?請求介面?NO NO NO~~~不存在的 下面介紹一個平臺叫吐個槽官網 1. 進入平臺後需要建立產品,建立好之後會為你分配APPID 2.

objective-c程式設計全解版讀書筆記

一、iOS開發的參考文件和SDK: 中文資源 上面的這些參考文件可以直接使用瀏覽器訪問,使用Xcode開發Mac OS X、iPhone和iPad的應用時,也能夠方便地使用這些參考文件,在Xcode中的“Help”選單中選擇“Documentation and AP

圖神經網路概述來自IEEE Fellow的GNN綜述

選自 arXiv,作者:Zonghan Wu等,機器之心編譯。 圖神經網路(GNN)熱度持續上升,之前我們曾介紹了清華兩篇綜述論文,參見:深度學習時代的圖模型,清華髮文綜述圖網路,和清華大學圖神經網路綜述:模型與應用。最近,IEEE Fellow、Senior Member 和 Member Zon

HTML5亦酷亦萌的網路拓撲圖

前言 前一篇3D機房好像有點火,看來輕量的Web 3D是大勢所趨,當時選擇WebGL而不是U3D真是灰常英明的抉擇。 3D雖然炫酷,但在真正的企業應用裡,資料、關係的呈現還是要回到傳統2D介面,而HTML5是目前的最佳選擇。像HTML5的canvas,雖然已

深入解讀Spring Framework事務管理基於@Transactional註解的宣告式事務管理

基於註解的宣告式事務,主要使用的是@Transactional註解,下面我們來具體看一下。 使用@Transactional註解實現事務的例子 // 這個service我們要將他事務化 @Transactional public class Defa

github管理自己的學習計劃

最近使用了github後有了將自己近 半年的學習情況在上面進行記錄的想 法,就是建立一個自己的repo,裡 面存放一些自己做過的或者看過的一 些工作,這樣豈不是很方便還高大 上,於是說幹就幹! 先放個整體效果圖鎮樓 現在,我

Android探索之旅十七篇網路動態獲取並載入Selector(Glide篇)

最近公司一個專案選單切換欄需要動態從後臺獲取,於是翻閱了很多資料來去學習這一塊的知識,很多方案很不錯,但並不適合我現在要做的專案,我專案中切換tab的icon是從後臺獲取到的,並且載入選中未選中兩套圖,只允許第一次載入慢,往後就採用快取載入,無延遲,效果圖