摘要:
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 阅读全文
摘要:
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检查工具. 我们强烈推荐你 阅读全文
摘要:
概述Java中单例模式的实现有多重方法, 要实现单例模式主要的问题是线程安全问题以及对Lazy Load的考虑,主要有如下几种双重锁定懒加载单例预加载单例枚举单例双重锁定懒加载单例模式/** * 双重锁定懒加载单例实现 * * @author zhenwei.liu created on 2013 ... 阅读全文
摘要:
"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 阅读全文