Getting Started with Google Guava. Google Guava can transform the way you work with Java and this book shows you how. From beginner to expert, everyone can benefit from this smart guide that teaches faster, better coding - Helion
Tytuł oryginału: Getting Started with Google Guava. Google Guava can transform the way you work with Java and this book shows you how. From beginner to expert, everyone can benefit from this smart guide that teaches faster, better coding.
ISBN: 9781783280162
stron: 142, Format: ebook
Data wydania: 2013-08-14
Księgarnia: Helion
Cena książki: 74,99 zł
Java continues to maintain its popularity and is still one of the main languages used in the software industry today. But there are things in Java that are difficult to do that can be made easier; that's where Guava comes in. Guava provides developers with a way to write better code, with less effort.
Getting Started with Google Guava will show the reader how to start improving their code from the very first chapter. Packed with examples and loads of source code, this book will have an immediate impact on how you work with Java.
This book starts with using Guava to help with the common tasks that Java developers perform. Then you'll work your way through more specialized situations and finally some great functionality Guava provides that can add a lot of power to your applications with little effort. You will learn about Guava's famous Collections classes that add unique features, like the Bi-Map, to Java's already great Collection classes. We'll see how to add some functional programming aspects to our code. We will also learn about using a self-loading cache for improved performance in our applications, and how to use the EventBus to create software that takes advantage of event-based programming.
Osoby które kupowały "Getting Started with Google Guava. Google Guava can transform the way you work with Java and this book shows you how. From beginner to expert, everyone can benefit from this smart guide that teaches faster, better coding", wybierały także:
- Windows Media Center. Domowe centrum rozrywki 66,67 zł, (8,00 zł -88%)
- Ruby on Rails. Ćwiczenia 18,75 zł, (3,00 zł -84%)
- Przywództwo w świecie VUCA. Jak być skutecznym liderem w niepewnym środowisku 58,64 zł, (12,90 zł -78%)
- Scrum. O zwinnym zarządzaniu projektami. Wydanie II rozszerzone 58,64 zł, (12,90 zł -78%)
- Od hierarchii do turkusu, czyli jak zarządzać w XXI wieku 58,64 zł, (12,90 zł -78%)
Spis treści
Getting Started with Google Guava. Google Guava can transform the way you work with Java and this book shows you how. From beginner to expert, everyone can benefit from this smart guide that teaches faster, better coding eBook -- spis treści
- Getting Started with Google Guava
- Table of Contents
- Getting Started with Google Guava
- Credits
- About the Author
- About the Reviewers
- www.PacktPub.com
- Support files, eBooks, discount offers and more
- Why Subscribe?
- Free Access for Packt account holders
- Preface
- What this book covers
- What you need for this book
- Who this book is for
- Conventions
- Reader feedback
- Customer support
- Downloading the example code
- Errata
- Piracy
- Questions
- 1. Getting Started
- Introducing Google Guava
- The case for using Guava
- What is this book about?
- Installing Guava
- Using Guava with Maven or Gradle
- Getting the source code for the book
- Summary
- 2. Basic Guava Utilities
- Using the Joiner class
- Time for a review
- Using the Splitter class
- Time for a review
- Working with strings in Guava
- Using the Charsets class
- Using the Strings class
- Using the CharMatcher class
- Using the Preconditions class
- Object utilities
- Getting help with the toString method
- Checking for null values
- Generating hash codes
- Implementing CompareTo
- Summary
- Using the Joiner class
- 3. Functional Programming with Guava
- Using the Function interface
- Guidelines for using the Function interface
- Using the Functions class
- Using the Functions.forMap method
- Using the Functions.compose method
- Using the Predicate interface
- An example of the Predicate interface
- Using the Predicates class
- Using the Predicates.and method
- Using the Predicates.or method
- Using the Predicates.not method
- Using the Predicates.compose method
- Using the Supplier interface
- An example of the Supplier interface
- Using the Suppliers class
- Using the Suppliers.memoize method
- Using the Suppliers.memoizeWithExpiration method
- Summary
- Using the Function interface
- 4. Working with Collections
- The FluentIterable class
- Using the FluentIterable.filter method
- Using the FluentIterable.transform method
- Lists
- Using the Lists.partition method
- Sets
- Using the Sets.difference method
- Using the Sets.symmetricDifference method
- Using the Sets.intersection method
- Using the Sets.union method
- Maps
- Using the Maps.uniqueIndex method
- Using the Maps.asMap method
- Transforming maps
- Multimaps
- ArrayListMultimap
- HashMultimap
- BiMap
- Using the BiMap.forcePut method
- Using the BiMap.inverse method
- Table
- Table operations
- Table views
- Range
- Ranges with arbitrary comparable objects
- Immutable collections
- Creating immutable collection instances
- Ordering
- Creating an Ordering instance
- Reverse sorting
- Accounting for null
- Secondary sorting
- Retrieving minimum and maximum values
- Summary
- The FluentIterable class
- 5. Concurrency
- Synchronizing threads
- Monitor
- Monitor explained
- Monitor best practice
- Different Monitor access methods
- Monitor explained
- ListenableFuture
- Obtaining a ListenableFuture interface
- FutureCallback
- Using the FutureCallback
- SettableFuture
- AsyncFunction
- FutureFallback
- Futures
- Asynchronous Transforms
- Applying FutureFallbacks
- RateLimiter
- Summary
- 6. Guava Cache
- MapMaker
- Guava caches
- Cache
- LoadingCache
- Loading values
- Refreshing values in the cache
- CacheBuilder
- CacheBuilderSpec
- CacheLoader
- CacheStats
- RemovalListener
- RemovalNotification
- RemovalListeners
- Summary
- 7. The EventBus Class
- EventBus
- Creating an EventBus instance
- Subscribing to events
- Posting the events
- Defining handler methods
- Concurrency
- Subscribe An example
- Event Publishing An example
- Finer-grained subscribing
- Unsubscribing to events
- AsyncEventBus
- Creating an AsyncEventBus instance
- DeadEvents
- Dependency injection
- Summary
- EventBus
- 8. Working with Files
- Copying a file
- Moving/renaming a File
- Working with files as strings
- Hashing a file
- Writing to files
- Writing and appending
- InputSupplier and OutputSupplier
- Sources and Sinks
- ByteSource
- ByteSink
- Copying from a ByteSource class to a ByteSink class
- ByteStreams and CharStreams
- Limiting the size of InputStreams
- Joining CharStreams
- Closer
- BaseEncoding
- Summary
- 9. Odds and Ends
- Creating proper hash functions
- Checksum hash functions
- General hash functions
- Cryptographic hash functions
- BloomFilter
- BloomFilter in a nutshell
- Funnels and PrimitiveSinks
- Creating a BloomFilter instance
- Optional
- Creating an Optional instance
- Throwables
- Getting the chain of Throwables
- Obtaining the Root Cause Throwable
- Summary
- Creating proper hash functions
- Index