Build 1.0_r1(from source)

android.os
Class PatternMatcher

java.lang.Object
  extended by android.os.PatternMatcher
All Implemented Interfaces:
Parcelable

public class PatternMatcher
extends Object
implements Parcelable

A simple pattern matcher, which is safe to use on untrusted data: it does not provide full reg-exp support, only simple globbing that can not be used maliciously.


Nested Class Summary
 
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.Creator<T>
 
Field Summary
static Parcelable.Creator<PatternMatcher> CREATOR
           
static int PATTERN_LITERAL
          Pattern type: the given pattern must exactly match the string it is tested against.
static int PATTERN_PREFIX
          Pattern type: the given pattern must match the beginning of the string it is tested against.
static int PATTERN_SIMPLE_GLOB
          Pattern type: the given pattern is interpreted with a simple glob syntax for matching against the string it is tested against.
 
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
 
Constructor Summary
PatternMatcher(Parcel src)
           
PatternMatcher(String pattern, int type)
           
 
Method Summary
 int describeContents()
          Describe the kinds of special objects contained in this Parcelable's marshalled representation.
 String getPath()
           
 int getType()
           
 boolean match(String str)
           
(package private) static boolean matchPattern(String pattern, String match, int type)
           
 String toString()
          Returns a string containing a concise, human-readable description of the receiver.
 void writeToParcel(Parcel dest, int flags)
          Flatten this object in to a Parcel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PATTERN_LITERAL

public static final int PATTERN_LITERAL
Pattern type: the given pattern must exactly match the string it is tested against.

See Also:
Constant Field Values

PATTERN_PREFIX

public static final int PATTERN_PREFIX
Pattern type: the given pattern must match the beginning of the string it is tested against.

See Also:
Constant Field Values

PATTERN_SIMPLE_GLOB

public static final int PATTERN_SIMPLE_GLOB
Pattern type: the given pattern is interpreted with a simple glob syntax for matching against the string it is tested against. In this syntax, you can use the '*' character to match against zero or more occurrences of the character immediately before. If the character before it is '.' it will match any character. The character '\' can be used as an escape. This essentially provides only the '*' wildcard part of a normal regexp.

See Also:
Constant Field Values

CREATOR

public static final Parcelable.Creator<PatternMatcher> CREATOR
Constructor Detail

PatternMatcher

public PatternMatcher(String pattern,
                      int type)

PatternMatcher

public PatternMatcher(Parcel src)
Method Detail

getPath

public final String getPath()

getType

public final int getType()

match

public boolean match(String str)

toString

public String toString()
Description copied from class: Object
Returns a string containing a concise, human-readable description of the receiver.

Overrides:
toString in class Object
Returns:
String a printable representation for the receiver.

describeContents

public int describeContents()
Description copied from interface: Parcelable
Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Specified by:
describeContents in interface Parcelable
Returns:
a bitmask indicating the set of special object types marshalled by the Parcelable.

writeToParcel

public void writeToParcel(Parcel dest,
                          int flags)
Description copied from interface: Parcelable
Flatten this object in to a Parcel.

Specified by:
writeToParcel in interface Parcelable
Parameters:
dest - The Parcel in which the object should be written.
flags - Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.

matchPattern

static boolean matchPattern(String pattern,
                            String match,
                            int type)

Build 1.0_r1(from source)

Please submit a feedback, bug or feature