mirror of
https://github.com/ChronosX88/FreePastry.git
synced 2025-01-16 01:26:27 +00:00
1691 lines
63 KiB
HTML
1691 lines
63 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:13 CET 2009 -->
|
|
<TITLE>
|
|
Id (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="Id (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/Id.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/pastry/ExponentialBackoffScheduledMessage.html" title="class in rice.pastry"><B>PREV CLASS</B></A>
|
|
<A HREF="../../rice/pastry/Id.Distance.html" title="class in rice.pastry"><B>NEXT CLASS</B></A></FONT></TD>
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
<A HREF="../../index.html?rice/pastry/Id.html" target="_top"><B>FRAMES</B></A>
|
|
<A HREF="Id.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_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
DETAIL: <A HREF="#field_detail">FIELD</A> | <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.pastry</FONT>
|
|
<BR>
|
|
Class Id</H2>
|
|
<PRE>
|
|
java.lang.Object
|
|
<IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>rice.pastry.Id</B>
|
|
</PRE>
|
|
<DL>
|
|
<DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable, java.lang.Comparable<<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>>, <A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>, <A HREF="../../rice/p2p/commonapi/rawserialization/RawSerializable.html" title="interface in rice.p2p.commonapi.rawserialization">RawSerializable</A></DD>
|
|
</DL>
|
|
<HR>
|
|
<DL>
|
|
<DT><PRE>public class <B>Id</B><DT>extends java.lang.Object<DT>implements <A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>, <A HREF="../../rice/p2p/commonapi/rawserialization/RawSerializable.html" title="interface in rice.p2p.commonapi.rawserialization">RawSerializable</A></DL>
|
|
</PRE>
|
|
|
|
<P>
|
|
Represents a Pastry identifier for a node, object or key. A single identifier and the bit length
|
|
for Ids is stored in this class. Ids are stored little endian. NOTE: Ids are immutable, and are
|
|
coalesced for memory efficiency. New Ids are to be constructed from the build() methods, which
|
|
ensure that only one copy of each Id is in memory at a time.
|
|
<P>
|
|
|
|
<P>
|
|
<DL>
|
|
<DT><B>Version:</B></DT>
|
|
<DD>$Id: Id.java 4654 2009-01-08 16:33:07Z jeffh $</DD>
|
|
<DT><B>Author:</B></DT>
|
|
<DD>Andrew Ladd, Peter Druschel, Alan Mislove</DD>
|
|
<DT><B>See Also:</B><DD><A HREF="../../serialized-form.html#rice.pastry.Id">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>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static class</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.Distance.html" title="class in rice.pastry">Id.Distance</A></B></CODE>
|
|
|
|
<BR>
|
|
A class for representing and manipulating the distance between two Ids on the circle.</TD>
|
|
</TR>
|
|
</TABLE>
|
|
<!-- =========== FIELD SUMMARY =========== -->
|
|
|
|
<A NAME="field_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>Field Summary</B></FONT></TH>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static int[]</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#Half">Half</A></B></CODE>
|
|
|
|
<BR>
|
|
</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static int</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#IdBitLength">IdBitLength</A></B></CODE>
|
|
|
|
<BR>
|
|
This is the bit length of the node ids.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static int[]</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#NegOne">NegOne</A></B></CODE>
|
|
|
|
<BR>
|
|
</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static int</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#nlen">nlen</A></B></CODE>
|
|
|
|
<BR>
|
|
</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static int[]</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#Null">Null</A></B></CODE>
|
|
|
|
<BR>
|
|
Distance constants</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static int[]</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#One">One</A></B></CODE>
|
|
|
|
<BR>
|
|
</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static java.lang.String[]</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#tran">tran</A></B></CODE>
|
|
|
|
<BR>
|
|
The static translation array</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static short</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#TYPE">TYPE</A></B></CODE>
|
|
|
|
<BR>
|
|
</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 ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>protected </CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#Id(int[])">Id</A></B>(int[] material)</CODE>
|
|
|
|
<BR>
|
|
Constructor.</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> <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#add(rice.pastry.Id.Distance)">add</A></B>(<A HREF="../../rice/pastry/Id.Distance.html" title="class in rice.pastry">Id.Distance</A> offset)</CODE>
|
|
|
|
<BR>
|
|
Returns an Id corresponding to this Id plus a given distance</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#addToId(rice.p2p.commonapi.Id.Distance)">addToId</A></B>(<A HREF="../../rice/p2p/commonapi/Id.Distance.html" title="interface in rice.p2p.commonapi">Id.Distance</A> offset)</CODE>
|
|
|
|
<BR>
|
|
Returns an Id corresponding to this Id plus a given distance</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/pastry/Id.html#blit(byte[])">blit</A></B>(byte[] target)</CODE>
|
|
|
|
<BR>
|
|
Blits the Id into a target array.</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/pastry/Id.html#blit(byte[], int)">blit</A></B>(byte[] target,
|
|
int offset)</CODE>
|
|
|
|
<BR>
|
|
Blits the distance into a target array, starting at the given offset.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#build()">build</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Constructor.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#build(byte[])">build</A></B>(byte[] material)</CODE>
|
|
|
|
<BR>
|
|
Constructor.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#build(char[], int, int)">build</A></B>(char[] chars,
|
|
int offset,
|
|
int length)</CODE>
|
|
|
|
<BR>
|
|
Constructor, which takes the output of a toStringFull() and converts it back
|
|
into an Id.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#build(rice.p2p.commonapi.rawserialization.InputBuffer)">build</A></B>(<A HREF="../../rice/p2p/commonapi/rawserialization/InputBuffer.html" title="interface in rice.p2p.commonapi.rawserialization">InputBuffer</A> buf)</CODE>
|
|
|
|
<BR>
|
|
Id (Version 0)
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
+ 160 Bit +
|
|
+ +
|
|
+ +
|
|
+ +
|
|
+ +
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#build(int[])">build</A></B>(int[] material)</CODE>
|
|
|
|
<BR>
|
|
Constructor.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#build(java.lang.String)">build</A></B>(java.lang.String hex)</CODE>
|
|
|
|
<BR>
|
|
Constructor, which takes the output of a toStringFull() and converts it back
|
|
into an Id.</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/pastry/Id.html#checkBit(int)">checkBit</A></B>(int i)</CODE>
|
|
|
|
<BR>
|
|
Checks if the ith bit is flipped.</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/pastry/Id.html#clockwise(rice.pastry.Id)">clockwise</A></B>(<A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> nid)</CODE>
|
|
|
|
<BR>
|
|
Checks to see if the Id nid is clockwise or counterclockwise from this, on the ring.</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/pastry/Id.html#clockwise(rice.p2p.commonapi.Id)">clockwise</A></B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A> nid)</CODE>
|
|
|
|
<BR>
|
|
Checks to see if the Id nid is clockwise or counterclockwise from this, on the ring.</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/pastry/Id.html#compareTo(rice.p2p.commonapi.Id)">compareTo</A></B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A> obj)</CODE>
|
|
|
|
<BR>
|
|
Comparison operator for Ids.</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="../../rice/pastry/Id.html#copy()">copy</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Copy the Id into a freshly generated array.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../rice/pastry/Id.Distance.html" title="class in rice.pastry">Id.Distance</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#distance(rice.pastry.Id)">distance</A></B>(<A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> nid)</CODE>
|
|
|
|
<BR>
|
|
Returns the shorter numerical distance on the ring between a pair of Ids.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../rice/pastry/Id.Distance.html" title="class in rice.pastry">Id.Distance</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#distance(rice.pastry.Id, rice.pastry.Id.Distance)">distance</A></B>(<A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> nid,
|
|
<A HREF="../../rice/pastry/Id.Distance.html" title="class in rice.pastry">Id.Distance</A> d)</CODE>
|
|
|
|
<BR>
|
|
</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../rice/p2p/commonapi/Id.Distance.html" title="interface in rice.p2p.commonapi">Id.Distance</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#distanceFromId(rice.p2p.commonapi.Id)">distanceFromId</A></B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A> nid)</CODE>
|
|
|
|
<BR>
|
|
Returns the shorter numerical distance on the ring between a pair of Ids.</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/pastry/Id.html#equals(rice.pastry.Id)">equals</A></B>(<A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> nid)</CODE>
|
|
|
|
<BR>
|
|
Equivalence relation for Ids.</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/pastry/Id.html#equals(java.lang.Object)">equals</A></B>(java.lang.Object obj)</CODE>
|
|
|
|
<BR>
|
|
Equality operator for Ids.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#getAlternateId(int, int, int)">getAlternateId</A></B>(int num,
|
|
int b,
|
|
int i)</CODE>
|
|
|
|
<BR>
|
|
produces a set of ids (keys) that are evenly distributed around the id ring.</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/pastry/Id.html#getByteArrayLength()">getByteArrayLength</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Returns the length of the byte[] representing this Id</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#getCCW()">getCCW</A></B>()</CODE>
|
|
|
|
<BR>
|
|
gets the Id just counterclockwise from this</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#getCW()">getCW</A></B>()</CODE>
|
|
|
|
<BR>
|
|
gets the Id just clockwise from this</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/pastry/Id.html#getDigit(int, int)">getDigit</A></B>(int i,
|
|
int b)</CODE>
|
|
|
|
<BR>
|
|
Gets the ith digit in base 2^b.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#getDomainPrefix(int, int, int, int)">getDomainPrefix</A></B>(int row,
|
|
int column,
|
|
int suffixDigit,
|
|
int b)</CODE>
|
|
|
|
<BR>
|
|
produces a Id whose prefix up to row is identical to this, followed by a digit with value
|
|
column, followed by a suffix of digits with value suffixDigits.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> short</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#getType()">getType</A></B>()</CODE>
|
|
|
|
<BR>
|
|
</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> int</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#hashCode()">hashCode</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Hash codes for Ids.</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/pastry/Id.html#indexOfMSDB(rice.pastry.Id)">indexOfMSDB</A></B>(<A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> nid)</CODE>
|
|
|
|
<BR>
|
|
Returns the index of the most significant differing bit (MSDB).</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/pastry/Id.html#indexOfMSDD(rice.pastry.Id, int)">indexOfMSDD</A></B>(<A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> nid,
|
|
int base)</CODE>
|
|
|
|
<BR>
|
|
Returns the index of the most significant different digit (MSDD) in a given base.</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/pastry/Id.html#isBetween(rice.pastry.Id, rice.pastry.Id)">isBetween</A></B>(<A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> ccw,
|
|
<A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> cw)</CODE>
|
|
|
|
<BR>
|
|
Checks if this Id is between two given ids ccw (inclusive) and cw (exclusive) on the circle</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/pastry/Id.html#isBetween(rice.p2p.commonapi.Id, rice.p2p.commonapi.Id)">isBetween</A></B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A> ccw,
|
|
<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A> cw)</CODE>
|
|
|
|
<BR>
|
|
Checks if this Id is between two given ids ccw (inclusive) and cw (exclusive) on the circle</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../rice/pastry/Id.Distance.html" title="class in rice.pastry">Id.Distance</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#longDistance(rice.pastry.Id)">longDistance</A></B>(<A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> nid)</CODE>
|
|
|
|
<BR>
|
|
Returns the longer numerical distance on the ring between a pair of Ids.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../rice/p2p/commonapi/Id.Distance.html" title="interface in rice.p2p.commonapi">Id.Distance</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#longDistanceFromId(rice.p2p.commonapi.Id)">longDistanceFromId</A></B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A> nid)</CODE>
|
|
|
|
<BR>
|
|
Returns the longer numerical distance on the ring between a pair of Ids.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE>
|
|
|
|
<BR>
|
|
</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#makeRandomId(java.util.Random)">makeRandomId</A></B>(java.util.Random rng)</CODE>
|
|
|
|
<BR>
|
|
Creates a random Id.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#makeRandomId(rice.environment.random.RandomSource)">makeRandomId</A></B>(<A HREF="../../rice/environment/random/RandomSource.html" title="interface in rice.environment.random">RandomSource</A> rng)</CODE>
|
|
|
|
<BR>
|
|
</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static int</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#numDigits(int)">numDigits</A></B>(int base)</CODE>
|
|
|
|
<BR>
|
|
return the number of digits in a given base</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>protected static <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#resolve(java.util.WeakHashMap, rice.pastry.Id)">resolve</A></B>(java.util.WeakHashMap map,
|
|
<A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> id)</CODE>
|
|
|
|
<BR>
|
|
Method which performs the coalescing and interaction with the weak hash 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/pastry/Id.html#serialize(rice.p2p.commonapi.rawserialization.OutputBuffer)">serialize</A></B>(<A HREF="../../rice/p2p/commonapi/rawserialization/OutputBuffer.html" title="interface in rice.p2p.commonapi.rawserialization">OutputBuffer</A> buf)</CODE>
|
|
|
|
<BR>
|
|
Serialize</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="../../rice/pastry/Id.html#toByteArray()">toByteArray</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Returns the byte array representation of this Id</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/pastry/Id.html#toByteArray(byte[], int)">toByteArray</A></B>(byte[] array,
|
|
int offset)</CODE>
|
|
|
|
<BR>
|
|
Stores the byte[] value of this Id in the provided byte array</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="../../rice/pastry/Id.html#toString()">toString</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Returns a string representation of the Id in base 16.</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="../../rice/pastry/Id.html#toStringBare()">toStringBare</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Similar to toString(), but not wrapped by <0x ..></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="../../rice/pastry/Id.html#toStringFull()">toStringFull</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Returns the complete represntation of this Id, in hex.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>protected static int[]</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#trans(byte[])">trans</A></B>(byte[] material)</CODE>
|
|
|
|
<BR>
|
|
Internal method for mapping byte[] -> int[]</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>protected static byte</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#trans(char)">trans</A></B>(char c)</CODE>
|
|
|
|
<BR>
|
|
Internal method for mapping digit -> num</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>protected static int[]</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../rice/pastry/Id.html#trans(java.lang.String)">trans</A></B>(java.lang.String hex)</CODE>
|
|
|
|
<BR>
|
|
Static method for converting the hex representation into an array of
|
|
ints.</TD>
|
|
</TR>
|
|
</TABLE>
|
|
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
|
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
|
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD><CODE>clone, finalize, getClass, notify, notifyAll, wait, wait, wait</CODE></TD>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
<P>
|
|
|
|
<!-- ============ FIELD DETAIL =========== -->
|
|
|
|
<A NAME="field_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>Field Detail</B></FONT></TH>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
<A NAME="TYPE"><!-- --></A><H3>
|
|
TYPE</H3>
|
|
<PRE>
|
|
public static final short <B>TYPE</B></PRE>
|
|
<DL>
|
|
<DL>
|
|
<DT><B>See Also:</B><DD><A HREF="../../constant-values.html#rice.pastry.Id.TYPE">Constant Field Values</A></DL>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="tran"><!-- --></A><H3>
|
|
tran</H3>
|
|
<PRE>
|
|
public static final java.lang.String[] <B>tran</B></PRE>
|
|
<DL>
|
|
<DD>The static translation array
|
|
<P>
|
|
<DL>
|
|
</DL>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="IdBitLength"><!-- --></A><H3>
|
|
IdBitLength</H3>
|
|
<PRE>
|
|
public static final int <B>IdBitLength</B></PRE>
|
|
<DL>
|
|
<DD>This is the bit length of the node ids. If it is n, then there are 2^n possible different Ids.
|
|
We currently assume that it is divisible by 32.
|
|
<P>
|
|
<DL>
|
|
<DT><B>See Also:</B><DD><A HREF="../../constant-values.html#rice.pastry.Id.IdBitLength">Constant Field Values</A></DL>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="nlen"><!-- --></A><H3>
|
|
nlen</H3>
|
|
<PRE>
|
|
public static final int <B>nlen</B></PRE>
|
|
<DL>
|
|
<DL>
|
|
<DT><B>See Also:</B><DD><A HREF="../../constant-values.html#rice.pastry.Id.nlen">Constant Field Values</A></DL>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="Null"><!-- --></A><H3>
|
|
Null</H3>
|
|
<PRE>
|
|
public static final int[] <B>Null</B></PRE>
|
|
<DL>
|
|
<DD>Distance constants
|
|
<P>
|
|
<DL>
|
|
</DL>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="One"><!-- --></A><H3>
|
|
One</H3>
|
|
<PRE>
|
|
public static final int[] <B>One</B></PRE>
|
|
<DL>
|
|
<DL>
|
|
</DL>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="NegOne"><!-- --></A><H3>
|
|
NegOne</H3>
|
|
<PRE>
|
|
public static final int[] <B>NegOne</B></PRE>
|
|
<DL>
|
|
<DL>
|
|
</DL>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="Half"><!-- --></A><H3>
|
|
Half</H3>
|
|
<PRE>
|
|
public static final int[] <B>Half</B></PRE>
|
|
<DL>
|
|
<DL>
|
|
</DL>
|
|
</DL>
|
|
|
|
<!-- ========= 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="Id(int[])"><!-- --></A><H3>
|
|
Id</H3>
|
|
<PRE>
|
|
protected <B>Id</B>(int[] material)</PRE>
|
|
<DL>
|
|
<DD>Constructor.
|
|
<P>
|
|
<DL>
|
|
<DT><B>Parameters:</B><DD><CODE>material</CODE> - an array of length at least IdBitLength/32 containing raw Id material.</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="numDigits(int)"><!-- --></A><H3>
|
|
numDigits</H3>
|
|
<PRE>
|
|
public static int <B>numDigits</B>(int base)</PRE>
|
|
<DL>
|
|
<DD>return the number of digits in a given base
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>base</CODE> - the number of bits in the base
|
|
<DT><B>Returns:</B><DD>the number of digits in that base</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="makeRandomId(java.util.Random)"><!-- --></A><H3>
|
|
makeRandomId</H3>
|
|
<PRE>
|
|
public static <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> <B>makeRandomId</B>(java.util.Random rng)</PRE>
|
|
<DL>
|
|
<DD>Creates a random Id. For testing purposed only -- should NOT be used to generate real node or
|
|
object identifiers (low quality of random material).
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>rng</CODE> - random number generator
|
|
<DT><B>Returns:</B><DD>a random Id</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="makeRandomId(rice.environment.random.RandomSource)"><!-- --></A><H3>
|
|
makeRandomId</H3>
|
|
<PRE>
|
|
public static <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> <B>makeRandomId</B>(<A HREF="../../rice/environment/random/RandomSource.html" title="interface in rice.environment.random">RandomSource</A> rng)</PRE>
|
|
<DL>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="build(int[])"><!-- --></A><H3>
|
|
build</H3>
|
|
<PRE>
|
|
public static <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> <B>build</B>(int[] material)</PRE>
|
|
<DL>
|
|
<DD>Constructor.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>material</CODE> - an array of length at least IdBitLength/32 containing raw Id material.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="build(rice.p2p.commonapi.rawserialization.InputBuffer)"><!-- --></A><H3>
|
|
build</H3>
|
|
<PRE>
|
|
public static <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> <B>build</B>(<A HREF="../../rice/p2p/commonapi/rawserialization/InputBuffer.html" title="interface in rice.p2p.commonapi.rawserialization">InputBuffer</A> buf)
|
|
throws java.io.IOException</PRE>
|
|
<DL>
|
|
<DD>Id (Version 0)
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
+ 160 Bit +
|
|
+ +
|
|
+ +
|
|
+ +
|
|
+ +
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>buf</CODE> -
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.io.IOException</CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="serialize(rice.p2p.commonapi.rawserialization.OutputBuffer)"><!-- --></A><H3>
|
|
serialize</H3>
|
|
<PRE>
|
|
public void <B>serialize</B>(<A HREF="../../rice/p2p/commonapi/rawserialization/OutputBuffer.html" title="interface in rice.p2p.commonapi.rawserialization">OutputBuffer</A> buf)
|
|
throws java.io.IOException</PRE>
|
|
<DL>
|
|
<DD><B>Description copied from interface: <CODE><A HREF="../../rice/p2p/commonapi/Id.html#serialize(rice.p2p.commonapi.rawserialization.OutputBuffer)">Id</A></CODE></B></DD>
|
|
<DD>Serialize
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/p2p/commonapi/Id.html#serialize(rice.p2p.commonapi.rawserialization.OutputBuffer)">serialize</A></CODE> in interface <CODE><A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A></CODE><DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/p2p/commonapi/rawserialization/RawSerializable.html#serialize(rice.p2p.commonapi.rawserialization.OutputBuffer)">serialize</A></CODE> in interface <CODE><A HREF="../../rice/p2p/commonapi/rawserialization/RawSerializable.html" title="interface in rice.p2p.commonapi.rawserialization">RawSerializable</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.io.IOException</CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="build(java.lang.String)"><!-- --></A><H3>
|
|
build</H3>
|
|
<PRE>
|
|
public static <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> <B>build</B>(java.lang.String hex)</PRE>
|
|
<DL>
|
|
<DD>Constructor, which takes the output of a toStringFull() and converts it back
|
|
into an Id. Should not normally be used.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>hex</CODE> - The hexadecimal representation from the toStringFull()</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="build(char[], int, int)"><!-- --></A><H3>
|
|
build</H3>
|
|
<PRE>
|
|
public static <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> <B>build</B>(char[] chars,
|
|
int offset,
|
|
int length)</PRE>
|
|
<DL>
|
|
<DD>Constructor, which takes the output of a toStringFull() and converts it back
|
|
into an Id. Should not normally be used.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>hex</CODE> - The hexadecimal representation from the toStringFull()</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="trans(char)"><!-- --></A><H3>
|
|
trans</H3>
|
|
<PRE>
|
|
protected static byte <B>trans</B>(char c)</PRE>
|
|
<DL>
|
|
<DD>Internal method for mapping digit -> num
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>digit</CODE> - The printed char<DD><CODE>num</CODE> - The byte number</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="build(byte[])"><!-- --></A><H3>
|
|
build</H3>
|
|
<PRE>
|
|
public static <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> <B>build</B>(byte[] material)</PRE>
|
|
<DL>
|
|
<DD>Constructor.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>material</CODE> - an array of length at least IdBitLength/8 containing raw Id material.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="trans(byte[])"><!-- --></A><H3>
|
|
trans</H3>
|
|
<PRE>
|
|
protected static int[] <B>trans</B>(byte[] material)</PRE>
|
|
<DL>
|
|
<DD>Internal method for mapping byte[] -> int[]
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>material</CODE> - The input byte[]
|
|
<DT><B>Returns:</B><DD>THe int[]</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="build()"><!-- --></A><H3>
|
|
build</H3>
|
|
<PRE>
|
|
public static <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> <B>build</B>()</PRE>
|
|
<DL>
|
|
<DD>Constructor. It constructs a new Id with a value of 0 for all bits.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="trans(java.lang.String)"><!-- --></A><H3>
|
|
trans</H3>
|
|
<PRE>
|
|
protected static int[] <B>trans</B>(java.lang.String hex)</PRE>
|
|
<DL>
|
|
<DD>Static method for converting the hex representation into an array of
|
|
ints.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>hex</CODE> - The hexadecimal representation
|
|
<DT><B>Returns:</B><DD>The corresponding int array</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="resolve(java.util.WeakHashMap, rice.pastry.Id)"><!-- --></A><H3>
|
|
resolve</H3>
|
|
<PRE>
|
|
protected static <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> <B>resolve</B>(java.util.WeakHashMap map,
|
|
<A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> id)</PRE>
|
|
<DL>
|
|
<DD>Method which performs the coalescing and interaction with the weak hash map
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>id</CODE> - The Id to coalesce
|
|
<DT><B>Returns:</B><DD>The Id to use</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getCW()"><!-- --></A><H3>
|
|
getCW</H3>
|
|
<PRE>
|
|
public <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> <B>getCW</B>()</PRE>
|
|
<DL>
|
|
<DD>gets the Id just clockwise from this
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>The CW value</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getCCW()"><!-- --></A><H3>
|
|
getCCW</H3>
|
|
<PRE>
|
|
public <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> <B>getCCW</B>()</PRE>
|
|
<DL>
|
|
<DD>gets the Id just counterclockwise from this
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>The CCW value</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="isBetween(rice.pastry.Id, rice.pastry.Id)"><!-- --></A><H3>
|
|
isBetween</H3>
|
|
<PRE>
|
|
public boolean <B>isBetween</B>(<A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> ccw,
|
|
<A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> cw)</PRE>
|
|
<DL>
|
|
<DD>Checks if this Id is between two given ids ccw (inclusive) and cw (exclusive) on the circle
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>ccw</CODE> - the counterclockwise id<DD><CODE>cw</CODE> - the clockwise id
|
|
<DT><B>Returns:</B><DD>true if this is between ccw (inclusive) and cw (exclusive), false otherwise</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getDigit(int, int)"><!-- --></A><H3>
|
|
getDigit</H3>
|
|
<PRE>
|
|
public int <B>getDigit</B>(int i,
|
|
int b)</PRE>
|
|
<DL>
|
|
<DD>Gets the ith digit in base 2^b. i = 0 is the least significant digit.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>i</CODE> - which digit to get.<DD><CODE>b</CODE> - which power of 2 is the base to get it in.
|
|
<DT><B>Returns:</B><DD>the ith digit in base 2^b.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getDomainPrefix(int, int, int, int)"><!-- --></A><H3>
|
|
getDomainPrefix</H3>
|
|
<PRE>
|
|
public <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> <B>getDomainPrefix</B>(int row,
|
|
int column,
|
|
int suffixDigit,
|
|
int b)</PRE>
|
|
<DL>
|
|
<DD>produces a Id whose prefix up to row is identical to this, followed by a digit with value
|
|
column, followed by a suffix of digits with value suffixDigits.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>row</CODE> - the length of the prefix<DD><CODE>column</CODE> - the value of the following digit<DD><CODE>suffixDigit</CODE> - the value of the suffix digits<DD><CODE>b</CODE> - power of 2 of the base
|
|
<DT><B>Returns:</B><DD>the resulting Id</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getAlternateId(int, int, int)"><!-- --></A><H3>
|
|
getAlternateId</H3>
|
|
<PRE>
|
|
public <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> <B>getAlternateId</B>(int num,
|
|
int b,
|
|
int i)</PRE>
|
|
<DL>
|
|
<DD>produces a set of ids (keys) that are evenly distributed around the id ring. One invocation
|
|
produces the i-th member of a set of size num. The set is evenly distributed around the ring,
|
|
with an offset given by this Id. The set is useful for constructing, for instance, Scribe trees
|
|
with disjoint sets of interior nodes.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>num</CODE> - the number of Ids in the set (must be <= 2^b)<DD><CODE>b</CODE> - the routing base (as a power of 2)<DD><CODE>i</CODE> - the index of the requested member of the set (0<=i<num; the 0-th member is this)
|
|
<DT><B>Returns:</B><DD>the resulting set member, or null in case of illegal arguments</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="isBetween(rice.p2p.commonapi.Id, rice.p2p.commonapi.Id)"><!-- --></A><H3>
|
|
isBetween</H3>
|
|
<PRE>
|
|
public boolean <B>isBetween</B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A> ccw,
|
|
<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A> cw)</PRE>
|
|
<DL>
|
|
<DD>Checks if this Id is between two given ids ccw (inclusive) and cw (exclusive) on the circle
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/p2p/commonapi/Id.html#isBetween(rice.p2p.commonapi.Id, rice.p2p.commonapi.Id)">isBetween</A></CODE> in interface <CODE><A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>ccw</CODE> - the counterclockwise id<DD><CODE>cw</CODE> - the clockwise id
|
|
<DT><B>Returns:</B><DD>true if this is between ccw (inclusive) and cw (exclusive), false otherwise</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="blit(byte[])"><!-- --></A><H3>
|
|
blit</H3>
|
|
<PRE>
|
|
public void <B>blit</B>(byte[] target)</PRE>
|
|
<DL>
|
|
<DD>Blits the Id into a target array.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>target</CODE> - an array of length at least IdBitLength/8 for the Id to be stored in.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="blit(byte[], int)"><!-- --></A><H3>
|
|
blit</H3>
|
|
<PRE>
|
|
public void <B>blit</B>(byte[] target,
|
|
int offset)</PRE>
|
|
<DL>
|
|
<DD>Blits the distance into a target array, starting at the given offset.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>offset</CODE> - The offset to start at<DD><CODE>target</CODE> - an array of length at least IdBitLength/8 for the distance to be stored in.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="copy()"><!-- --></A><H3>
|
|
copy</H3>
|
|
<PRE>
|
|
public byte[] <B>copy</B>()</PRE>
|
|
<DL>
|
|
<DD>Copy the Id into a freshly generated array.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>a fresh copy of the Id material</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="equals(java.lang.Object)"><!-- --></A><H3>
|
|
equals</H3>
|
|
<PRE>
|
|
public boolean <B>equals</B>(java.lang.Object obj)</PRE>
|
|
<DL>
|
|
<DD>Equality operator for Ids.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Overrides:</B><DD><CODE>equals</CODE> in class <CODE>java.lang.Object</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>obj</CODE> - a Id object
|
|
<DT><B>Returns:</B><DD>true if they are equal, false otherwise.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="compareTo(rice.p2p.commonapi.Id)"><!-- --></A><H3>
|
|
compareTo</H3>
|
|
<PRE>
|
|
public int <B>compareTo</B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A> obj)</PRE>
|
|
<DL>
|
|
<DD>Comparison operator for Ids. The comparison that occurs is a numerical comparison.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE>compareTo</CODE> in interface <CODE>java.lang.Comparable<<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>obj</CODE> - the Id to compare with.
|
|
<DT><B>Returns:</B><DD>negative if this < obj, 0 if they are equal and positive if this > obj.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="toByteArray()"><!-- --></A><H3>
|
|
toByteArray</H3>
|
|
<PRE>
|
|
public byte[] <B>toByteArray</B>()</PRE>
|
|
<DL>
|
|
<DD>Returns the byte array representation of this Id
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/p2p/commonapi/Id.html#toByteArray()">toByteArray</A></CODE> in interface <CODE><A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>The byte array representation of this id</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="toByteArray(byte[], int)"><!-- --></A><H3>
|
|
toByteArray</H3>
|
|
<PRE>
|
|
public void <B>toByteArray</B>(byte[] array,
|
|
int offset)</PRE>
|
|
<DL>
|
|
<DD>Stores the byte[] value of this Id in the provided byte array
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/p2p/commonapi/Id.html#toByteArray(byte[], int)">toByteArray</A></CODE> in interface <CODE><A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getByteArrayLength()"><!-- --></A><H3>
|
|
getByteArrayLength</H3>
|
|
<PRE>
|
|
public int <B>getByteArrayLength</B>()</PRE>
|
|
<DL>
|
|
<DD>Returns the length of the byte[] representing this Id
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/p2p/commonapi/Id.html#getByteArrayLength()">getByteArrayLength</A></CODE> in interface <CODE><A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>The length of the byte[] representing this Id</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="hashCode()"><!-- --></A><H3>
|
|
hashCode</H3>
|
|
<PRE>
|
|
public int <B>hashCode</B>()</PRE>
|
|
<DL>
|
|
<DD>Hash codes for Ids.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Overrides:</B><DD><CODE>hashCode</CODE> in class <CODE>java.lang.Object</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>a hash code.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="add(rice.pastry.Id.Distance)"><!-- --></A><H3>
|
|
add</H3>
|
|
<PRE>
|
|
public <A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> <B>add</B>(<A HREF="../../rice/pastry/Id.Distance.html" title="class in rice.pastry">Id.Distance</A> offset)</PRE>
|
|
<DL>
|
|
<DD>Returns an Id corresponding to this Id plus a given distance
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>offset</CODE> - the distance to add
|
|
<DT><B>Returns:</B><DD>the new Id</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="distance(rice.pastry.Id)"><!-- --></A><H3>
|
|
distance</H3>
|
|
<PRE>
|
|
public <A HREF="../../rice/pastry/Id.Distance.html" title="class in rice.pastry">Id.Distance</A> <B>distance</B>(<A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> nid)</PRE>
|
|
<DL>
|
|
<DD>Returns the shorter numerical distance on the ring between a pair of Ids.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>nid</CODE> - the other node id.
|
|
<DT><B>Returns:</B><DD>the distance between this and nid.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="distance(rice.pastry.Id, rice.pastry.Id.Distance)"><!-- --></A><H3>
|
|
distance</H3>
|
|
<PRE>
|
|
public <A HREF="../../rice/pastry/Id.Distance.html" title="class in rice.pastry">Id.Distance</A> <B>distance</B>(<A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> nid,
|
|
<A HREF="../../rice/pastry/Id.Distance.html" title="class in rice.pastry">Id.Distance</A> d)</PRE>
|
|
<DL>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="longDistance(rice.pastry.Id)"><!-- --></A><H3>
|
|
longDistance</H3>
|
|
<PRE>
|
|
public <A HREF="../../rice/pastry/Id.Distance.html" title="class in rice.pastry">Id.Distance</A> <B>longDistance</B>(<A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> nid)</PRE>
|
|
<DL>
|
|
<DD>Returns the longer numerical distance on the ring between a pair of Ids.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>nid</CODE> - the other node id.
|
|
<DT><B>Returns:</B><DD>the distance between this and nid.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="equals(rice.pastry.Id)"><!-- --></A><H3>
|
|
equals</H3>
|
|
<PRE>
|
|
public boolean <B>equals</B>(<A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> nid)</PRE>
|
|
<DL>
|
|
<DD>Equivalence relation for Ids.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>nid</CODE> - the other node id.
|
|
<DT><B>Returns:</B><DD>true if they are equal, false otherwise.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="clockwise(rice.pastry.Id)"><!-- --></A><H3>
|
|
clockwise</H3>
|
|
<PRE>
|
|
public boolean <B>clockwise</B>(<A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> nid)</PRE>
|
|
<DL>
|
|
<DD>Checks to see if the Id nid is clockwise or counterclockwise from this, on the ring. An Id is
|
|
clockwise if it is within the half circle clockwise from this on the ring. An Id is considered
|
|
counter-clockwise from itself.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>nid</CODE> - The Id we are comparing to
|
|
<DT><B>Returns:</B><DD>true if clockwise, false otherwise.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="checkBit(int)"><!-- --></A><H3>
|
|
checkBit</H3>
|
|
<PRE>
|
|
public boolean <B>checkBit</B>(int i)</PRE>
|
|
<DL>
|
|
<DD>Checks if the ith bit is flipped. i = 0 is the least significant bit.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>i</CODE> - which bit to check.
|
|
<DT><B>Returns:</B><DD>true if the bit is set, false otherwise.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="indexOfMSDB(rice.pastry.Id)"><!-- --></A><H3>
|
|
indexOfMSDB</H3>
|
|
<PRE>
|
|
public int <B>indexOfMSDB</B>(<A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> nid)</PRE>
|
|
<DL>
|
|
<DD>Returns the index of the most significant differing bit (MSDB).
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>nid</CODE> - another node id to compare with.
|
|
<DT><B>Returns:</B><DD>the index of the msdb (0 is the least significant) / will return negative if they do
|
|
not differ.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="indexOfMSDD(rice.pastry.Id, int)"><!-- --></A><H3>
|
|
indexOfMSDD</H3>
|
|
<PRE>
|
|
public int <B>indexOfMSDD</B>(<A HREF="../../rice/pastry/Id.html" title="class in rice.pastry">Id</A> nid,
|
|
int base)</PRE>
|
|
<DL>
|
|
<DD>Returns the index of the most significant different digit (MSDD) in a given base.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>nid</CODE> - another node id to compare with.<DD><CODE>base</CODE> - the base (as a power of two) to compare in.
|
|
<DT><B>Returns:</B><DD>the index of the msdd (0 is the least significant) / will return negative if they do
|
|
not differ.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="toString()"><!-- --></A><H3>
|
|
toString</H3>
|
|
<PRE>
|
|
public java.lang.String <B>toString</B>()</PRE>
|
|
<DL>
|
|
<DD>Returns a string representation of the Id in base 16. The string is a byte string from most to
|
|
least significant.
|
|
|
|
This was updated by Jeff because it was becomming a performance bottleneck.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>A String representation of this Id, abbreviated</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="toStringBare()"><!-- --></A><H3>
|
|
toStringBare</H3>
|
|
<PRE>
|
|
public java.lang.String <B>toStringBare</B>()</PRE>
|
|
<DL>
|
|
<DD>Similar to toString(), but not wrapped by <0x ..>
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="toStringFull()"><!-- --></A><H3>
|
|
toStringFull</H3>
|
|
<PRE>
|
|
public java.lang.String <B>toStringFull</B>()</PRE>
|
|
<DL>
|
|
<DD>Returns the complete represntation of this Id, in hex.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/p2p/commonapi/Id.html#toStringFull()">toStringFull</A></CODE> in interface <CODE><A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>The complete representation of this Id, in hexadecimal</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="clockwise(rice.p2p.commonapi.Id)"><!-- --></A><H3>
|
|
clockwise</H3>
|
|
<PRE>
|
|
public boolean <B>clockwise</B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A> nid)</PRE>
|
|
<DL>
|
|
<DD>Checks to see if the Id nid is clockwise or counterclockwise from this, on the ring. An Id is
|
|
clockwise if it is within the half circle clockwise from this on the ring. An Id is considered
|
|
counter-clockwise from itself.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/p2p/commonapi/Id.html#clockwise(rice.p2p.commonapi.Id)">clockwise</A></CODE> in interface <CODE><A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>nid</CODE> - DESCRIBE THE PARAMETER
|
|
<DT><B>Returns:</B><DD>true if clockwise, false otherwise.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="addToId(rice.p2p.commonapi.Id.Distance)"><!-- --></A><H3>
|
|
addToId</H3>
|
|
<PRE>
|
|
public <A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A> <B>addToId</B>(<A HREF="../../rice/p2p/commonapi/Id.Distance.html" title="interface in rice.p2p.commonapi">Id.Distance</A> offset)</PRE>
|
|
<DL>
|
|
<DD>Returns an Id corresponding to this Id plus a given distance
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/p2p/commonapi/Id.html#addToId(rice.p2p.commonapi.Id.Distance)">addToId</A></CODE> in interface <CODE><A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>offset</CODE> - the distance to add
|
|
<DT><B>Returns:</B><DD>the new Id</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="distanceFromId(rice.p2p.commonapi.Id)"><!-- --></A><H3>
|
|
distanceFromId</H3>
|
|
<PRE>
|
|
public <A HREF="../../rice/p2p/commonapi/Id.Distance.html" title="interface in rice.p2p.commonapi">Id.Distance</A> <B>distanceFromId</B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A> nid)</PRE>
|
|
<DL>
|
|
<DD>Returns the shorter numerical distance on the ring between a pair of Ids.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/p2p/commonapi/Id.html#distanceFromId(rice.p2p.commonapi.Id)">distanceFromId</A></CODE> in interface <CODE><A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>nid</CODE> - the other node id.
|
|
<DT><B>Returns:</B><DD>the distance between this and nid.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="longDistanceFromId(rice.p2p.commonapi.Id)"><!-- --></A><H3>
|
|
longDistanceFromId</H3>
|
|
<PRE>
|
|
public <A HREF="../../rice/p2p/commonapi/Id.Distance.html" title="interface in rice.p2p.commonapi">Id.Distance</A> <B>longDistanceFromId</B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A> nid)</PRE>
|
|
<DL>
|
|
<DD>Returns the longer numerical distance on the ring between a pair of Ids.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/p2p/commonapi/Id.html#longDistanceFromId(rice.p2p.commonapi.Id)">longDistanceFromId</A></CODE> in interface <CODE><A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>nid</CODE> - the other node id.
|
|
<DT><B>Returns:</B><DD>the distance between this and nid.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getType()"><!-- --></A><H3>
|
|
getType</H3>
|
|
<PRE>
|
|
public short <B>getType</B>()</PRE>
|
|
<DL>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/p2p/commonapi/Id.html#getType()">getType</A></CODE> in interface <CODE><A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="main(java.lang.String[])"><!-- --></A><H3>
|
|
main</H3>
|
|
<PRE>
|
|
public static void <B>main</B>(java.lang.String[] args)</PRE>
|
|
<DL>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<!-- ========= END OF CLASS DATA ========= -->
|
|
<HR>
|
|
|
|
|
|
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
|
<A NAME="navbar_bottom"><!-- --></A>
|
|
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
|
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
|
<TR>
|
|
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
|
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
|
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
|
<TR ALIGN="center" VALIGN="top">
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../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/Id.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/pastry/ExponentialBackoffScheduledMessage.html" title="class in rice.pastry"><B>PREV CLASS</B></A>
|
|
<A HREF="../../rice/pastry/Id.Distance.html" title="class in rice.pastry"><B>NEXT CLASS</B></A></FONT></TD>
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
<A HREF="../../index.html?rice/pastry/Id.html" target="_top"><B>FRAMES</B></A>
|
|
<A HREF="Id.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_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
DETAIL: <A HREF="#field_detail">FIELD</A> | <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>
|