posts - 339,  comments - 95,  views - 178万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

随笔分类 -  Guava User Guide

Guava User Guide 翻译系列
Chapter 7 -- Functional
摘要:Caveats说明As of Java 7, functional programming in Java can only be approximated through awkward and verbose use of anonymous classes. This is expected to change in Java 8, but Guava is currently aimed at users of Java 5 and above.在Java7中, 只能通过笨拙且啰嗦的使用匿名类来模拟函数式编程.在Java 8中这些亟待改变, 但Guava现在的目标是Java5及以上用户 阅读全文
posted @ 2013-10-12 16:22 ZimZz 阅读(1403) 评论(0) 推荐(0) 编辑
Chapter 6 -- Caches
摘要:CachesExplainedExplanation for how to use Guava caches.explainedUpdatedJun 4, 2013bylowas...@google.comExampleLoadingCache graphs =CacheBuilder.newBuilder() .maximumSize(1000) .expireAfterWrite(10,TimeUnit.MINUTES) .removalListener(MY_LISTENER) .build( newCacheLoader(){ publicGraph ... 阅读全文
posted @ 2013-10-10 21:46 ZimZz 阅读(1596) 评论(0) 推荐(1) 编辑
Chapter 5 -- ImmutableCollections
摘要:Examplepublicstatic final ImmutableSet COLOR_NAMES =ImmutableSet.of( "red", "orange", "yellow", "green", "blue", "purple");classFoo{ Set bars; Foo(Set bars){ this.bars =ImmutableSet.copyOf(bars);// defensive copy! }}Why?Immutable objects ha 阅读全文
posted @ 2013-10-08 11:40 ZimZz 阅读(724) 评论(0) 推荐(0) 编辑
Chapter 4 -- Throwables
摘要:TODO: rewrite with more examplesGuava'sThrowablesutility can frequently simplify dealing with exceptions.Propagation 传播Sometimes, when you catch an exception, you want to throw it back up to the next try/catch block. This is frequently the case forRuntimeExceptionorErrorinstances, which do not r 阅读全文
posted @ 2013-09-24 18:13 ZimZz 阅读(920) 评论(0) 推荐(0) 编辑
Chapter 3 -- Ordering
摘要:Guava's fluent comparator class, Ordering, explained.explainedUpdatedJun 27, 2013bycpov...@google.comExample 例子assertTrue(byLengthOrdering.reverse().isOrdered(list));Overview 总览Orderingis Guava's "fluent"Comparatorclass, which can be used to build complex comparators and apply them 阅读全文
posted @ 2013-09-23 16:27 ZimZz 阅读(446) 评论(0) 推荐(1) 编辑
Chapter 2 -- Preconditions
摘要:Using Guava's precondition checking utilities, explained.explainedUpdatedApr 23, 2012bywasserman.louisPreconditionsGuava provides a number of precondition checking utilities. We strongly recommend importing these statically. (How to do this easily in Eclipse.)Guava提供了一系列precondition检查工具. 我们强烈推荐你 阅读全文
posted @ 2013-09-23 15:07 ZimZz 阅读(507) 评论(0) 推荐(1) 编辑
Chapter 1 -- UsingAndAvoidingNull
摘要:"Null sucks."-Doug Lea"Null 很恶心!""I call it my billion-dollar mistake."-Sir C. A. R. Hoare, on his invention of the null reference"我称它为我的十亿美元错误"Using and avoiding null 使用和避免nullCareless use ofnullcan cause a staggering variety of bugs. Studying the Google code 阅读全文
posted @ 2013-09-23 00:02 ZimZz 阅读(547) 评论(0) 推荐(1) 编辑

点击右上角即可分享
微信分享提示