?? order.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.4.2_02) on Wed Jun 09 11:15:36 EDT 2004 -->
<TITLE>
Order
</TITLE>
<META NAME="keywords" CONTENT="Order class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="Order";
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
Class Order</H2>
<PRE>
<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="./resources/inherit.gif" ALT="extended by"><B>Order</B>
</PRE>
<HR>
<DL>
<DT>public class <B>Order</B><DT>extends <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></DL>
<P>
This class models a list of ordered items. It contains a collection of <A HREF="OrderItem.html" title="class in "><CODE>OrderItem</CODE></A> objects.
<P>
<P>
<DL>
<DT><B>Version:</B></DT> <DD>1.0.0</DD><DT><B>Author:</B></DT> <DD>author name</DD><DT><B>See Also:</B><DD><A HREF="OrderItem.html" title="class in "><CODE>OrderItem</CODE></A></DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<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="Order.html#Order()">Order</A></B>()</CODE>
<BR>
Constructs an empty order.</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">
<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> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Order.html#addItem(OrderItem)">addItem</A></B>(<A HREF="OrderItem.html" title="class in ">OrderItem</A> orderItem)</CODE>
<BR>
Adds a <A HREF="OrderItem.html" title="class in "><CODE>OrderItem</CODE></A> object to this order.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="OrderItem.html" title="class in ">OrderItem</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="Order.html#getItem(Product)">getItem</A></B>(<A HREF="Product.html" title="class in ">Product</A> product)</CODE>
<BR>
Returns the <A HREF="OrderItem.html" title="class in "><CODE>OrderItem</CODE></A> object with the specified product.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="OrderItem.html" title="class in ">OrderItem</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="Order.html#getItems()">getItems</A></B>()</CODE>
<BR>
Returns an array containing all the items in this order.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Iterator.html" title="class or interface in java.util">Iterator</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="Order.html#getItemsIterator()">getItemsIterator</A></B>()</CODE>
<BR>
Returns an iterator over the items in this order.</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="Order.html#getNumberOfItems()">getNumberOfItems</A></B>()</CODE>
<BR>
Returns the number of items in this order.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> double</CODE></FONT></TD>
<TD><CODE><B><A HREF="Order.html#getTotalCost()">getTotalCost</A></B>()</CODE>
<BR>
Returns the total cost of this order.</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="Order.html#removeItem(OrderItem)">removeItem</A></B>(<A HREF="OrderItem.html" title="class in ">OrderItem</A> orderItem)</CODE>
<BR>
Removes a <A HREF="OrderItem.html" title="class in "><CODE>OrderItem</CODE></A> object from this order.</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">
<TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="Order()"><!-- --></A><H3>
Order</H3>
<PRE>
public <B>Order</B>()</PRE>
<DL>
<DD>Constructs an empty order.
<P>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="addItem(OrderItem)"><!-- --></A><H3>
addItem</H3>
<PRE>
public void <B>addItem</B>(<A HREF="OrderItem.html" title="class in ">OrderItem</A> orderItem)</PRE>
<DL>
<DD>Adds a <A HREF="OrderItem.html" title="class in "><CODE>OrderItem</CODE></A> object to this order.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>orderItem</CODE> - the item to be added.</DL>
</DD>
</DL>
<HR>
<A NAME="removeItem(OrderItem)"><!-- --></A><H3>
removeItem</H3>
<PRE>
public void <B>removeItem</B>(<A HREF="OrderItem.html" title="class in ">OrderItem</A> orderItem)</PRE>
<DL>
<DD>Removes a <A HREF="OrderItem.html" title="class in "><CODE>OrderItem</CODE></A> object from this order.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>orderItem</CODE> - the item to be removed.</DL>
</DD>
</DL>
<HR>
<A NAME="getItemsIterator()"><!-- --></A><H3>
getItemsIterator</H3>
<PRE>
public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Iterator.html" title="class or interface in java.util">Iterator</A> <B>getItemsIterator</B>()</PRE>
<DL>
<DD>Returns an iterator over the items in this order. return an <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Iterator.html" title="class or interface in java.util"><CODE>Iterator</CODE></A>
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getItem(Product)"><!-- --></A><H3>
getItem</H3>
<PRE>
public <A HREF="OrderItem.html" title="class in ">OrderItem</A> <B>getItem</B>(<A HREF="Product.html" title="class in ">Product</A> product)</PRE>
<DL>
<DD>Returns the <A HREF="OrderItem.html" title="class in "><CODE>OrderItem</CODE></A> object with the specified product.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>product</CODE> - a product.<DT><B>Returns:</B><DD>The <A HREF="OrderItem.html" title="class in "><CODE>OrderItem</CODE></A> object with the specifed product. Returns <code>null</code> if there are no items in this order with the specified product.</DL>
</DD>
</DL>
<HR>
<A NAME="getNumberOfItems()"><!-- --></A><H3>
getNumberOfItems</H3>
<PRE>
public int <B>getNumberOfItems</B>()</PRE>
<DL>
<DD>Returns the number of items in this order.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the number of <A HREF="OrderItem.html" title="class in "><CODE>OrderItem</CODE></A> objects in this order.</DL>
</DD>
</DL>
<HR>
<A NAME="getTotalCost()"><!-- --></A><H3>
getTotalCost</H3>
<PRE>
public double <B>getTotalCost</B>()</PRE>
<DL>
<DD>Returns the total cost of this order.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the total cost of this order.</DL>
</DD>
</DL>
<HR>
<A NAME="getItems()"><!-- --></A><H3>
getItems</H3>
<PRE>
public <A HREF="OrderItem.html" title="class in ">OrderItem</A>[] <B>getItems</B>()</PRE>
<DL>
<DD>Returns an array containing all the items in this order.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>an array containing the items of this order.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<HR>
</BODY>
</HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -