PageRenderTime 59ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 1ms

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