PageRenderTime 111ms CodeModel.GetById 69ms app.highlight 33ms RepoModel.GetById 1ms app.codeStats 0ms

/www/tags/NOV_07_2009/htdocs/api/org/gjt/sp/util/StandardUtilities.html

#
HTML | 661 lines | 583 code | 67 blank | 11 comment | 0 complexity | e5d4a13128752008787c1db97f763790 MD5 | raw file
  1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2<!--NewPage-->
  3<HTML>
  4<HEAD>
  5<!-- Generated by javadoc (build 1.5.0_14) on Tue Jul 22 07:14:16 GMT-08:00 2008 -->
  6<TITLE>
  7StandardUtilities (jEdit API)
  8</TITLE>
  9
 10<META NAME="keywords" CONTENT="org.gjt.sp.util.StandardUtilities class">
 11
 12<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
 13
 14
 15<NOSCRIPT>
 16</NOSCRIPT>
 17
 18</HEAD>
 19
 20<BODY BGCOLOR="white" >
 21
 22
 23<!-- ========= START OF TOP NAVBAR ======= -->
 24<A NAME="navbar_top"><!-- --></A>
 25<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
 26<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
 27<TR>
 28<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
 29<A NAME="navbar_top_firstrow"><!-- --></A>
 30<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
 31  <TR ALIGN="center" VALIGN="top">
 32  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
 33  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
 34  <TD BGCOLOR="#00008B" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
 35  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/StandardUtilities.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
 36  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
 37  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
 38  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
 39  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
 40  </TR>
 41</TABLE>
 42</TD>
 43<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
 44</EM>
 45</TD>
 46</TR>
 47
 48<TR>
 49<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
 50&nbsp;<A HREF="../../../../org/gjt/sp/util/SegmentCharSequence.html" title="class in org.gjt.sp.util"><B>PREV CLASS</B></A>&nbsp;
 51&nbsp;<A HREF="../../../../org/gjt/sp/util/StandardUtilities.StringCompare.html" title="class in org.gjt.sp.util"><B>NEXT CLASS</B></A></FONT></TD>
 52<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
 53  <A HREF="../../../../index.html?org/gjt/sp/util/StandardUtilities.html" target="_top"><B>FRAMES</B></A>  &nbsp;
 54&nbsp;<A HREF="StandardUtilities.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
 55&nbsp;
 56<NOSCRIPT>
 57  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
 58</NOSCRIPT>
 59
 60
 61</FONT></TD>
 62</TR>
 63<TR>
 64<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
 65  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
 66<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
 67DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
 68</TR>
 69</TABLE>
 70<A NAME="skip-navbar_top"></A>
 71<!-- ========= END OF TOP NAVBAR ========= -->
 72
 73<HR>
 74<!-- ======== START OF CLASS DATA ======== -->
 75<H2>
 76<FONT SIZE="-1">
 77org.gjt.sp.util</FONT>
 78<BR>
 79Class StandardUtilities</H2>
 80<PRE>
 81java.lang.Object
 82  <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.gjt.sp.util.StandardUtilities</B>
 83</PRE>
 84<HR>
 85<DL>
 86<DT><PRE>public class <B>StandardUtilities</B><DT>extends java.lang.Object</DL>
 87</PRE>
 88
 89<P>
 90Several tools that depends on JDK only.
 91<P>
 92
 93<P>
 94<DL>
 95<DT><B>Since:</B></DT>
 96  <DD>4.3pre5</DD>
 97</DL>
 98<HR>
 99
