mirror of
https://github.com/ChronosX88/FreePastry.git
synced 2025-01-16 01:26:27 +00:00
1040 lines
43 KiB
HTML
1040 lines
43 KiB
HTML
|
<!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_07) on Fri Mar 13 20:01:31 CET 2009 -->
|
||
|
<TITLE>
|
||
|
RedBlackMap (Rice Pastry - API Specifications)
|
||
|
</TITLE>
|
||
|
|
||
|
<META NAME="date" CONTENT="2009-03-13">
|
||
|
|
||
|
<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="RedBlackMap (Rice Pastry - API Specifications)";
|
||
|
}
|
||
|
}
|
||
|
</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="../../../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="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
||
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/RedBlackMap.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-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>
|
||
|
Rice Pastry API</EM>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
|
||
|
<TR>
|
||
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||
|
<A HREF="../../../rice/p2p/util/RandomAccessFileIOBuffer.html" title="class in rice.p2p.util"><B>PREV CLASS</B></A>
|
||
|
<A HREF="../../../rice/p2p/util/ReverseTreeMap.html" title="class in rice.p2p.util"><B>NEXT CLASS</B></A></FONT></TD>
|
||
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||
|
<A HREF="../../../index.html?rice/p2p/util/RedBlackMap.html" target="_top"><B>FRAMES</B></A>
|
||
|
<A HREF="RedBlackMap.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: <A HREF="#nested_classes_inherited_from_class_java.util.AbstractMap">NESTED</A> | 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">
|
||
|
rice.p2p.util</FONT>
|
||
|
<BR>
|
||
|
Class RedBlackMap</H2>
|
||
|
<PRE>
|
||
|
java.lang.Object
|
||
|
<IMG SRC="../../../resources/inherit.gif" ALT="extended by ">java.util.AbstractMap
|
||
|
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>rice.p2p.util.RedBlackMap</B>
|
||
|
</PRE>
|
||
|
<DL>
|
||
|
<DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable, java.lang.Cloneable, java.util.Map, java.util.SortedMap</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
<DL>
|
||
|
<DT><PRE>public class <B>RedBlackMap</B><DT>extends java.util.AbstractMap<DT>implements java.util.SortedMap, java.lang.Cloneable, java.io.Serializable</DL>
|
||
|
</PRE>
|
||
|
|
||
|
<P>
|
||
|
This class is a modification of the RedBlackMap java class, with the added
|
||
|
benefit that iterators do not throw a ConcurrentModificationException when
|
||
|
the backing tree changes. The iterator is guaranteed to walk through
|
||
|
some version of the tree, and may show nodes which were deleted or which
|
||
|
were subsequently added, but it will not die.
|
||
|
<P>
|
||
|
|
||
|
<P>
|
||
|
<DL>
|
||
|
<DT><B>See Also:</B><DD><A HREF="../../../serialized-form.html#rice.p2p.util.RedBlackMap">Serialized Form</A></DL>
|
||
|
<HR>
|
||
|
|
||
|
<P>
|
||
|
<!-- ======== NESTED CLASS SUMMARY ======== -->
|
||
|
|
||
|
<A NAME="nested_class_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>Nested Class Summary</B></FONT></TH>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
<A NAME="nested_classes_inherited_from_class_java.util.AbstractMap"><!-- --></A>
|
||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||
|
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||
|
<TH ALIGN="left"><B>Nested classes/interfaces inherited from class java.util.AbstractMap</B></TH>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD><CODE>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V></CODE></TD>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
|
||
|
|
||
|
<!-- ======== 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="../../../rice/p2p/util/RedBlackMap.html#RedBlackMap()">RedBlackMap</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Constructs a new, empty map, sorted according to the keys' natural
|
||
|
order.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD><CODE><B><A HREF="../../../rice/p2p/util/RedBlackMap.html#RedBlackMap(java.util.Comparator)">RedBlackMap</A></B>(java.util.Comparator c)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Constructs a new, empty map, sorted according to the given comparator.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD><CODE><B><A HREF="../../../rice/p2p/util/RedBlackMap.html#RedBlackMap(java.util.Map)">RedBlackMap</A></B>(java.util.Map m)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Constructs a new map containing the same mappings as the given map,
|
||
|
sorted according to the keys' <i>natural order</i>.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD><CODE><B><A HREF="../../../rice/p2p/util/RedBlackMap.html#RedBlackMap(java.util.SortedMap)">RedBlackMap</A></B>(java.util.SortedMap m)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Constructs a new map containing the same mappings as the given
|
||
|
<tt>SortedMap</tt>, sorted according to the same ordering.</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="../../../rice/p2p/util/RedBlackMap.html#clear()">clear</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Removes all mappings from this RedBlackMap.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> java.lang.Object</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../../rice/p2p/util/RedBlackMap.html#clone()">clone</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Returns a shallow copy of this <tt>RedBlackMap</tt> instance.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> java.util.Comparator</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../../rice/p2p/util/RedBlackMap.html#comparator()">comparator</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Returns the comparator used to order this map, or <tt>null</tt> if this
|
||
|
map uses its keys' natural order.</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="../../../rice/p2p/util/RedBlackMap.html#containsKey(java.lang.Object)">containsKey</A></B>(java.lang.Object key)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Returns <tt>true</tt> if this map contains a mapping for the specified
|
||
|
key.</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="../../../rice/p2p/util/RedBlackMap.html#containsValue(java.lang.Object)">containsValue</A></B>(java.lang.Object value)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Returns <tt>true</tt> if this map maps one or more keys to the
|
||
|
specified value.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> java.util.Set</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../../rice/p2p/util/RedBlackMap.html#entrySet()">entrySet</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Returns a set view of the mappings contained in this map.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> java.lang.Object</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../../rice/p2p/util/RedBlackMap.html#firstKey()">firstKey</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Returns the first (lowest) key currently in this sorted map.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> java.lang.Object</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../../rice/p2p/util/RedBlackMap.html#get(java.lang.Object)">get</A></B>(java.lang.Object key)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Returns the value to which this map maps the specified key.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> java.lang.Object</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../../rice/p2p/util/RedBlackMap.html#getKey(java.lang.Object)">getKey</A></B>(java.lang.Object key)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> java.util.SortedMap</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../../rice/p2p/util/RedBlackMap.html#headMap(java.lang.Object)">headMap</A></B>(java.lang.Object toKey)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Returns a view of the portion of this map whose keys are strictly less
|
||
|
than <tt>toKey</tt>.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> java.util.Set</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../../rice/p2p/util/RedBlackMap.html#keySet()">keySet</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Returns a Set view of the keys contained in this map.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> java.lang.Object</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../../rice/p2p/util/RedBlackMap.html#lastKey()">lastKey</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Returns the last (highest) key currently in this sorted map.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> java.lang.Object</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../../rice/p2p/util/RedBlackMap.html#put(java.lang.Object, java.lang.Object)">put</A></B>(java.lang.Object key,
|
||
|
java.lang.Object value)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Associates the specified value with the specified key in this map.</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="../../../rice/p2p/util/RedBlackMap.html#putAll(java.util.Map)">putAll</A></B>(java.util.Map map)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Copies all of the mappings from the specified map to this map.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> java.lang.Object</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../../rice/p2p/util/RedBlackMap.html#remove(java.lang.Object)">remove</A></B>(java.lang.Object key)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Removes the mapping for this key from this RedBlackMap if present.</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="../../../rice/p2p/util/RedBlackMap.html#size()">size</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Returns the number of key-value mappings in this map.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> java.util.SortedMap</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../../rice/p2p/util/RedBlackMap.html#subMap(java.lang.Object, java.lang.Object)">subMap</A></B>(java.lang.Object fromKey,
|
||
|
java.lang.Object toKey)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Returns a view of the portion of this map whose keys range from
|
||
|
<tt>fromKey</tt>, inclusive, to <tt>toKey</tt>, exclusive.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> java.util.SortedMap</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../../rice/p2p/util/RedBlackMap.html#tailMap(java.lang.Object)">tailMap</A></B>(java.lang.Object fromKey)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Returns a view of the portion of this map whose keys are greater than
|
||
|
or equal to <tt>fromKey</tt>.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> java.util.Collection</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../../rice/p2p/util/RedBlackMap.html#values()">values</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Returns a collection view of the values contained in this map.</TD>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
<A NAME="methods_inherited_from_class_java.util.AbstractMap"><!-- --></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.util.AbstractMap</B></TH>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD><CODE>equals, hashCode, isEmpty, toString</CODE></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>finalize, getClass, notify, notifyAll, wait, wait, wait</CODE></TD>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
<A NAME="methods_inherited_from_class_java.util.Map"><!-- --></A>
|
||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||
|
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||
|
<TH ALIGN="left"><B>Methods inherited from interface java.util.Map</B></TH>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD><CODE>equals, hashCode, isEmpty</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="RedBlackMap()"><!-- --></A><H3>
|
||
|
RedBlackMap</H3>
|
||
|
<PRE>
|
||
|
public <B>RedBlackMap</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD>Constructs a new, empty map, sorted according to the keys' natural
|
||
|
order. All keys inserted into the map must implement the
|
||
|
<tt>Comparable</tt> interface. Furthermore, all such keys must be
|
||
|
<i>mutually comparable</i>: <tt>k1.compareTo(k2)</tt> must not throw a
|
||
|
ClassCastException for any elements <tt>k1</tt> and <tt>k2</tt> in the
|
||
|
map. If the user attempts to put a key into the map that violates this
|
||
|
constraint (for example, the user attempts to put a string key into a
|
||
|
map whose keys are integers), the <tt>put(Object key, Object
|
||
|
value)</tt> call will throw a <tt>ClassCastException</tt>.
|
||
|
<P>
|
||
|
<DL>
|
||
|
<DT><B>See Also:</B><DD><CODE>Comparable</CODE></DL>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="RedBlackMap(java.util.Comparator)"><!-- --></A><H3>
|
||
|
RedBlackMap</H3>
|
||
|
<PRE>
|
||
|
public <B>RedBlackMap</B>(java.util.Comparator c)</PRE>
|
||
|
<DL>
|
||
|
<DD>Constructs a new, empty map, sorted according to the given comparator.
|
||
|
All keys inserted into the map must be <i>mutually comparable</i> by
|
||
|
the given comparator: <tt>comparator.compare(k1, k2)</tt> must not
|
||
|
throw a <tt>ClassCastException</tt> for any keys <tt>k1</tt> and
|
||
|
<tt>k2</tt> in the map. If the user attempts to put a key into the
|
||
|
map that violates this constraint, the <tt>put(Object key, Object
|
||
|
value)</tt> call will throw a <tt>ClassCastException</tt>.
|
||
|
<P>
|
||
|
<DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>c</CODE> - the comparator that will be used to sort this map. A
|
||
|
<tt>null</tt> value indicates that the keys' <i>natural
|
||
|
ordering</i> should be used.</DL>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="RedBlackMap(java.util.Map)"><!-- --></A><H3>
|
||
|
RedBlackMap</H3>
|
||
|
<PRE>
|
||
|
public <B>RedBlackMap</B>(java.util.Map m)</PRE>
|
||
|
<DL>
|
||
|
<DD>Constructs a new map containing the same mappings as the given map,
|
||
|
sorted according to the keys' <i>natural order</i>. All keys inserted
|
||
|
into the new map must implement the <tt>Comparable</tt> interface.
|
||
|
Furthermore, all such keys must be <i>mutually comparable</i>:
|
||
|
<tt>k1.compareTo(k2)</tt> must not throw a <tt>ClassCastException</tt>
|
||
|
for any elements <tt>k1</tt> and <tt>k2</tt> in the map. This method
|
||
|
runs in n*log(n) time.
|
||
|
<P>
|
||
|
<DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>m</CODE> - the map whose mappings are to be placed in this map.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE>java.lang.ClassCastException</CODE> - the keys in t are not Comparable, or
|
||
|
are not mutually comparable.
|
||
|
<DD><CODE>java.lang.NullPointerException</CODE> - if the specified map is null.</DL>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="RedBlackMap(java.util.SortedMap)"><!-- --></A><H3>
|
||
|
RedBlackMap</H3>
|
||
|
<PRE>
|
||
|
public <B>RedBlackMap</B>(java.util.SortedMap m)</PRE>
|
||
|
<DL>
|
||
|
<DD>Constructs a new map containing the same mappings as the given
|
||
|
<tt>SortedMap</tt>, sorted according to the same ordering. This method
|
||
|
runs in linear time.
|
||
|
<P>
|
||
|
<DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>m</CODE> - the sorted map whose mappings are to be placed in this map,
|
||
|
and whose comparator is to be used to sort this map.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE>java.lang.NullPointerException</CODE> - if the specified sorted map is null.</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="size()"><!-- --></A><H3>
|
||
|
size</H3>
|
||
|
<PRE>
|
||
|
public int <B>size</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD>Returns the number of key-value mappings in this map.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE>size</CODE> in interface <CODE>java.util.Map</CODE><DT><B>Overrides:</B><DD><CODE>size</CODE> in class <CODE>java.util.AbstractMap</CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
|
||
|
<DT><B>Returns:</B><DD>the number of key-value mappings in this map.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="containsKey(java.lang.Object)"><!-- --></A><H3>
|
||
|
containsKey</H3>
|
||
|
<PRE>
|
||
|
public boolean <B>containsKey</B>(java.lang.Object key)</PRE>
|
||
|
<DL>
|
||
|
<DD>Returns <tt>true</tt> if this map contains a mapping for the specified
|
||
|
key.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE>containsKey</CODE> in interface <CODE>java.util.Map</CODE><DT><B>Overrides:</B><DD><CODE>containsKey</CODE> in class <CODE>java.util.AbstractMap</CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - key whose presence in this map is to be tested.
|
||
|
<DT><B>Returns:</B><DD><tt>true</tt> if this map contains a mapping for the
|
||
|
specified key.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE>java.lang.ClassCastException</CODE> - if the key cannot be compared with the keys
|
||
|
currently in the map.
|
||
|
<DD><CODE>java.lang.NullPointerException</CODE> - key is <tt>null</tt> and this map uses
|
||
|
natural ordering, or its comparator does not tolerate
|
||
|
<tt>null</tt> keys.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="containsValue(java.lang.Object)"><!-- --></A><H3>
|
||
|
containsValue</H3>
|
||
|
<PRE>
|
||
|
public boolean <B>containsValue</B>(java.lang.Object value)</PRE>
|
||
|
<DL>
|
||
|
<DD>Returns <tt>true</tt> if this map maps one or more keys to the
|
||
|
specified value. More formally, returns <tt>true</tt> if and only if
|
||
|
this map contains at least one mapping to a value <tt>v</tt> such
|
||
|
that <tt>(value==null ? v==null : value.equals(v))</tt>. This
|
||
|
operation will probably require time linear in the Map size for most
|
||
|
implementations of Map.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE>containsValue</CODE> in interface <CODE>java.util.Map</CODE><DT><B>Overrides:</B><DD><CODE>containsValue</CODE> in class <CODE>java.util.AbstractMap</CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>value</CODE> - value whose presence in this Map is to be tested.
|
||
|
<DT><B>Returns:</B><DD><tt>true</tt> if a mapping to <tt>value</tt> exists;
|
||
|
<tt>false</tt> otherwise.<DT><B>Since:</B></DT>
|
||
|
<DD>1.2</DD>
|
||
|
</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="get(java.lang.Object)"><!-- --></A><H3>
|
||
|
get</H3>
|
||
|
<PRE>
|
||
|
public java.lang.Object <B>get</B>(java.lang.Object key)</PRE>
|
||
|
<DL>
|
||
|
<DD>Returns the value to which this map maps the specified key. Returns
|
||
|
<tt>null</tt> if the map contains no mapping for this key. A return
|
||
|
value of <tt>null</tt> does not <i>necessarily</i> indicate that the
|
||
|
map contains no mapping for the key; it's also possible that the map
|
||
|
explicitly maps the key to <tt>null</tt>. The <tt>containsKey</tt>
|
||
|
operation may be used to distinguish these two cases.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE>get</CODE> in interface <CODE>java.util.Map</CODE><DT><B>Overrides:</B><DD><CODE>get</CODE> in class <CODE>java.util.AbstractMap</CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - key whose associated value is to be returned.
|
||
|
<DT><B>Returns:</B><DD>the value to which this map maps the specified key, or
|
||
|
<tt>null</tt> if the map contains no mapping for the key.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE>java.lang.ClassCastException</CODE> - key cannot be compared with the keys
|
||
|
currently in the map.
|
||
|
<DD><CODE>java.lang.NullPointerException</CODE> - key is <tt>null</tt> and this map uses
|
||
|
natural ordering, or its comparator does not tolerate
|
||
|
<tt>null</tt> keys.<DT><B>See Also:</B><DD><A HREF="../../../rice/p2p/util/RedBlackMap.html#containsKey(java.lang.Object)"><CODE>containsKey(Object)</CODE></A></DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="comparator()"><!-- --></A><H3>
|
||
|
comparator</H3>
|
||
|
<PRE>
|
||
|
public java.util.Comparator <B>comparator</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD>Returns the comparator used to order this map, or <tt>null</tt> if this
|
||
|
map uses its keys' natural order.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE>comparator</CODE> in interface <CODE>java.util.SortedMap</CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
|
||
|
<DT><B>Returns:</B><DD>the comparator associated with this sorted map, or
|
||
|
<tt>null</tt> if it uses its keys' natural sort method.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="firstKey()"><!-- --></A><H3>
|
||
|
firstKey</H3>
|
||
|
<PRE>
|
||
|
public java.lang.Object <B>firstKey</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD>Returns the first (lowest) key currently in this sorted map.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE>firstKey</CODE> in interface <CODE>java.util.SortedMap</CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
|
||
|
<DT><B>Returns:</B><DD>the first (lowest) key currently in this sorted map.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE>java.util.NoSuchElementException</CODE> - Map is empty.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="lastKey()"><!-- --></A><H3>
|
||
|
lastKey</H3>
|
||
|
<PRE>
|
||
|
public java.lang.Object <B>lastKey</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD>Returns the last (highest) key currently in this sorted map.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE>lastKey</CODE> in interface <CODE>java.util.SortedMap</CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
|
||
|
<DT><B>Returns:</B><DD>the last (highest) key currently in this sorted map.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE>java.util.NoSuchElementException</CODE> - Map is empty.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="putAll(java.util.Map)"><!-- --></A><H3>
|
||
|
putAll</H3>
|
||
|
<PRE>
|
||
|
public void <B>putAll</B>(java.util.Map map)</PRE>
|
||
|
<DL>
|
||
|
<DD>Copies all of the mappings from the specified map to this map. These
|
||
|
mappings replace any mappings that this map had for any of the keys
|
||
|
currently in the specified map.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE>putAll</CODE> in interface <CODE>java.util.Map</CODE><DT><B>Overrides:</B><DD><CODE>putAll</CODE> in class <CODE>java.util.AbstractMap</CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>map</CODE> - mappings to be stored in this map.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE>java.lang.ClassCastException</CODE> - class of a key or value in the specified
|
||
|
map prevents it from being stored in this map.
|
||
|
<DD><CODE>java.lang.NullPointerException</CODE> - if the given map is <tt>null</tt> or
|
||
|
this map does not permit <tt>null</tt> keys and a
|
||
|
key in the specified map is <tt>null</tt>.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="put(java.lang.Object, java.lang.Object)"><!-- --></A><H3>
|
||
|
put</H3>
|
||
|
<PRE>
|
||
|
public java.lang.Object <B>put</B>(java.lang.Object key,
|
||
|
java.lang.Object value)</PRE>
|
||
|
<DL>
|
||
|
<DD>Associates the specified value with the specified key in this map.
|
||
|
If the map previously contained a mapping for this key, the old
|
||
|
value is replaced.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE>put</CODE> in interface <CODE>java.util.Map</CODE><DT><B>Overrides:</B><DD><CODE>put</CODE> in class <CODE>java.util.AbstractMap</CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - key with which the specified value is to be associated.<DD><CODE>value</CODE> - value to be associated with the specified key.
|
||
|
<DT><B>Returns:</B><DD>previous value associated with specified key, or <tt>null</tt>
|
||
|
if there was no mapping for key. A <tt>null</tt> return can
|
||
|
also indicate that the map previously associated <tt>null</tt>
|
||
|
with the specified key.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE>java.lang.ClassCastException</CODE> - key cannot be compared with the keys
|
||
|
currently in the map.
|
||
|
<DD><CODE>java.lang.NullPointerException</CODE> - key is <tt>null</tt> and this map uses
|
||
|
natural order, or its comparator does not tolerate
|
||
|
<tt>null</tt> keys.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="remove(java.lang.Object)"><!-- --></A><H3>
|
||
|
remove</H3>
|
||
|
<PRE>
|
||
|
public java.lang.Object <B>remove</B>(java.lang.Object key)</PRE>
|
||
|
<DL>
|
||
|
<DD>Removes the mapping for this key from this RedBlackMap if present.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE>remove</CODE> in interface <CODE>java.util.Map</CODE><DT><B>Overrides:</B><DD><CODE>remove</CODE> in class <CODE>java.util.AbstractMap</CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - key for which mapping should be removed
|
||
|
<DT><B>Returns:</B><DD>previous value associated with specified key, or <tt>null</tt>
|
||
|
if there was no mapping for key. A <tt>null</tt> return can
|
||
|
also indicate that the map previously associated
|
||
|
<tt>null</tt> with the specified key.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE>java.lang.ClassCastException</CODE> - key cannot be compared with the keys
|
||
|
currently in the map.
|
||
|
<DD><CODE>java.lang.NullPointerException</CODE> - key is <tt>null</tt> and this map uses
|
||
|
natural order, or its comparator does not tolerate
|
||
|
<tt>null</tt> keys.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="getKey(java.lang.Object)"><!-- --></A><H3>
|
||
|
getKey</H3>
|
||
|
<PRE>
|
||
|
public java.lang.Object <B>getKey</B>(java.lang.Object key)</PRE>
|
||
|
<DL>
|
||
|
<DD><DL>
|
||
|
</DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="clear()"><!-- --></A><H3>
|
||
|
clear</H3>
|
||
|
<PRE>
|
||
|
public void <B>clear</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD>Removes all mappings from this RedBlackMap.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE>clear</CODE> in interface <CODE>java.util.Map</CODE><DT><B>Overrides:</B><DD><CODE>clear</CODE> in class <CODE>java.util.AbstractMap</CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="clone()"><!-- --></A><H3>
|
||
|
clone</H3>
|
||
|
<PRE>
|
||
|
public java.lang.Object <B>clone</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD>Returns a shallow copy of this <tt>RedBlackMap</tt> instance. (The keys and
|
||
|
values themselves are not cloned.)
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Overrides:</B><DD><CODE>clone</CODE> in class <CODE>java.util.AbstractMap</CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
|
||
|
<DT><B>Returns:</B><DD>a shallow copy of this Map.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="keySet()"><!-- --></A><H3>
|
||
|
keySet</H3>
|
||
|
<PRE>
|
||
|
public java.util.Set <B>keySet</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD>Returns a Set view of the keys contained in this map. The set's
|
||
|
iterator will return the keys in ascending order. The map is backed by
|
||
|
this <tt>RedBlackMap</tt> instance, so changes to this map are reflected in
|
||
|
the Set, and vice-versa. The Set supports element removal, which
|
||
|
removes the corresponding mapping from the map, via the
|
||
|
<tt>Iterator.remove</tt>, <tt>Set.remove</tt>, <tt>removeAll</tt>,
|
||
|
<tt>retainAll</tt>, and <tt>clear</tt> operations. It does not support
|
||
|
the <tt>add</tt> or <tt>addAll</tt> operations.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE>keySet</CODE> in interface <CODE>java.util.Map</CODE><DT><B>Specified by:</B><DD><CODE>keySet</CODE> in interface <CODE>java.util.SortedMap</CODE><DT><B>Overrides:</B><DD><CODE>keySet</CODE> in class <CODE>java.util.AbstractMap</CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
|
||
|
<DT><B>Returns:</B><DD>a set view of the keys contained in this RedBlackMap.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="values()"><!-- --></A><H3>
|
||
|
values</H3>
|
||
|
<PRE>
|
||
|
public java.util.Collection <B>values</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD>Returns a collection view of the values contained in this map. The
|
||
|
collection's iterator will return the values in the order that their
|
||
|
corresponding keys appear in the tree. The collection is backed by
|
||
|
this <tt>RedBlackMap</tt> instance, so changes to this map are reflected in
|
||
|
the collection, and vice-versa. The collection supports element
|
||
|
removal, which removes the corresponding mapping from the map through
|
||
|
the <tt>Iterator.remove</tt>, <tt>Collection.remove</tt>,
|
||
|
<tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt> operations.
|
||
|
It does not support the <tt>add</tt> or <tt>addAll</tt> operations.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE>values</CODE> in interface <CODE>java.util.Map</CODE><DT><B>Specified by:</B><DD><CODE>values</CODE> in interface <CODE>java.util.SortedMap</CODE><DT><B>Overrides:</B><DD><CODE>values</CODE> in class <CODE>java.util.AbstractMap</CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
|
||
|
<DT><B>Returns:</B><DD>a collection view of the values contained in this map.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="entrySet()"><!-- --></A><H3>
|
||
|
entrySet</H3>
|
||
|
<PRE>
|
||
|
public java.util.Set <B>entrySet</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD>Returns a set view of the mappings contained in this map. The set's
|
||
|
iterator returns the mappings in ascending key order. Each element in
|
||
|
the returned set is a <tt>Map.Entry</tt>. The set is backed by this
|
||
|
map, so changes to this map are reflected in the set, and vice-versa.
|
||
|
The set supports element removal, which removes the corresponding
|
||
|
mapping from the RedBlackMap, through the <tt>Iterator.remove</tt>,
|
||
|
<tt>Set.remove</tt>, <tt>removeAll</tt>, <tt>retainAll</tt> and
|
||
|
<tt>clear</tt> operations. It does not support the <tt>add</tt> or
|
||
|
<tt>addAll</tt> operations.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE>entrySet</CODE> in interface <CODE>java.util.Map</CODE><DT><B>Specified by:</B><DD><CODE>entrySet</CODE> in interface <CODE>java.util.SortedMap</CODE><DT><B>Specified by:</B><DD><CODE>entrySet</CODE> in class <CODE>java.util.AbstractMap</CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
|
||
|
<DT><B>Returns:</B><DD>a set view of the mappings contained in this map.<DT><B>See Also:</B><DD><CODE>Map.Entry</CODE></DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="subMap(java.lang.Object, java.lang.Object)"><!-- --></A><H3>
|
||
|
subMap</H3>
|
||
|
<PRE>
|
||
|
public java.util.SortedMap <B>subMap</B>(java.lang.Object fromKey,
|
||
|
java.lang.Object toKey)</PRE>
|
||
|
<DL>
|
||
|
<DD>Returns a view of the portion of this map whose keys range from
|
||
|
<tt>fromKey</tt>, inclusive, to <tt>toKey</tt>, exclusive. (If
|
||
|
<tt>fromKey</tt> and <tt>toKey</tt> are equal, the returned sorted map
|
||
|
is empty.) The returned sorted map is backed by this map, so changes
|
||
|
in the returned sorted map are reflected in this map, and vice-versa.
|
||
|
The returned sorted map supports all optional map operations.<p>
|
||
|
|
||
|
The sorted map returned by this method will throw an
|
||
|
<tt>IllegalArgumentException</tt> if the user attempts to insert a key
|
||
|
less than <tt>fromKey</tt> or greater than or equal to
|
||
|
<tt>toKey</tt>.<p>
|
||
|
|
||
|
Note: this method always returns a <i>half-open range</i> (which
|
||
|
includes its low endpoint but not its high endpoint). If you need a
|
||
|
<i>closed range</i> (which includes both endpoints), and the key type
|
||
|
allows for calculation of the successor a given key, merely request the
|
||
|
subrange from <tt>lowEndpoint</tt> to <tt>successor(highEndpoint)</tt>.
|
||
|
For example, suppose that <tt>m</tt> is a sorted map whose keys are
|
||
|
strings. The following idiom obtains a view containing all of the
|
||
|
key-value mappings in <tt>m</tt> whose keys are between <tt>low</tt>
|
||
|
and <tt>high</tt>, inclusive:
|
||
|
<pre> SortedMap sub = m.submap(low, high+"\0");</pre>
|
||
|
A similar technique can be used to generate an <i>open range</i> (which
|
||
|
contains neither endpoint). The following idiom obtains a view
|
||
|
containing all of the key-value mappings in <tt>m</tt> whose keys are
|
||
|
between <tt>low</tt> and <tt>high</tt>, exclusive:
|
||
|
<pre> SortedMap sub = m.subMap(low+"\0", high);</pre>
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE>subMap</CODE> in interface <CODE>java.util.SortedMap</CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>fromKey</CODE> - low endpoint (inclusive) of the subMap.<DD><CODE>toKey</CODE> - high endpoint (exclusive) of the subMap.
|
||
|
<DT><B>Returns:</B><DD>a view of the portion of this map whose keys range from
|
||
|
<tt>fromKey</tt>, inclusive, to <tt>toKey</tt>, exclusive.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE>java.lang.ClassCastException</CODE> - if <tt>fromKey</tt> and <tt>toKey</tt>
|
||
|
cannot be compared to one another using this map's comparator
|
||
|
(or, if the map has no comparator, using natural ordering).
|
||
|
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if <tt>fromKey</tt> is greater than
|
||
|
<tt>toKey</tt>.
|
||
|
<DD><CODE>java.lang.NullPointerException</CODE> - if <tt>fromKey</tt> or <tt>toKey</tt> is
|
||
|
<tt>null</tt> and this map uses natural order, or its
|
||
|
comparator does not tolerate <tt>null</tt> keys.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="headMap(java.lang.Object)"><!-- --></A><H3>
|
||
|
headMap</H3>
|
||
|
<PRE>
|
||
|
public java.util.SortedMap <B>headMap</B>(java.lang.Object toKey)</PRE>
|
||
|
<DL>
|
||
|
<DD>Returns a view of the portion of this map whose keys are strictly less
|
||
|
than <tt>toKey</tt>. The returned sorted map is backed by this map, so
|
||
|
changes in the returned sorted map are reflected in this map, and
|
||
|
vice-versa. The returned sorted map supports all optional map
|
||
|
operations.<p>
|
||
|
|
||
|
The sorted map returned by this method will throw an
|
||
|
<tt>IllegalArgumentException</tt> if the user attempts to insert a key
|
||
|
greater than or equal to <tt>toKey</tt>.<p>
|
||
|
|
||
|
Note: this method always returns a view that does not contain its
|
||
|
(high) endpoint. If you need a view that does contain this endpoint,
|
||
|
and the key type allows for calculation of the successor a given key,
|
||
|
merely request a headMap bounded by <tt>successor(highEndpoint)</tt>.
|
||
|
For example, suppose that suppose that <tt>m</tt> is a sorted map whose
|
||
|
keys are strings. The following idiom obtains a view containing all of
|
||
|
the key-value mappings in <tt>m</tt> whose keys are less than or equal
|
||
|
to <tt>high</tt>:
|
||
|
<pre>
|
||
|
SortedMap head = m.headMap(high+"\0");
|
||
|
</pre>
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE>headMap</CODE> in interface <CODE>java.util.SortedMap</CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>toKey</CODE> - high endpoint (exclusive) of the headMap.
|
||
|
<DT><B>Returns:</B><DD>a view of the portion of this map whose keys are strictly
|
||
|
less than <tt>toKey</tt>.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE>java.lang.ClassCastException</CODE> - if <tt>toKey</tt> is not compatible
|
||
|
with this map's comparator (or, if the map has no comparator,
|
||
|
if <tt>toKey</tt> does not implement <tt>Comparable</tt>).
|
||
|
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if this map is itself a subMap,
|
||
|
headMap, or tailMap, and <tt>toKey</tt> is not within the
|
||
|
specified range of the subMap, headMap, or tailMap.
|
||
|
<DD><CODE>java.lang.NullPointerException</CODE> - if <tt>toKey</tt> is <tt>null</tt> and
|
||
|
this map uses natural order, or its comparator does not
|
||
|
tolerate <tt>null</tt> keys.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="tailMap(java.lang.Object)"><!-- --></A><H3>
|
||
|
tailMap</H3>
|
||
|
<PRE>
|
||
|
public java.util.SortedMap <B>tailMap</B>(java.lang.Object fromKey)</PRE>
|
||
|
<DL>
|
||
|
<DD>Returns a view of the portion of this map whose keys are greater than
|
||
|
or equal to <tt>fromKey</tt>. The returned sorted map is backed by
|
||
|
this map, so changes in the returned sorted map are reflected in this
|
||
|
map, and vice-versa. The returned sorted map supports all optional map
|
||
|
operations.<p>
|
||
|
|
||
|
The sorted map returned by this method will throw an
|
||
|
<tt>IllegalArgumentException</tt> if the user attempts to insert a key
|
||
|
less than <tt>fromKey</tt>.<p>
|
||
|
|
||
|
Note: this method always returns a view that contains its (low)
|
||
|
endpoint. If you need a view that does not contain this endpoint, and
|
||
|
the element type allows for calculation of the successor a given value,
|
||
|
merely request a tailMap bounded by <tt>successor(lowEndpoint)</tt>.
|
||
|
For For example, suppose that suppose that <tt>m</tt> is a sorted map
|
||
|
whose keys are strings. The following idiom obtains a view containing
|
||
|
all of the key-value mappings in <tt>m</tt> whose keys are strictly
|
||
|
greater than <tt>low</tt>: <pre>
|
||
|
SortedMap tail = m.tailMap(low+"\0");
|
||
|
</pre>
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE>tailMap</CODE> in interface <CODE>java.util.SortedMap</CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>fromKey</CODE> - low endpoint (inclusive) of the tailMap.
|
||
|
<DT><B>Returns:</B><DD>a view of the portion of this map whose keys are greater
|
||
|
than or equal to <tt>fromKey</tt>.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE>java.lang.ClassCastException</CODE> - if <tt>fromKey</tt> is not compatible
|
||
|
with this map's comparator (or, if the map has no comparator,
|
||
|
if <tt>fromKey</tt> does not implement <tt>Comparable</tt>).
|
||
|
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if this map is itself a subMap,
|
||
|
headMap, or tailMap, and <tt>fromKey</tt> is not within the
|
||
|
specified range of the subMap, headMap, or tailMap.
|
||
|
<DD><CODE>java.lang.NullPointerException</CODE> - if <tt>fromKey</tt> is <tt>null</tt> and
|
||
|
this map uses natural order, or its comparator does not
|
||
|
tolerate <tt>null</tt> keys.</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="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
||
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/RedBlackMap.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-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>
|
||
|
Rice Pastry API</EM>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
|
||
|
<TR>
|
||
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||
|
<A HREF="../../../rice/p2p/util/RandomAccessFileIOBuffer.html" title="class in rice.p2p.util"><B>PREV CLASS</B></A>
|
||
|
<A HREF="../../../rice/p2p/util/ReverseTreeMap.html" title="class in rice.p2p.util"><B>NEXT CLASS</B></A></FONT></TD>
|
||
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||
|
<A HREF="../../../index.html?rice/p2p/util/RedBlackMap.html" target="_top"><B>FRAMES</B></A>
|
||
|
<A HREF="RedBlackMap.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: <A HREF="#nested_classes_inherited_from_class_java.util.AbstractMap">NESTED</A> | 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>
|
||
|
<i>Copyright © 2001-2005 - Rice Pastry.</i>
|
||
|
</BODY>
|
||
|
</HTML>
|