Top Description Inners Fields Constructors Methods
com.google.common.base

pack-priv final Class Platform

extends Object
Class Inheritance
Annotations
@GwtCompatible
emulated:true
@ElementTypesAreNonnullByDefault
Imports
com.google.common.annotations.GwtCompatible, java.lang.ref.WeakReference, java.util.Locale, .ServiceConfigurationError, java.util.logging.Level, .Logger, java.util.regex.Pattern, javax.annotation.CheckForNull

Methods factored out so that they can be emulated differently in GWT.
Author
Jesse Wilson

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final Logger
private static final PatternCompiler

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static CommonPattern
pack-priv static String

Returns:

string if it is not empty; null otherwise
emptyToNull
(String
the string to test and possibly return
string
)

Returns the string if it is not empty, or a null string otherwise.

pack-priv static String
formatCompact4Digits(double value)

pack-priv static <T extends Enum<T>> Optional<T>
getEnumIfPresent(Class<T> enumClass, String value)

private static PatternCompiler
private static void
pack-priv static String

Returns:

string if it is not null; "" otherwise
nullToEmpty
(String
the string to test and possibly return
string
)

Returns the string if it is not null, or an empty string otherwise.

pack-priv static boolean
pack-priv static CharMatcher
pack-priv static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

loggerback to summary
private static final Logger logger
patternCompilerback to summary
private static final PatternCompiler patternCompiler

Constructor Detail

Platformback to summary
private Platform()

Method Detail

compilePatternback to summary
pack-priv static CommonPattern compilePattern(String pattern)
emptyToNullback to summary
pack-priv static String emptyToNull(String string)

Returns the string if it is not empty, or a null string otherwise.

Parameters
string:String

the string to test and possibly return

Returns:String

string if it is not empty; null otherwise

Annotations
@CheckForNull
formatCompact4Digitsback to summary
pack-priv static String formatCompact4Digits(double value)
getEnumIfPresentback to summary
pack-priv static <T extends Enum<T>> Optional<T> getEnumIfPresent(Class<T> enumClass, String value)
loadPatternCompilerback to summary
private static PatternCompiler loadPatternCompiler()
logPatternCompilerErrorback to summary
private static void logPatternCompilerError(ServiceConfigurationError e)
nullToEmptyback to summary
pack-priv static String nullToEmpty(String string)

Returns the string if it is not null, or an empty string otherwise.

Parameters
string:String

the string to test and possibly return

Returns:String

string if it is not null; "" otherwise

patternCompilerIsPcreLikeback to summary
pack-priv static boolean patternCompilerIsPcreLike()
precomputeCharMatcherback to summary
pack-priv static CharMatcher precomputeCharMatcher(CharMatcher matcher)
stringIsNullOrEmptyback to summary
pack-priv static boolean stringIsNullOrEmpty(String string)
com.google.common.base back to summary

private final Class Platform.JdkPatternCompiler

extends Object
implements PatternCompiler
Class Inheritance
All Implemented Interfaces
com.google.common.base.PatternCompiler

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public CommonPattern
compile(String pattern)

Implements com.google.common.base.PatternCompiler.compile.

Compiles the given pattern.
public boolean
isPcreLike()

Implements com.google.common.base.PatternCompiler.isPcreLike.

Returns true if the regex implementation behaves like Perl -- notably, by supporting possessive quantifiers but also being susceptible to catastrophic backtracking.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

JdkPatternCompilerback to summary
private JdkPatternCompiler()

Method Detail

compileback to summary
public CommonPattern compile(String pattern)

Implements com.google.common.base.PatternCompiler.compile.

Doc from com.google.common.base.PatternCompiler.compile.

Compiles the given pattern.

Annotations
@Override
isPcreLikeback to summary
public boolean isPcreLike()

Implements com.google.common.base.PatternCompiler.isPcreLike.

Doc from com.google.common.base.PatternCompiler.isPcreLike.

Returns true if the regex implementation behaves like Perl -- notably, by supporting possessive quantifiers but also being susceptible to catastrophic backtracking.

Annotations
@Override