/www/tags/NOV_07_2009/htdocs/api/org/gjt/sp/jedit/syntax/KeywordMap.html
HTML | 456 lines | 393 code | 51 blank | 12 comment | 0 complexity | 42e1c748cf81e13a493606c1eb667af6 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
- <!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.5.0_14) on Tue Jul 22 07:14:13 GMT-08:00 2008 -->
- <TITLE>
- KeywordMap (jEdit API)
- </TITLE>
- <META NAME="keywords" CONTENT="org.gjt.sp.jedit.syntax.KeywordMap class">
- <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
- <NOSCRIPT>
- </NOSCRIPT>
- </HEAD>
- <BODY BGCOLOR="white" >
- <!-- ========= 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="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
- <TD BGCOLOR="#00008B" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/KeywordMap.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </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-files/index-1.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="../../../../../org/gjt/sp/jedit/syntax/DummyTokenHandler.html" title="class in org.gjt.sp.jedit.syntax"><B>PREV CLASS</B></A>
- <A HREF="../../../../../org/gjt/sp/jedit/syntax/ModeProvider.html" title="class in org.gjt.sp.jedit.syntax"><B>NEXT CLASS</B></A></FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../../index.html?org/gjt/sp/jedit/syntax/KeywordMap.html" target="_top"><B>FRAMES</B></A>
- <A HREF="KeywordMap.html" target="_top"><B>NO FRAMES</B></A>
-
- <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 | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <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">
- org.gjt.sp.jedit.syntax</FONT>
- <BR>
- Class KeywordMap</H2>
- <PRE>
- java.lang.Object
- <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.gjt.sp.jedit.syntax.KeywordMap</B>
- </PRE>
- <HR>
- <DL>
- <DT><PRE>public class <B>KeywordMap</B><DT>extends java.lang.Object</DL>
- </PRE>
- <P>
- A <code>KeywordMap</code> is similar to a hashtable in that it maps keys
- to values. However, the `keys' are Swing segments. This allows lookups of
- text substrings without the overhead of creating a new string object.
- <P>
- <P>
- <HR>
- <P>
- <!-- ======== CONSTRUCTOR SUMMARY ======== -->
- <A NAME="constructor_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>Constructor Summary</B></FONT></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><B><A HREF="../../../../../org/gjt/sp/jedit/syntax/KeywordMap.html#KeywordMap(boolean)">KeywordMap</A></B>(boolean ignoreCase)</CODE>
- <BR>
- Creates a new <code>KeywordMap</code>.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><B><A HREF="../../../../../org/gjt/sp/jedit/syntax/KeywordMap.html#KeywordMap(boolean, int)">KeywordMap</A></B>(boolean ignoreCase,
- int mapLength)</CODE>
- <BR>
- Creates a new <code>KeywordMap</code>.</TD>
- </TR>
- </TABLE>
-
- <!-- ========== 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> void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../org/gjt/sp/jedit/syntax/KeywordMap.html#add(char[], byte)">add</A></B>(char[] keyword,
- byte id)</CODE>
- <BR>
- Adds a key-value mapping.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../org/gjt/sp/jedit/syntax/KeywordMap.html#add(org.gjt.sp.jedit.syntax.KeywordMap)">add</A></B>(<A HREF="../../../../../org/gjt/sp/jedit/syntax/KeywordMap.html" title="class in org.gjt.sp.jedit.syntax">KeywordMap</A> map)</CODE>
- <BR>
- Adds the content of another keyword map to this one.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../org/gjt/sp/jedit/syntax/KeywordMap.html#add(java.lang.String, byte)">add</A></B>(java.lang.String keyword,
- byte id)</CODE>
- <BR>
- Adds a key-value mapping.</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="../../../../../org/gjt/sp/jedit/syntax/KeywordMap.html#getIgnoreCase()">getIgnoreCase</A></B>()</CODE>
- <BR>
- Returns true if the keyword map is set to be case insensitive,
- false otherwise.</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="../../../../../org/gjt/sp/jedit/syntax/KeywordMap.html#getKeywords()">getKeywords</A></B>()</CODE>
- <BR>
- Returns an array containing all keywords in this keyword map.</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="../../../../../org/gjt/sp/jedit/syntax/KeywordMap.html#getNonAlphaNumericChars()">getNonAlphaNumericChars</A></B>()</CODE>
- <BR>
- Returns all non-alphanumeric characters that appear in the
- keywords of this keyword map.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected int</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../org/gjt/sp/jedit/syntax/KeywordMap.html#getSegmentMapKey(javax.swing.text.Segment, int, int)">getSegmentMapKey</A></B>(javax.swing.text.Segment s,
- int off,
- int len)</CODE>
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> byte</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../org/gjt/sp/jedit/syntax/KeywordMap.html#lookup(javax.swing.text.Segment, int, int)">lookup</A></B>(javax.swing.text.Segment text,
- int offset,
- int length)</CODE>
- <BR>
- Looks up a key.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../org/gjt/sp/jedit/syntax/KeywordMap.html#setIgnoreCase(boolean)">setIgnoreCase</A></B>(boolean ignoreCase)</CODE>
- <BR>
- Sets if the keyword map should be case insensitive.</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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
- </TR>
- </TABLE>
-
- <P>
- <!-- ========= CONSTRUCTOR DETAIL ======== -->
- <A NAME="constructor_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>Constructor Detail</B></FONT></TH>
- </TR>
- </TABLE>
- <A NAME="KeywordMap(boolean)"><!-- --></A><H3>
- KeywordMap</H3>
- <PRE>
- public <B>KeywordMap</B>(boolean ignoreCase)</PRE>
- <DL>
- <DD>Creates a new <code>KeywordMap</code>.
- <P>
- <DL>
- <DT><B>Parameters:</B><DD><CODE>ignoreCase</CODE> - True if keys are case insensitive</DL>
- </DL>
- <HR>
- <A NAME="KeywordMap(boolean, int)"><!-- --></A><H3>
- KeywordMap</H3>
- <PRE>
- public <B>KeywordMap</B>(boolean ignoreCase,
- int mapLength)</PRE>
- <DL>
- <DD>Creates a new <code>KeywordMap</code>.
- <P>
- <DL>
- <DT><B>Parameters:</B><DD><CODE>ignoreCase</CODE> - True if the keys are case insensitive<DD><CODE>mapLength</CODE> - The number of `buckets' to create.
- A value of 52 will give good performance for most maps.</DL>
- </DL>
- <!-- ============ 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="lookup(javax.swing.text.Segment, int, int)"><!-- --></A><H3>
- lookup</H3>
- <PRE>
- public byte <B>lookup</B>(javax.swing.text.Segment text,
- int offset,
- int length)</PRE>
- <DL>
- <DD>Looks up a key.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>text</CODE> - The text segment<DD><CODE>offset</CODE> - The offset of the substring within the text segment<DD><CODE>length</CODE> - The length of the substring</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="add(java.lang.String, byte)"><!-- --></A><H3>
- add</H3>
- <PRE>
- public void <B>add</B>(java.lang.String keyword,
- byte id)</PRE>
- <DL>
- <DD>Adds a key-value mapping.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>keyword</CODE> - The key<DD><CODE>id</CODE> - The value</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="add(char[], byte)"><!-- --></A><H3>
- add</H3>
- <PRE>
- public void <B>add</B>(char[] keyword,
- byte id)</PRE>
- <DL>
- <DD>Adds a key-value mapping.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>keyword</CODE> - The key<DD><CODE>id</CODE> - The value<DT><B>Since:</B></DT>
- <DD>jEdit 4.2pre3</DD>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="getNonAlphaNumericChars()"><!-- --></A><H3>
- getNonAlphaNumericChars</H3>
- <PRE>
- public java.lang.String <B>getNonAlphaNumericChars</B>()</PRE>
- <DL>
- <DD>Returns all non-alphanumeric characters that appear in the
- keywords of this keyword map.
- <P>
- <DD><DL>
- <DT><B>Since:</B></DT>
- <DD>jEdit 4.0pre3</DD>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="getKeywords()"><!-- --></A><H3>
- getKeywords</H3>
- <PRE>
- public java.lang.String[] <B>getKeywords</B>()</PRE>
- <DL>
- <DD>Returns an array containing all keywords in this keyword map.
- <P>
- <DD><DL>
- <DT><B>Since:</B></DT>
- <DD>jEdit 4.0pre3</DD>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="getIgnoreCase()"><!-- --></A><H3>
- getIgnoreCase</H3>
- <PRE>
- public boolean <B>getIgnoreCase</B>()</PRE>
- <DL>
- <DD>Returns true if the keyword map is set to be case insensitive,
- false otherwise.
- <P>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="setIgnoreCase(boolean)"><!-- --></A><H3>
- setIgnoreCase</H3>
- <PRE>
- public void <B>setIgnoreCase</B>(boolean ignoreCase)</PRE>
- <DL>
- <DD>Sets if the keyword map should be case insensitive.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>ignoreCase</CODE> - True if the keyword map should be case
- insensitive, false otherwise</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="add(org.gjt.sp.jedit.syntax.KeywordMap)"><!-- --></A><H3>
- add</H3>
- <PRE>
- public void <B>add</B>(<A HREF="../../../../../org/gjt/sp/jedit/syntax/KeywordMap.html" title="class in org.gjt.sp.jedit.syntax">KeywordMap</A> map)</PRE>
- <DL>
- <DD>Adds the content of another keyword map to this one.
- <P>
- <DD><DL>
- <DT><B>Since:</B></DT>
- <DD>jEdit 4.2pre3</DD>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="getSegmentMapKey(javax.swing.text.Segment, int, int)"><!-- --></A><H3>
- getSegmentMapKey</H3>
- <PRE>
- protected int <B>getSegmentMapKey</B>(javax.swing.text.Segment s,
- int off,
- int len)</PRE>
- <DL>
- <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="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
- <TD BGCOLOR="#00008B" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/KeywordMap.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </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-files/index-1.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="../../../../../org/gjt/sp/jedit/syntax/DummyTokenHandler.html" title="class in org.gjt.sp.jedit.syntax"><B>PREV CLASS</B></A>
- <A HREF="../../../../../org/gjt/sp/jedit/syntax/ModeProvider.html" title="class in org.gjt.sp.jedit.syntax"><B>NEXT CLASS</B></A></FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../../index.html?org/gjt/sp/jedit/syntax/KeywordMap.html" target="_top"><B>FRAMES</B></A>
- <A HREF="KeywordMap.html" target="_top"><B>NO FRAMES</B></A>
-
- <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 | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="skip-navbar_bottom"></A>
- <!-- ======== END OF BOTTOM NAVBAR ======= -->
- <HR>
- </BODY>
- </HTML>