|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
|
<!--NewPage-->
|
|
|
<HTML>
|
|
|
<HEAD>
|
|
|
<!-- Generated by javadoc (build 1.6.0-google-v3) on Wed May 04 18:24:03 CEST 2011 -->
|
|
|
<TITLE>
|
|
|
PhoneNumberMatch
|
|
|
</TITLE>
|
|
|
|
|
|
<META NAME="date" CONTENT="2011-05-04">
|
|
|
|
|
|
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
|
|
|
|
|
|
<SCRIPT type="text/javascript">
|
|
|
function windowTitle()
|
|
|
{
|
|
|
if (location.href.indexOf('is-external=true') == -1) {
|
|
|
parent.document.title="PhoneNumberMatch";
|
|
|
}
|
|
|
}
|
|
|
</SCRIPT>
|
|
|
<NOSCRIPT>
|
|
|
</NOSCRIPT>
|
|
|
|
|
|
</HEAD>
|
|
|
|
|
|
<BODY BGCOLOR="white" onload="windowTitle();">
|
|
|
<HR>
|
|
|
|
|
|
|
|
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
|
|
<A NAME="navbar_top"><!-- --></A>
|
|
|
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
|
|
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
|
|
<TR>
|
|
|
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
|
|
<A NAME="navbar_top_firstrow"><!-- --></A>
|
|
|
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
|
|
<TR ALIGN="center" VALIGN="top">
|
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../com/google/i18n/phonenumbers/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
|
|
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
|
|
</TR>
|
|
|
</TABLE>
|
|
|
</TD>
|
|
|
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
|
|
</EM>
|
|
|
</TD>
|
|
|
</TR>
|
|
|
|
|
|
<TR>
|
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
|
<A HREF="../../../../com/google/i18n/phonenumbers/NumberParseException.ErrorType.html" title="enum in com.google.i18n.phonenumbers"><B>PREV CLASS</B></A>
|
|
|
<A HREF="../../../../com/google/i18n/phonenumbers/PhoneNumberUtil.html" title="class in com.google.i18n.phonenumbers"><B>NEXT CLASS</B></A></FONT></TD>
|
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
|
<A HREF="../../../../index.html?com/google/i18n/phonenumbers/PhoneNumberMatch.html" target="_top"><B>FRAMES</B></A>
|
|
|
<A HREF="PhoneNumberMatch.html" target="_top"><B>NO FRAMES</B></A>
|
|
|
<SCRIPT type="text/javascript">
|
|
|
<!--
|
|
|
if(window==top) {
|
|
|
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
|
|
}
|
|
|
//-->
|
|
|
</SCRIPT>
|
|
|
<NOSCRIPT>
|
|
|
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
|
|
|
</NOSCRIPT>
|
|
|
|
|
|
|
|
|
</FONT></TD>
|
|
|
</TR>
|
|
|
<TR>
|
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
|
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
|
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
|
|
</TR>
|
|
|
</TABLE>
|
|
|
<A NAME="skip-navbar_top"></A>
|
|
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
|
|
|
|
|
<HR>
|
|
|
<!-- ======== START OF CLASS DATA ======== -->
|
|
|
<H2>
|
|
|
<FONT SIZE="-1">
|
|
|
com.google.i18n.phonenumbers</FONT>
|
|
|
<BR>
|
|
|
Class PhoneNumberMatch</H2>
|
|
|
<PRE>
|
|
|
java.lang.Object
|
|
|
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.google.i18n.phonenumbers.PhoneNumberMatch</B>
|
|
|
</PRE>
|
|
|
<HR>
|
|
|
<DL>
|
|
|
<DT><PRE>public final class <B>PhoneNumberMatch</B><DT>extends java.lang.Object</DL>
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
The immutable match of a phone number within a piece of text. Matches may be found using
|
|
|
<CODE>PhoneNumberUtil#findNumbers</CODE>.
|
|
|
|
|
|
<p>A match consists of the <A HREF="../../../../com/google/i18n/phonenumbers/PhoneNumberMatch.html#number()">phone number</A> as well as the
|
|
|
<A HREF="../../../../com/google/i18n/phonenumbers/PhoneNumberMatch.html#start()">start</A> and <A HREF="../../../../com/google/i18n/phonenumbers/PhoneNumberMatch.html#end()">end</A> offsets of the corresponding subsequence
|
|
|
of the searched text. Use <A HREF="../../../../com/google/i18n/phonenumbers/PhoneNumberMatch.html#rawString()"><CODE>rawString()</CODE></A> to obtain a copy of the matched subsequence.
|
|
|
|
|
|
<p>The following annotated example clarifies the relationship between the searched text, the
|
|
|
match offsets, and the parsed number:
|
|
|
|
|
|
<pre>
|
|
|
CharSequence text = "Call me at +1 425 882-8080 for details.";
|
|
|
RegionCode country = RegionCode.US;
|
|
|
PhoneNumberUtil util = PhoneNumberUtil.getInstance();
|
|
|
|
|
|
// Find the first phone number match:
|
|
|
PhoneNumberMatch m = util.findNumbers(text, country).iterator().next();
|
|
|
|
|
|
// rawString() contains the phone number as it appears in the text.
|
|
|
"+1 425 882-8080".equals(m.rawString());
|
|
|
|
|
|
// start() and end() define the range of the matched subsequence.
|
|
|
CharSequence subsequence = text.subSequence(m.start(), m.end());
|
|
|
"+1 425 882-8080".contentEquals(subsequence);
|
|
|
|
|
|
// number() returns the the same result as PhoneNumberUtil.<CODE>parse()</CODE>
|
|
|
// invoked on rawString().
|
|
|
util.parse(m.rawString(), country).equals(m.number());
|
|
|
</pre>
|
|
|
<P>
|
|
|
|
|
|
<P>
|
|
|
<HR>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<!-- ========== METHOD SUMMARY =========== -->
|
|
|
|
|
|
<A NAME="method_summary"><!-- --></A>
|
|
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
|
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
|
|
<B>Method Summary</B></FONT></TH>
|
|
|
</TR>
|
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
|
<CODE> int</CODE></FONT></TD>
|
|
|
<TD><CODE><B><A HREF="../../../../com/google/i18n/phonenumbers/PhoneNumberMatch.html#end()">end</A></B>()</CODE>
|
|
|
|
|
|
<BR>
|
|
|
Returns the exclusive end index of the matched phone number within the searched text.</TD>
|
|
|
</TR>
|
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
|
<CODE> boolean</CODE></FONT></TD>
|
|
|
<TD><CODE><B><A HREF="../../../../com/google/i18n/phonenumbers/PhoneNumberMatch.html#equals(java.lang.Object)">equals</A></B>(java.lang.Object obj)</CODE>
|
|
|
|
|
|
<BR>
|
|
|
</TD>
|
|
|
</TR>
|
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
|
<CODE> int</CODE></FONT></TD>
|
|
|
<TD><CODE><B><A HREF="../../../../com/google/i18n/phonenumbers/PhoneNumberMatch.html#hashCode()">hashCode</A></B>()</CODE>
|
|
|
|
|
|
<BR>
|
|
|
</TD>
|
|
|
</TR>
|
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
|
<CODE> PhoneNumber</CODE></FONT></TD>
|
|
|
<TD><CODE><B><A HREF="../../../../com/google/i18n/phonenumbers/PhoneNumberMatch.html#number()">number</A></B>()</CODE>
|
|
|
|
|
|
<BR>
|
|
|
Returns the phone number matched by the receiver.</TD>
|
|
|
</TR>
|
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
|
<CODE> java.lang.String</CODE></FONT></TD>
|
|
|
<TD><CODE><B><A HREF="../../../../com/google/i18n/phonenumbers/PhoneNumberMatch.html#rawString()">rawString</A></B>()</CODE>
|
|
|
|
|
|
<BR>
|
|
|
Returns the raw string matched as a phone number in the searched text.</TD>
|
|
|
</TR>
|
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
|
<CODE> int</CODE></FONT></TD>
|
|
|
<TD><CODE><B><A HREF="../../../../com/google/i18n/phonenumbers/PhoneNumberMatch.html#start()">start</A></B>()</CODE>
|
|
|
|
|
|
<BR>
|
|
|
Returns the start index of the matched phone number within the searched text.</TD>
|
|
|
</TR>
|
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
|
<CODE> java.lang.String</CODE></FONT></TD>
|
|
|
<TD><CODE><B><A HREF="../../../../com/google/i18n/phonenumbers/PhoneNumberMatch.html#toString()">toString</A></B>()</CODE>
|
|
|
|
|
|
<BR>
|
|
|
</TD>
|
|
|
</TR>
|
|
|
</TABLE>
|
|
|
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
|
|
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
|
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
|
|
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
|
|
|
</TR>
|
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
|
<TD><CODE>clone, finalize, getClass, notify, notifyAll, wait, wait, wait</CODE></TD>
|
|
|
</TR>
|
|
|
</TABLE>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<!-- ============ METHOD DETAIL ========== -->
|
|
|
|
|
|
<A NAME="method_detail"><!-- --></A>
|
|
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
|
|
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
|
|
<B>Method Detail</B></FONT></TH>
|
|
|
</TR>
|
|
|
</TABLE>
|
|
|
|
|
|
<A NAME="number()"><!-- --></A><H3>
|
|
|
number</H3>
|
|
|
<PRE>
|
|
|
public PhoneNumber <B>number</B>()</PRE>
|
|
|
<DL>
|
|
|
<DD>Returns the phone number matched by the receiver.
|
|
|
<P>
|
|
|
<DD><DL>
|
|
|
</DL>
|
|
|
</DD>
|
|
|
</DL>
|
|
|
<HR>
|
|
|
|
|
|
<A NAME="start()"><!-- --></A><H3>
|
|
|
start</H3>
|
|
|
<PRE>
|
|
|
public int <B>start</B>()</PRE>
|
|
|
<DL>
|
|
|
<DD>Returns the start index of the matched phone number within the searched text.
|
|
|
<P>
|
|
|
<DD><DL>
|
|
|
</DL>
|
|
|
</DD>
|
|
|
</DL>
|
|
|
<HR>
|
|
|
|
|
|
<A NAME="end()"><!-- --></A><H3>
|
|
|
end</H3>
|
|
|
<PRE>
|
|
|
public int <B>end</B>()</PRE>
|
|
|
<DL>
|
|
|
<DD>Returns the exclusive end index of the matched phone number within the searched text.
|
|
|
<P>
|
|
|
<DD><DL>
|
|
|
</DL>
|
|
|
</DD>
|
|
|
</DL>
|
|
|
<HR>
|
|
|
|
|
|
<A NAME="rawString()"><!-- --></A><H3>
|
|
|
rawString</H3>
|
|
|
<PRE>
|
|
|
public java.lang.String <B>rawString</B>()</PRE>
|
|
|
<DL>
|
|
|
<DD>Returns the raw string matched as a phone number in the searched text.
|
|
|
<P>
|
|
|
<DD><DL>
|
|
|
</DL>
|
|
|
</DD>
|
|
|
</DL>
|
|
|
<HR>
|
|
|
|
|
|
<A NAME="hashCode()"><!-- --></A><H3>
|
|
|
hashCode</H3>
|
|
|
<PRE>
|
|
|
public int <B>hashCode</B>()</PRE>
|
|
|
<DL>
|
|
|
<DD><DL>
|
|
|
<DT><B>Overrides:</B><DD><CODE>hashCode</CODE> in class <CODE>java.lang.Object</CODE></DL>
|
|
|
</DD>
|
|
|
<DD><DL>
|
|
|
</DL>
|
|
|
</DD>
|
|
|
</DL>
|
|
|
<HR>
|
|
|
|
|
|
<A NAME="equals(java.lang.Object)"><!-- --></A><H3>
|
|
|
equals</H3>
|
|
|
<PRE>
|
|
|
public boolean <B>equals</B>(java.lang.Object obj)</PRE>
|
|
|
<DL>
|
|
|
<DD><DL>
|
|
|
<DT><B>Overrides:</B><DD><CODE>equals</CODE> in class <CODE>java.lang.Object</CODE></DL>
|
|
|
</DD>
|
|
|
<DD><DL>
|
|
|
</DL>
|
|
|
</DD>
|
|
|
</DL>
|
|
|
<HR>
|
|
|
|
|
|
<A NAME="toString()"><!-- --></A><H3>
|
|
|
toString</H3>
|
|
|
<PRE>
|
|
|
public java.lang.String <B>toString</B>()</PRE>
|
|
|
<DL>
|
|
|
<DD><DL>
|
|
|
<DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL>
|
|
|
</DD>
|
|
|
<DD><DL>
|
|
|
</DL>
|
|
|
</DD>
|
|
|
</DL>
|
|
|
<!-- ========= END OF CLASS DATA ========= -->
|
|
|
<HR>
|
|
|
|
|
|
|
|
|
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
|
|
<A NAME="navbar_bottom"><!-- --></A>
|
|
|
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
|
|
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
|
|
<TR>
|
|
|
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
|
|
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
|
|
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
|
|
<TR ALIGN="center" VALIGN="top">
|
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../com/google/i18n/phonenumbers/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
|
|
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
|
|
</TR>
|
|
|
</TABLE>
|
|
|
</TD>
|
|
|
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
|
|
</EM>
|
|
|
</TD>
|
|
|
</TR>
|
|
|
|
|
|
<TR>
|
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
|
<A HREF="../../../../com/google/i18n/phonenumbers/NumberParseException.ErrorType.html" title="enum in com.google.i18n.phonenumbers"><B>PREV CLASS</B></A>
|
|
|
<A HREF="../../../../com/google/i18n/phonenumbers/PhoneNumberUtil.html" title="class in com.google.i18n.phonenumbers"><B>NEXT CLASS</B></A></FONT></TD>
|
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
|
<A HREF="../../../../index.html?com/google/i18n/phonenumbers/PhoneNumberMatch.html" target="_top"><B>FRAMES</B></A>
|
|
|
<A HREF="PhoneNumberMatch.html" target="_top"><B>NO FRAMES</B></A>
|
|
|
<SCRIPT type="text/javascript">
|
|
|
<!--
|
|
|
if(window==top) {
|
|
|
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
|
|
}
|
|
|
//-->
|
|
|
</SCRIPT>
|
|
|
<NOSCRIPT>
|
|
|
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
|
|
|
</NOSCRIPT>
|
|
|
|
|
|
|
|
|
</FONT></TD>
|
|
|
</TR>
|
|
|
<TR>
|
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
|
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
|
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
|
|
</TR>
|
|
|
</TABLE>
|
|
|
<A NAME="skip-navbar_bottom"></A>
|
|
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
|
|
|
|
|
<HR>
|
|
|
|
|
|
</BODY>
|
|
|
</HTML>
|