/************************************************************************
* $Id: DList.java,v 1.1.1.1 2000/03/29 22:58:14 kkeys Exp $
*
* DList
* version 1.0 beta
*************************************************************************
/***********************************************************************
By accessing this software, DLIST, you are duly informed of and
agree to be bound by the conditions described below in this notice:
This software product, DLIST, is developed by Bradley Huffaker, and
Jaeyeon Jung copyrighted(C) 1998 by the University of California,
San Diego (UCSD), with all rights reserved. UCSD administers the NLANR
Cache grants, NCR-9796082 and NCR-9616602, under which most of this code
was developed.
There is no charge for DLIST software. You can redistribute it and/or
modify it under the terms of the GNU General Public License, v. 2 dated
June 1991 which is incorporated by reference herein. DLIST is
distributed WITHOUT ANY WARRANTY, IMPLIED OR EXPRESS, OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE or that the use of
it will not infringe on any third party's intellectual property
rights.
You should have received a copy of the GNU GPL along with the DLIST
program. Copies can also be obtained from
http://www.gnu.org/copyleft/gpl.html or by writing to
University of California, San Diego
SDSC/CAIDA/NLANR
9500 Gilman Dr., MS-0505
La Jolla, CA 92093 - 0505 USA
Or contact INFO@NLANR.NET
**************************************************************************/
package bhuffake.plankton;
import java.awt.*;
/** DNode *******************************************
* Helper class to DList. Used to store the data
*****************************************************/
class DNode
{
public DisplayObject value;
public DNode next;
public DNode(DisplayObject val)
{
value = val;
next = null;
}
}
/** DList *******************************************
* This code has been Modifed to Work with
* plankton.
*
* A linked list that has many of the standard
* linked list member functions clear, enqueue,
* push, pop, and empty. But also have a few of
* my own creation: where, reset, next, insert,
* and end. Which allow the user to edit/view
* list with out destory it.
*****************************************************/
public class DList
{
DNode first;
DNode tail;
DNode before;
DNode where;
boolean constant = false;
/** DList() *******************************************
* Default Constructor.
*****************************************************/
public DList()
{
where=before=tail = first = null;
}
/** DList(DList list) *****************************
* Copy constructor. Create new list with same
* values.
*****************************************************/
public DList(DList list)
{
if (list.first == null)
{
tail = first = null;
return;
}
tail = first =new DNode(list.first.value);
tail.next = null;
DNode his = list.first.next;
tail = first;
while (his != null)
{
tail.next = new DNode(his.value);
tail = tail.next;
his = his.next;
}
reset();
}
/** DList() **************************************
* Gives a new DList with its own where pointer
* that points to the same linked list
**************************************************/
synchronized DList DList()
{
DList dlist = new DList();
dlist.first = first;
dlist.tail = tail;
dlist.constant = false;
return dlist;
}
/** clear() *****************************************
* Removes all nodes from the list. Notes that
* because java does all the garabage collection
* Simple making is so all nodes point to null
* is same thing.
*****************************************************/
synchronized public void clear()
{
if (constant)
return;
where = before= tail = first = null;
}
/** add(DisplayObject value) ********************************
* Adds the value in to the list sorting it with the less
* operator.
*****************************************************/
synchronized public void add(DisplayObject value)
{
if (constant)
return;
DNode temp = new DNode(value);
if (first == null)
{
tail = first = temp;
first.next = null;
return;
}
if (first.value.greater(value))
{
temp.next = first;
first = temp;
}
else
{
DNode current = first;
while (current.next != null
&& value.greater(current.next.value))
current = current.next;
temp.next = current.next;
current.next = temp;
}
if (temp.next == null)
tail = temp;
if (temp.next == where)
before = temp;
}
/** push(DisplayObject value) ********************************
* Adds the value to the front of the list.
* This is modified to use the less then operator to
* sort the DList.
*****************************************************/
synchronized public void push(DisplayObject value)
{
if (constant)
return;
DNode temp = new DNode(value);
if (first == null)
{
tail = first = temp;
first.next = null;
return;
}
temp.next = first;
first = temp;
temp = null;
}
/** enqueue(DisplayObject value) ****************************
* Stores value in a node at the end of the link
* list.
*****************************************************/
synchronized public void enqueue(DisplayObject value)
{
if (constant)
return;
DNode temp = new DNode(value);
if (first == null)
{
tail = first = temp;
first.next = null;
return;
}
tail.next = temp;
tail = tail.next;
tail.next = null;
}
/** top() *******************************************
* Returns the value of the top node or null
* if there are no nodes.
*****************************************************/
synchronized public DisplayObject top ()
{
if (first != null)
return first.value;
else
return null;
}
/** pop() *******************************************
* Removes the top node and then returns
* the value it contrained.
*****************************************************/
synchronized public DisplayObject pop ()
{
if (first == null)
return null;
if (first == where)
where = first.next;
DisplayObject value = first.value;
first = first.next;
return value;
}
/** empty() *****************************************
* Checks to see if the list has any nodes. Returns
* true if it does else false.
*****************************************************/
synchronized public boolean empty()
{
return (first == null);
}
/** exists(DisplayObject value) *****************************
* Returns true if value is contained in the link
* list and false if it is not found.
*****************************************************/
synchronized public boolean exists(DisplayObject value)
{
DNode current = first;
while (current != null)
{
if (current.value == value)
return true;
current = current.next;
}
return false;
}
/** drop(DisplayObject value) ******************************
* Drop the first node in the list that contains
* the passed value.
*****************************************************/
synchronized public boolean drop(DisplayObject value)
{
if (constant)
return false;
DNode previous = first;
DNode current = first;
while (current != null)
{
if (current.value == value)
{
if (current == first)
{
previous = first = first.next;
}
else
previous.next = current.next;
if (before == current)
before = previous;
else if (where == current)
where = current.next;
if (current == tail)
tail = previous;
return true;
}
previous = current;
current = current.next;
}
return false;
}
/** count() *******************************************
* Returns the number of nodes currently in linked
* list.
*****************************************************/
synchronized public int count()
{
int count = 0;
DNode current = first;
while(current != null)
{
count++;
current = current.next;
}
return count;
}
/** where() *******************************************
* Returns the value stored in the where pointer.
* returns null if the where pointer is null.
*****************************************************/
synchronized public DisplayObject where()
{
if (where != null)
return where.value;
else
return null;
}
/** next() ******************************************
* Moves the where pointer to the next node in the
* link and returns the value that was stored in the
* current node, before the move.
*****************************************************/
synchronized public DisplayObject next()
{
if (where == null)
return null;
DisplayObject temp = where.value;
before = where;
where = where.next;
return temp;
}
/** remove() ****************************************
* Removes the node that where is pointing to.
* Then returns the value that was stored in the
* where pointer.
*****************************************************/
synchronized public DisplayObject remove()
{
if (constant)
return null;
if (where == null)
return null;
if (before == null)
first = first.next;
DNode temp = where;
before.next = where.next;
where = where.next;
return temp.value;
}
/** insert(DisplayObject value) ****************************
* Inserts a value into the linked list just ahead
* of the location of the where pointer.
*****************************************************/
synchronized public void insert(DisplayObject value)
{
if (constant)
return;
DNode node = new DNode (value);
if (before == null)
{
node.next = first;
first = node;
}
else
{
node.next = before.next;
before.next = node;
}
where = node;
}
/** reset() *****************************************
* Reset the where pointer to the beginnen of
* Of the linked list. Used to start a next
* Loop
*****************************************************/
synchronized public void reset()
{
before = null;
where = first;
}
/** end() *******************************************
* Notes where the where pointer reaches the end
* of the list. Used as the boolean statment
* when interating throught the loop with next
*****************************************************/
synchronized public boolean end()
{
return (where == null);
}
/** String print() **********************************
* Returns a string which is a close representaion
* of where the major nodes are
* f= first
* t = tail
* b = before
* w = where
******************************************************/
synchronized public String print()
{
DNode current = first;
String answer = "[";
while (current != null)
{
if (current == first)
answer = answer + "f";
if (current == before)
answer = answer + "b";
if (current == where)
answer = answer + "w";
if (current == tail)
answer = answer + "t";
answer = answer + ",";
current = current.next;
}
if (where == null)
answer = answer + "w";
answer = answer + "]";
return answer;
}
}
There was peace and harmony in the home of the Reverend Taylor. An air of neatness and prosperity was about his four-room adobe house. The mocking-bird that hung in a willow cage against the white wall, by the door, whistled sweet mimicry of the cheep of the little chickens in the back yard, and hopped to and fro and up and down on his perches, pecking at the red chili between the bars. From the corner of his eyes he could peek into the window, and it was bright with potted geraniums, white as the wall, or red as the chili, or pink as the little crumpled palm that patted against the glass to him. It was the first scene of the closing act of the tragic comedy of the Geronimo campaign. That wily old devil, weary temporarily of the bloodshed he had continued with more or less regularity for many years, had[Pg 297] sent word to the officers that he would meet them without their commands, in the Ca?on de los Embudos, across the border line, to discuss the terms of surrender. The officers had forthwith come, Crook yet hopeful that something might be accomplished by honesty and plain dealing; the others, for the most part, doubting. The two rival Ministers of England became every day more embittered against each other; and Bolingbroke grew more daring in his advances towards the Pretender, and towards measures only befitting a Stuart's reign. In order to please the High Church, whilst he was taking the surest measures to ruin it by introducing a popish prince, he consulted with Atterbury, and they agreed to bring in a Bill which should prevent Dissenters from educating their own children. This measure was sure to please the Hanoverian Tories, who were as averse from the Dissenters as the Whigs. Thus it would conciliate them and obtain their support at the[19] very moment that the chief authors of it were planning the ruin of their party. This Bill was called the Schism Bill, and enjoined that no person in Great Britain should keep any school, or act as tutor, who had not first subscribed the declaration to conform to the Church of England, and obtained a licence of the diocesan. Upon failure of so doing, the party might be committed to prison without bail; and no such licence was to be granted before the party produced a certificate of his having received the Sacrament according to the communion of the English Church within the last year, and of his having also subscribed the oaths of Allegiance and Supremacy. The earliest martial event of the year 1760 was the landing of Thurot, the French admiral, at Carrickfergus, on the 28th of February. He had been beating about between Scandinavia and Ireland till he had only three ships left, and but six hundred soldiers. But Carrickfergus being negligently garrisoned, Thurot made his way into the town and plundered it, but was soon obliged to abandon it. He was overtaken by Captain Elliot and three frigates before he had got out to sea, his ships were taken, he himself was killed, and his men were carried prisoners to Ramsey, in the Isle of Man. "I see you've got a cow here," said a large man wearing a dingy blue coat with a Captain's faded shoulder-straps. "I'm a Commissary, and it's my duty to take her." Suddenly they heard little Pete's voice calling: "Stop your ranting and tell me how the hogs got you." "Hold, Lord de Boteler," interrupted Father John, calmly; "the threat need not pass thy lips: I go; but before I depart I shall say, in spite of mortal tongue or mortal hand, that honor and true knighthood no longer preside in this hall, where four generations upheld them unsullied." HoME小明看看台湾视频发布
ENTER NUMBET 0017
quanliba.com.cn
riju9.net.cn
www.daiwo9.com.cn
fangbb.com.cn
layan5.com.cn
mendu2.net.cn
www.richa7.com.cn
jiaba4.net.cn
jujue6.com.cn
www.arts08.com.cn