📄 comparableedge.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Fri Aug 23 13:18:15 EDT 2002 --><TITLE>: Class ComparableEdge</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <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="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><a href=../copyright.html target=_top>© 1998-2002 McGraw-Hill</a></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../structure/ComparableAssociation.html"><B>PREV CLASS</B></A> <A HREF="../structure/DoublyLinkedList.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="ComparableEdge.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#fields_inherited_from_class_structure.Edge">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: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">structure</FONT><BR>Class ComparableEdge</H2><PRE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">java.lang.Object</A> | +--<A HREF="../structure/Edge.html">structure.Edge</A> | +--<B>structure.ComparableEdge</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Comparable.html">Comparable</A></DD></DL><HR><DL><DT>public class <B>ComparableEdge</B><DT>extends <A HREF="../structure/Edge.html">Edge</A><DT>implements <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Comparable.html">Comparable</A></DL><P>A class implementing common edge type among graphs. This class supports both directed and undirected edges. Edge may also have visited flags set and cleared. ComparableEdge differs from edge, however, in that it requires that its lable be of a comparable type. <P> Typical usage: <P> <pre> Graph g = new GraphListDirected(); g.add("harry"); g.add("sally"); g.addEdge("harry","sally","friendly"); ComparableEdge e = new <A HREF="../structure/ComparableEdge.html#ComparableEdge(structure.Edge)"><CODE>ComparableEdge(g.getEdge("harry","sally"))</CODE></A>; Comparable label = e.<A HREF="../structure/Edge.html#label()"><CODE>label()</CODE></A>; Vertex source = e.<A HREF="../structure/Edge.html#here()"><CODE>here()</CODE></A>; Vertex destination = e.<A HREF="../structure/Edge.html#there()"><CODE>there()</CODE></A>; ComparableEdge e2 = e; if(e.<A HREF="../structure/ComparableEdge.html#compareTo(java.lang.Object)"><CODE>compareTo(e2)</CODE></A> == 0){ e.<A HREF="../structure/Edge.html#visit()"><CODE>visit()</CODE></A>; e.<A HREF="../structure/Edge.html#reset()"><CODE>reset()</CODE></A>; } ... </pre><P><DL><DT><B>See Also: </B><DD><A HREF="../structure/Graph.html"><CODE>Graph</CODE></A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="fields_inherited_from_class_structure.Edge"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from class structure.<A HREF="../structure/Edge.html">Edge</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../structure/Edge.html#directed">directed</A>, <A HREF="../structure/Edge.html#label">label</A>, <A HREF="../structure/Edge.html#visited">visited</A>, <A HREF="../structure/Edge.html#vLabel">vLabel</A></CODE></TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../structure/ComparableEdge.html#ComparableEdge(structure.Edge)">ComparableEdge</A></B>(<A HREF="../structure/Edge.html">Edge</A> e)</CODE><BR> Construct a (possibly directed) edge between two labeled vertices.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../structure/ComparableEdge.html#ComparableEdge(java.lang.Object, java.lang.Object, java.lang.Object, boolean)">ComparableEdge</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> vtx1, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> vtx2, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> label, boolean directed)</CODE><BR> Construct a (possibly directed) edge between two labeled vertices.</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></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="../structure/ComparableEdge.html#compareTo(java.lang.Object)">compareTo</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> other)</CODE><BR> Compare edge, based on labels.</TD>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -