注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

和申的个人主页

专注于java开发,1985wanggang

 
 
 

日志

 
 

guava-libraries  

2013-05-02 15:05:39|  分类: Java |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

Google前日开源了其内部Java项目所用的Java库,并取名为Guava库(guava是番石榴的意思)。Guava库旨在提供核心JDK 1.6 API所没有的常用功能。Guava包括三个包:

◆com.google.common.primitives(原始值)

◆com.google.common.io(输入输出)

◆com.google.common.util.concurrent(并发)

以后还会发布更多的库。除了JDK 1.6,Guava库还可以在Android和Google App Engine等其他Java平台上使用。


The Guava project contains several of Google's core libraries that we rely on in our Java-based projects: collections, caching, primitives support, concurrency libraries, common annotations, string processing, I/O, and so forth.

The latest release is 14.0.1, released March 15, 2013.

Start using Guava

You can download a JAR at:

Guava is also available in Maven Central under the following identifiers:

Learn more about how to UseGuavaInYourBuild.

Please see the 14.0.1 release notes for more details about this release.

Learn about Guava

How to communicate with us (and each other)

To stay informed and get "tip of the week"-style posts, follow +Google Guava on Google+.

To just stay informed, period, about important news that every Guava user needs to know, subscribe to guava-announce. It is very low-traffic.

To report a defect or request a feature, click the Issues tab above and enter a new issue.

To get help on a specific question or problem, post a question to Stack Overflow with the tag "guava". We monitor these questions using this RSS feed.)

Keep an eye on project updates using any of these Project Feeds. (The "Updates" feed is an aggregation of all the others.) You can view our code changes as they happen, and comment on them using the code-review tool.

We have a read-only mailing list consisting of email notifications of issue tracker activity, which can be easier to follow in a threaded manner than the project feed.

For general discussion that doesn't fit neatly into any of these categories, join our discussion group guava-discuss.

Important Warnings

Guava contains a strictly compatible superset of the old, deprecated Google Collections LibraryYou should not use that library anymore.

APIs marked with the @Beta annotation at the class or method level are subject to change. They can be modified in any way, or even removed, in any major release. If your code is a library itself (i.e. it is used on the CLASSPATH of users outside your own control), you should not use beta APIs, unless you repackage them (e.g. using ProGuard). Here is a current list of all the beta APIs.

Serialized forms of ALL objects are subject to change. Do not persist these and assume they can be read by a future version of the library.

Deprecated non-beta APIs will be removed eighteen months after the release in which they are first deprecated. You must fix your usages before this time. If you don't, any manner of breakage might result (you are not guaranteed a compilation error).



User Guide

The Guava project contains several of Google's core libraries that we rely on in our Java-based projects: collections, caching, primitives support, concurrency libraries, common annotations, string processing, I/O, and so forth. Each of these tools really do get used every day by Googlers, in production services.

But trawling through Javadoc isn't always the most effective way to learn how to make best use of a library. Here, we try to provide readable and pleasant explanations of some of the most popular and most powerful features of Guava.

This wiki is a work in progress, and parts of it may still be under construction.

  • Basic utilities: Make using the Java language more pleasant.
    • Using and avoiding nullnull can be ambiguous, can cause confusing errors, and is sometimes just plain unpleasant. Many Guava utilities reject and fail fast on nulls, rather than accepting them blindly.
    • Preconditions: Test preconditions for your methods more easily.
    • Common object methods: Simplify implementing Object methods, like hashCode() and toString().
    • Ordering: Guava's powerful "fluent Comparator" class.
    • Throwables: Simplify propagating and examining exceptions and errors.
  • Collections: Guava's extensions to the JDK collections ecosystem. These are some of the most mature and popular parts of Guava.
    • Immutable collections, for defensive programming, constant collections, and improved efficiency.
    • New collection types, for use cases that the JDK collections don't address as well as they could: multisets, multimaps, tables, bidirectional maps, and more.
    • Powerful collection utilities, for common operations not provided in java.util.Collections.
    • Extension utilities: writing a Collection decorator? Implementing Iterator? We can make that easier.
  • Caches: Local caching, done right, and supporting a wide variety of expiration behaviors.
  • Functional idioms: Used sparingly, Guava's functional idioms can significantly simplify code.
  • Concurrency: Powerful, simple abstractions to make it easier to write correct concurrent code.
    • ListenableFuture: Futures, with callbacks when they are finished.
    • Service: Things that start up and shut down, taking care of the difficult state logic for you.
  • Strings: A few extremely useful string utilities: splitting, joining, padding, and more.
  • Primitives: operations on primitive types, like int and char, not provided by the JDK, including unsigned variants for some types.
  • Ranges: Guava's powerful API for dealing with ranges on Comparable types, both continuous and discrete.
  • I/O: Simplified I/O operations, especially on whole I/O streams and files, for Java 5 and 6.
  • Hashing: Tools for more sophisticated hashes than what's provided by Object.hashCode(), including Bloom filters.
  • EventBus: Publish-subscribe-style communication between components without requiring the components to explicitly register with one another.
  • Math: Optimized, thoroughly tested math utilities not provided by the JDK.
  • Reflection: Guava utilities for Java's reflective capabilities.
  • Tips: Getting your application working the way you want it to with Guava.

  评论这张
 
阅读(1131)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2016