100<P>
101<!-- ======== NESTED CLASS SUMMARY ======== -->
102
103<A NAME="nested_class_summary"><!-- --></A>
104<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
105<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
106<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
107<B>Nested Class Summary</B></FONT></TH>
108</TR>
109<TR BGCOLOR="white" CLASS="TableRowColor">
110<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
111<CODE>static&nbsp;class</CODE></FONT></TD>
112<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/StandardUtilities.StringCompare.html" title="class in org.gjt.sp.util">StandardUtilities.StringCompare</A></B></CODE>
113
114<BR>
115&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compares objects as strings.</TD>
116</TR>
117</TABLE>
118&nbsp;
119<!-- ========== METHOD SUMMARY =========== -->
120
121<A NAME="method_summary"><!-- --></A>
122<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
123<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
124<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
125<B>Method Summary</B></FONT></TH>
126</TR>
127<TR BGCOLOR="white" CLASS="TableRowColor">
128<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
129<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
130<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/StandardUtilities.html#charsToEscapes(java.lang.String)">charsToEscapes</A></B>(java.lang.String&nbsp;str)</CODE>
131
132<BR>
133&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Escapes newlines, tabs, backslashes, and quotes in the specified
134 string.</TD>
135</TR>
136<TR BGCOLOR="white" CLASS="TableRowColor">
137<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
138<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
139<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/StandardUtilities.html#charsToEscapes(java.lang.String, java.lang.String)">charsToEscapes</A></B>(java.lang.String&nbsp;str,
140               java.lang.String&nbsp;toEscape)</CODE>
141
142<BR>
143&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Escapes the specified characters in the specified string.</TD>
144</TR>
145<TR BGCOLOR="white" CLASS="TableRowColor">
146<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
147<CODE>static&nbsp;int</CODE></FONT></TD>
148<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/StandardUtilities.html#compareStrings(java.lang.String, java.lang.String, boolean)">compareStrings</A></B>(java.lang.String&nbsp;str1,
149               java.lang.String&nbsp;str2,
150               boolean&nbsp;ignoreCase)</CODE>
151
152<BR>
153&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compares two strings.</TD>
154</TR>
155<TR BGCOLOR="white" CLASS="TableRowColor">
156<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
157<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
158<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/StandardUtilities.html#createWhiteSpace(int, int)">createWhiteSpace</A></B>(int&nbsp;len,
159                 int&nbsp;tabSize)</CODE>
160
161<BR>
162&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a string of white space with the specified length.</TD>
163</TR>
164<TR BGCOLOR="white" CLASS="TableRowColor">
165<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
166<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
167<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/StandardUtilities.html#createWhiteSpace(int, int, int)">createWhiteSpace</A></B>(int&nbsp;len,
168                 int&nbsp;tabSize,
169                 int&nbsp;start)</CODE>
170
171<BR>
172&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a string of white space with the specified length.</TD>
173</TR>
174<TR BGCOLOR="white" CLASS="TableRowColor">
175<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
176<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
177<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/StandardUtilities.html#getIndentString(java.lang.String)">getIndentString</A></B>(java.lang.String&nbsp;str)</CODE>
178
179<BR>
180&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
181</TR>
182<TR BGCOLOR="white" CLASS="TableRowColor">
183<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
184<CODE>static&nbsp;int</CODE></FONT></TD>
185<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/StandardUtilities.html#getLeadingWhiteSpace(java.lang.CharSequence)">getLeadingWhiteSpace</A></B>(java.lang.CharSequence&nbsp;str)</CODE>
186
187<BR>
188&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of leading white space characters in the
189 specified string.</TD>
190</TR>
191<TR BGCOLOR="white" CLASS="TableRowColor">
192<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
193<CODE>static&nbsp;int</CODE></FONT></TD>
194<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/StandardUtilities.html#getLeadingWhiteSpace(java.lang.String)">getLeadingWhiteSpace</A></B>(java.lang.String&nbsp;str)</CODE>
195
196<BR>
197&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of leading white space characters in the
198 specified string.</TD>
199</TR>
200<TR BGCOLOR="white" CLASS="TableRowColor">
201<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
202<CODE>static&nbsp;int</CODE></FONT></TD>
203<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/StandardUtilities.html#getLeadingWhiteSpaceWidth(java.lang.CharSequence, int)">getLeadingWhiteSpaceWidth</A></B>(java.lang.CharSequence&nbsp;str,
204                          int&nbsp;tabSize)</CODE>
205
206<BR>
207&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the width of the leading white space in the specified
208 string.</TD>
209</TR>
210<TR BGCOLOR="white" CLASS="TableRowColor">
211<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
212<CODE>static&nbsp;int</CODE></FONT></TD>
213<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/StandardUtilities.html#getLeadingWhiteSpaceWidth(java.lang.String, int)">getLeadingWhiteSpaceWidth</A></B>(java.lang.String&nbsp;str,
214                          int&nbsp;tabSize)</CODE>
215
216<BR>
217&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the width of the leading white space in the specified
218 string.</TD>
219</TR>
220<TR BGCOLOR="white" CLASS="TableRowColor">
221<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
222<CODE>static&nbsp;int</CODE></FONT></TD>
223<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/StandardUtilities.html#getOffsetOfVirtualColumn(javax.swing.text.Segment, int, int, int[])">getOffsetOfVirtualColumn</A></B>(javax.swing.text.Segment&nbsp;seg,
224                         int&nbsp;tabSize,
225                         int&nbsp;column,
226                         int[]&nbsp;totalVirtualWidth)</CODE>
227
228<BR>
229&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the array offset of a virtual column number (taking tabs
230 into account) in the segment.</TD>
231</TR>
232<TR BGCOLOR="white" CLASS="TableRowColor">
233<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
234<CODE>static&nbsp;int</CODE></FONT></TD>
235<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/StandardUtilities.html#getTrailingWhiteSpace(java.lang.String)">getTrailingWhiteSpace</A></B>(java.lang.String&nbsp;str)</CODE>
236
237<BR>
238&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of trailing whitespace characters in the
239 specified string.</TD>
240</TR>
241<TR BGCOLOR="white" CLASS="TableRowColor">
242<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
243<CODE>static&nbsp;int</CODE></FONT></TD>
244<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/StandardUtilities.html#getVirtualWidth(javax.swing.text.Segment, int)">getVirtualWidth</A></B>(javax.swing.text.Segment&nbsp;seg,
245                int&nbsp;tabSize)</CODE>
246
247<BR>
248&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the virtual column number (taking tabs into account) of the
249 specified offset in the segment.</TD>
250</TR>
251<TR BGCOLOR="white" CLASS="TableRowColor">
252<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
253<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
254<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/StandardUtilities.html#globToRE(java.lang.String)">globToRE</A></B>(java.lang.String&nbsp;glob)</CODE>
255
256<BR>
257&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts a Unix-style glob to a regular expression.</TD>
258</TR>
259<TR BGCOLOR="white" CLASS="TableRowColor">
260<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
261<CODE>static&nbsp;boolean</CODE></FONT></TD>
262<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/StandardUtilities.html#objectsEqual(java.lang.Object, java.lang.Object)">objectsEqual</A></B>(java.lang.Object&nbsp;o1,
263             java.lang.Object&nbsp;o2)</CODE>
264
265<BR>
266&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns if two strings are equal.</TD>
267</TR>
268<TR BGCOLOR="white" CLASS="TableRowColor">
269<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
270<CODE>static&nbsp;boolean</CODE></FONT></TD>
271<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/StandardUtilities.html#regionMatches(java.lang.CharSequence, int, java.lang.CharSequence, int, int)">regionMatches</A></B>(java.lang.CharSequence&nbsp;seq,
272              int&nbsp;toff,
273              java.lang.CharSequence&nbsp;other,
274              int&nbsp;ooff,
275              int&nbsp;len)</CODE>
276
277<BR>
278&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Implementation of String.regionMatches() for CharSequence.</TD>
279</TR>
280<TR BGCOLOR="white" CLASS="TableRowColor">
281<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
282<CODE>static&nbsp;boolean</CODE></FONT></TD>
283<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/StandardUtilities.html#startsWith(java.lang.CharSequence, java.lang.String)">startsWith</A></B>(java.lang.CharSequence&nbsp;seq,
284           java.lang.String&nbsp;str)</CODE>
285
286<BR>
287&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Implementation of String.startsWith() for CharSequence.</TD>
288</TR>
289</TABLE>
290&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
291<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
292<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
293<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
294</TR>
295<TR BGCOLOR="white" CLASS="TableRowColor">
296<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
297</TR>
298</TABLE>
299&nbsp;
300<P>
301
302<!-- ============ METHOD DETAIL ========== -->
303
304<A NAME="method_detail"><!-- --></A>
305<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
306<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
307<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
308<B>Method Detail</B></FONT></TH>
309</TR>
310</TABLE>
311
312<A NAME="charsToEscapes(java.lang.String)"><!-- --></A><H3>
313charsToEscapes</H3>
314<PRE>
315public static java.lang.String <B>charsToEscapes</B>(java.lang.String&nbsp;str)</PRE>
316<DL>
317<DD>Escapes newlines, tabs, backslashes, and quotes in the specified
318 string.
319<P>
320<DD><DL>
321<DT><B>Parameters:</B><DD><CODE>str</CODE> - The string<DT><B>Since:</B></DT>
322  <DD>jEdit 4.3pre15</DD>
323</DL>
324</DD>
325</DL>
326<HR>
327
328<A NAME="charsToEscapes(java.lang.String, java.lang.String)"><!-- --></A><H3>
329charsToEscapes</H3>
330<PRE>
331public static java.lang.String <B>charsToEscapes</B>(java.lang.String&nbsp;str,
332                                              java.lang.String&nbsp;toEscape)</PRE>
333<DL>
334<DD>Escapes the specified characters in the specified string.
335<P>
336<DD><DL>
337<DT><B>Parameters:</B><DD><CODE>str</CODE> - The string<DD><CODE>toEscape</CODE> - Any characters that require escaping<DT><B>Since:</B></DT>
338  <DD>jEdit 4.3pre15</DD>
339</DL>
340</DD>
341</DL>
342<HR>
343
344<A NAME="getIndentString(java.lang.String)"><!-- --></A><H3>
345getIndentString</H3>
346<PRE>
347public static java.lang.String <B>getIndentString</B>(java.lang.String&nbsp;str)</PRE>
348<DL>
349<DD><DL>
350<DT><B>Parameters:</B><DD><CODE>str</CODE> - A java string
351<DT><B>Returns:</B><DD>the leading whitespace of that string, for indenting subsequent lines.<DT><B>Since:</B></DT>
352  <DD>jEdit 4.3pre10</DD>
353</DL>
354</DD>
355</DL>
356<HR>
357
358<A NAME="getLeadingWhiteSpace(java.lang.String)"><!-- --></A><H3>
359getLeadingWhiteSpace</H3>
360<PRE>
361public static int <B>getLeadingWhiteSpace</B>(java.lang.String&nbsp;str)</PRE>
362<DL>
363<DD>Returns the number of leading white space characters in the
364 specified string.
365<P>
366<DD><DL>
367<DT><B>Parameters:</B><DD><CODE>str</CODE> - The string</DL>
368</DD>
369</DL>
370<HR>
371
372<A NAME="getLeadingWhiteSpace(java.lang.CharSequence)"><!-- --></A><H3>
373getLeadingWhiteSpace</H3>
374<PRE>
375public static int <B>getLeadingWhiteSpace</B>(java.lang.CharSequence&nbsp;str)</PRE>
376<DL>
377<DD>Returns the number of leading white space characters in the
378 specified string.
379<P>
380<DD><DL>
381<DT><B>Parameters:</B><DD><CODE>str</CODE> - The string<DT><B>Since:</B></DT>
382  <DD>jEdit 4.3pre15</DD>
383</DL>
384</DD>
385</DL>
386<HR>
387
388<A NAME="getTrailingWhiteSpace(java.lang.String)"><!-- --></A><H3>
389getTrailingWhiteSpace</H3>
390<PRE>
391public static int <B>getTrailingWhiteSpace</B>(java.lang.String&nbsp;str)</PRE>
392<DL>
393<DD>Returns the number of trailing whitespace characters in the
394 specified string.
395<P>
396<DD><DL>
397<DT><B>Parameters:</B><DD><CODE>str</CODE> - The string</DL>
398</DD>
399</DL>
400<HR>
401
402<A NAME="getLeadingWhiteSpaceWidth(java.lang.String, int)"><!-- --></A><H3>
403getLeadingWhiteSpaceWidth</H3>
404<PRE>
405public static int <B>getLeadingWhiteSpaceWidth</B>(java.lang.String&nbsp;str,
406                                            int&nbsp;tabSize)</PRE>
407<DL>
408<DD>Returns the width of the leading white space in the specified
409 string.
410<P>
411<DD><DL>
412<DT><B>Parameters:</B><DD><CODE>str</CODE> - The string<DD><CODE>tabSize</CODE> - The tab size</DL>
413</DD>
414</DL>
415<HR>
416
417<A NAME="getLeadingWhiteSpaceWidth(java.lang.CharSequence, int)"><!-- --></A><H3>
418getLeadingWhiteSpaceWidth</H3>
419<PRE>
420public static int <B>getLeadingWhiteSpaceWidth</B>(java.lang.CharSequence&nbsp;str,
421                                            int&nbsp;tabSize)</PRE>
422<DL>
423<DD>Returns the width of the leading white space in the specified
424 string.
425<P>
426<DD><DL>
427<DT><B>Parameters:</B><DD><CODE>str</CODE> - The string<DD><CODE>tabSize</CODE> - The tab size<DT><B>Since:</B></DT>
428  <DD>jEdit 4.3pre15</DD>
429</DL>
430</DD>
431</DL>
432<HR>
433
434<A NAME="createWhiteSpace(int, int)"><!-- --></A><H3>
435createWhiteSpace</H3>
436<PRE>
437public static java.lang.String <B>createWhiteSpace</B>(int&nbsp;len,
438                                                int&nbsp;tabSize)</PRE>
439<DL>
440<DD>Creates a string of white space with the specified length.<p>
441
442 To get a whitespace string tuned to the current buffer's
443 settings, call this method as follows:
444
445 <pre>myWhitespace = MiscUtilities.createWhiteSpace(myLength,
446     (buffer.getBooleanProperty("noTabs") ? 0
447     : buffer.getTabSize()));</pre>
448<P>
449<DD><DL>
450<DT><B>Parameters:</B><DD><CODE>len</CODE> - The length<DD><CODE>tabSize</CODE> - The tab size, or 0 if tabs are not to be used</DL>
451</DD>
452</DL>
453<HR>
454
455<A NAME="createWhiteSpace(int, int, int)"><!-- --></A><H3>
456createWhiteSpace</H3>
457<PRE>
458public static java.lang.String <B>createWhiteSpace</B>(int&nbsp;len,
459                                                int&nbsp;tabSize,
460                                                int&nbsp;start)</PRE>
461<DL>
462<DD>Creates a string of white space with the specified length.<p>
463
464 To get a whitespace string tuned to the current buffer's
465 settings, call this method as follows:
466
467 <pre>myWhitespace = MiscUtilities.createWhiteSpace(myLength,
468     (buffer.getBooleanProperty("noTabs") ? 0
469     : buffer.getTabSize()));</pre>
470<P>
471<DD><DL>
472<DT><B>Parameters:</B><DD><CODE>len</CODE> - The length<DD><CODE>tabSize</CODE> - The tab size, or 0 if tabs are not to be used<DD><CODE>start</CODE> - The start offset, for tab alignment</DL>
473</DD>
474</DL>
475<HR>
476
477<A NAME="getVirtualWidth(javax.swing.text.Segment, int)"><!-- --></A><H3>
478getVirtualWidth</H3>
479<PRE>
480public static int <B>getVirtualWidth</B>(javax.swing.text.Segment&nbsp;seg,
481                                  int&nbsp;tabSize)</PRE>
482<DL>
483<DD>Returns the virtual column number (taking tabs into account) of the
484 specified offset in the segment.
485<P>
486<DD><DL>
487<DT><B>Parameters:</B><DD><CODE>seg</CODE> - The segment<DD><CODE>tabSize</CODE> - The tab size</DL>
488</DD>
489</DL>
490<HR>
491
492<A NAME="getOffsetOfVirtualColumn(javax.swing.text.Segment, int, int, int[])"><!-- --></A><H3>
493getOffsetOfVirtualColumn</H3>
494<PRE>
495public static int <B>getOffsetOfVirtualColumn</B>(javax.swing.text.Segment&nbsp;seg,
496                                           int&nbsp;tabSize,
497                                           int&nbsp;column,
498                                           int[]&nbsp;totalVirtualWidth)</PRE>
499<DL>
500<DD>Returns the array offset of a virtual column number (taking tabs
501 into account) in the segment.
502<P>
503<DD><DL>
504<DT><B>Parameters:</B><DD><CODE>seg</CODE> - The segment<DD><CODE>tabSize</CODE> - The tab size<DD><CODE>column</CODE> - The virtual column number<DD><CODE>totalVirtualWidth</CODE> - If this array is non-null, the total
505 virtual width will be stored in its first location if this method
506 returns -1.
507<DT><B>Returns:</B><DD>-1 if the column is out of bounds</DL>
508</DD>
509</DL>
510<HR>
511
512<A NAME="compareStrings(java.lang.String, java.lang.String, boolean)"><!-- --></A><H3>
513compareStrings</H3>
514<PRE>
515public static int <B>compareStrings</B>(java.lang.String&nbsp;str1,
516                                 java.lang.String&nbsp;str2,
517                                 boolean&nbsp;ignoreCase)</PRE>
518<DL>
519<DD>Compares two strings.<p>
520
521 Unlike <function>String.compareTo()</function>,
522 this method correctly recognizes and handles embedded numbers.
523 For example, it places "My file 2" before "My file 10".<p>
524<P>
525<DD><DL>
526<DT><B>Parameters:</B><DD><CODE>str1</CODE> - The first string<DD><CODE>str2</CODE> - The second string<DD><CODE>ignoreCase</CODE> - If true, case will be ignored
527<DT><B>Returns:</B><DD>negative If str1 &lt; str2, 0 if both are the same,
528 positive if str1 &gt; str2<DT><B>Since:</B></DT>
529  <DD>jEdit 4.3pre5</DD>
530</DL>
531</DD>
532</DL>
533<HR>
534
535<A NAME="objectsEqual(java.lang.Object, java.lang.Object)"><!-- --></A><H3>
536objectsEqual</H3>
537<PRE>
538public static boolean <B>objectsEqual</B>(java.lang.Object&nbsp;o1,
539                                   java.lang.Object&nbsp;o2)</PRE>
540<DL>
541<DD>Returns if two strings are equal. This correctly handles null pointers,
542 as opposed to calling <code>o1.equals(o2)</code>.
543<P>
544<DD><DL>
545<DT><B>Since:</B></DT>
546  <DD>jEdit 4.3pre6</DD>
547</DL>
548</DD>
549</DL>
550<HR>
551
552<A NAME="globToRE(java.lang.String)"><!-- --></A><H3>
553globToRE</H3>
554<PRE>
555public static java.lang.String <B>globToRE</B>(java.lang.String&nbsp;glob)</PRE>
556<DL>
557<DD>Converts a Unix-style glob to a regular expression.<p>
558
559 ? becomes ., * becomes .*, {aa,bb} becomes (aa|bb).
560<P>
561<DD><DL>
562<DT><B>Parameters:</B><DD><CODE>glob</CODE> - The glob pattern<DT><B>Since:</B></DT>
563  <DD>jEdit 4.3pre7</DD>
564</DL>
565</DD>
566</DL>
567<HR>
568
569<A NAME="regionMatches(java.lang.CharSequence, int, java.lang.CharSequence, int, int)"><!-- --></A><H3>
570regionMatches</H3>
571<PRE>
572public static boolean <B>regionMatches</B>(java.lang.CharSequence&nbsp;seq,
573                                    int&nbsp;toff,
574                                    java.lang.CharSequence&nbsp;other,
575                                    int&nbsp;ooff,
576                                    int&nbsp;len)</PRE>
577<DL>
578<DD>Implementation of String.regionMatches() for CharSequence.
579<P>
580<DD><DL>
581<DT><B>Parameters:</B><DD><CODE>seq</CODE> - The test CharSequence.<DD><CODE>toff</CODE> - Offset for the test sequence.<DD><CODE>other</CODE> - The sequence to compare to.<DD><CODE>ooff</CODE> - Offset of the comparison sequence.<DD><CODE>len</CODE> - How many characters to compare.
582<DT><B>Returns:</B><DD>Whether the two subsequences are equal.<DT><B>Since:</B></DT>
583  <DD>jEdit 4.3pre15</DD>
584<DT><B>See Also:</B><DD><CODE>String.regionMatches(int,String,int,int)</CODE></DL>
585</DD>
586</DL>
587<HR>
588
589<A NAME="startsWith(java.lang.CharSequence, java.lang.String)"><!-- --></A><H3>
590startsWith</H3>
591<PRE>
592public static boolean <B>startsWith</B>(java.lang.CharSequence&nbsp;seq,
593                                 java.lang.String&nbsp;str)</PRE>
594<DL>
595<DD>Implementation of String.startsWith() for CharSequence.
596<P>
597<DD><DL>
598<DT><B>Parameters:</B><DD><CODE>seq</CODE> - The CharSequence.<DD><CODE>str</CODE> - String to test.
599<DT><B>Returns:</B><DD>Whether the sequence starts with the test string.<DT><B>Since:</B></DT>
600  <DD>jEdit 4.3pre15</DD>
601</DL>
602</DD>
603</DL>
604<!-- ========= END OF CLASS DATA ========= -->
605<HR>
606
607
608<!-- ======= START OF BOTTOM NAVBAR ====== -->
609<A NAME="navbar_bottom"><!-- --></A>
610<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
611<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
612<TR>
613<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
614<A NAME="navbar_bottom_firstrow"><!-- --></A>
615<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
616  <TR ALIGN="center" VALIGN="top">
617  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
618  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
619  <TD BGCOLOR="#00008B" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
620  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/StandardUtilities.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
621  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
622  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
623  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
624  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
625  </TR>
626</TABLE>
627</TD>
628<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
629</EM>
630</TD>
631</TR>
632
633<TR>
634<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
635&nbsp;<A HREF="../../../../org/gjt/sp/util/SegmentCharSequence.html" title="class in org.gjt.sp.util"><B>PREV CLASS</B></A>&nbsp;
636&nbsp;<A HREF="../../../../org/gjt/sp/util/StandardUtilities.StringCompare.html" title="class in org.gjt.sp.util"><B>NEXT CLASS</B></A></FONT></TD>
637<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
638  <A HREF="../../../../index.html?org/gjt/sp/util/StandardUtilities.html" target="_top"><B>FRAMES</B></A>  &nbsp;
639&nbsp;<A HREF="StandardUtilities.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
640&nbsp;
641<NOSCRIPT>
642  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
643</NOSCRIPT>
644
645
646</FONT></TD>
647</TR>
648<TR>
649<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
650  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
651<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
652DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
653</TR>
654</TABLE>
655<A NAME="skip-navbar_bottom"></A>
656<!-- ======== END OF BOTTOM NAVBAR ======= -->
657
658<HR>
659
660</BODY>
661</HTML>