immutable object 中文意思是什麼

immutable object 解釋
不可變對象
  • immutable : adj. 不可改變的;永遠不變的。adv. -bly ,-ness n.
  • object : n 1 物,物體,物件。2 目標 (of; for); 目的,宗旨。3 【哲學】對象,客體,客觀 (opp subject); ...
  1. The flyweight pattern employs a factory method to dispense references to immutable fine - grained objects and uses sharing to keep the object count down by only having a single instance of the object corresponding to the letter " a. " for more information on the flyweight pattern, see the classic book,

    Flyweight模式採用工廠方法來分配對不變的細顆粒度對象的引用,並通過僅使一個對象實例與字母「 a 」對應來利用共享縮減對象數。有關flyweight模式的更多信息,請參閱經典書籍
  2. An immutable object is one whose externally visible state cannot change after it is instantiated

    不變對象是指在實例化后其外部可見狀態無法更改的對象。
  3. However, because of potential delays in propagating changes in memory writes from one thread to another, there is a possible race condition that would allow a thread to first see one value for an immutable object, and then at some later time see a different value

    但是,因為在將內存寫方面的更改從一個線程傳播到另一個線程時存在潛在的延遲,所以有可能存在一種競態條件,即允許一個線程首先看到不可變對象的一個值,一段時間之後看到的是一個不同的值。
  4. When manipulating strings, use stringbuffer instead of string concatenation due to the immutable nature of string objects, and the need to create an extra string object that eventually must undergo gc

    在處理字元串時,使用stringbuffer而不使用字元串連接,因為字元串對象具有不可變的特性,並且需要創建額外的字元串對象,而這些對象最終必須經歷gc 。
  5. There are a whole host of easy - to - commit and hard - to - detect programming errors that are entirely eliminated by using immutable objects, such as failure to synchronize access across threads or failing to clone an array or object before storing a reference to it

    使用不變對象可以徹底消除許多容易發生但難以檢測的編程錯誤,如無法在線程間同步訪問或在存儲對數組或對象的引用前無法克隆該數組或對象。
  6. There can be no side effects on immutable objects, and caching a reference to an immutable object is always safe from alias problems

    不可變對象上沒有副作用,並且緩存不可變對象的引用總是安全的,不會出現別名問題。
  7. Object is the content of the sequential collection, and that value is immutable

    對象的值是該有序集合的內容,並且該值是不可變的。
  8. Object is immutable, which means that it can be used only for the match parameters defined when it is created

    對象是不可變的,這意味著它只能用於創建時定義的匹配參數。
分享友人