coins.backend.util
クラス BiList

java.lang.Object
  |
  +--coins.backend.util.BiLink
        |
        +--coins.backend.util.BiList
すべての実装インタフェース:
java.lang.Cloneable

public class BiList
extends BiLink
implements java.lang.Cloneable

Bi-directional list (head part)


入れ子クラスの概要
(パッケージプライベート)  class BiList.BiListIterator
          Iterator for scanning a BiList.
 
フィールドの概要
 
クラス coins.backend.util.BiLink から継承したフィールド
elem, next, prev
 
コンストラクタの概要
BiList()
          Create empty list.
 
メソッドの概要
 BiLink add(java.lang.Object obj)
          Append an element to the end of the list.
 BiLink addAll(BiList list)
          Append all element in the list to the end.
 BiLink addAllFirst(BiList list)
          Add an element before first element of the list.
 BiLink addFirst(java.lang.Object obj)
          Add an element before first element of the list.
 BiList addNew(java.lang.Object obj)
          Add an object to the list only if not there.
 BiLink append(BiLink link)
          Append a link to the end of the list.
 boolean atEnd()
          Return true if this link is either end.
 void clear()
          Clear the list.
 java.lang.Object clone()
          Return copy of the list.
 BiList concatenate(BiList aList)
          Concatenate two lists.
 boolean contains(java.lang.Object obj)
          Test if the list contains an object obj.
 BiList copy()
          Make a copy of the list and return it.
 java.lang.Object elem()
          Return contents of this link.
 boolean equals(java.lang.Object x)
          Compare two lists
 BiLink first()
          Return first link.
 boolean isEmpty()
          Return true if this list is empty.
 java.util.Iterator iterator()
          Return iterator for the list.
 BiLink last()
          Return last link.
 int length()
          Return length of the list
 BiLink locate(java.lang.Object obj)
          Find a link which has an object obj.
 BiLink locateEqual(java.lang.Object obj)
          Find a link which has an object which equals to obj.
static void main(java.lang.String[] args)
           
 BiLink next()
          Return next link.
 BiLink prepend(BiLink link)
          Prepend a link before first element of the list.
 BiLink prev()
          Return previous link.
 BiLink remove(java.lang.Object obj)
          Remove an link which has an object obj.
 BiLink removeEqual(java.lang.Object obj)
          Remove an link which has an object which equals to obj.
 void sanityTest()
          Check list consistency.
 void sort()
          Sort list.
 void sort(java.util.Comparator cmp)
          Sort list according to Comparator.
 BiList split(BiLink middle)
          Split the list into two parts.
 java.lang.Object takeFirst()
          Return first element and remove it
 java.lang.Object takeLast()
          Return last element and remove it
 java.lang.Object[] toArray()
          Convert to array.
 java.lang.String toString()
          Visualize
 BiLink unlink()
          Remove this link from the list.
 int whereIs(java.lang.Object obj)
          Return the position of first occurence of an object obj.
 
クラス coins.backend.util.BiLink から継承したメソッド
addAfter, addAllAfter, addAllBefore, addBefore, insertAfter, insertAllAfter, insertAllBefore, insertBefore, setElem
 
クラス java.lang.Object から継承したメソッド
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

BiList

public BiList()
Create empty list.

メソッドの詳細

elem

public java.lang.Object elem()
クラス BiLink の記述:
Return contents of this link.

オーバーライド:
クラス BiLink 内の elem

unlink

public BiLink unlink()
クラス BiLink の記述:
Remove this link from the list.

オーバーライド:
クラス BiLink 内の unlink
戻り値:
the link just removed

next

public BiLink next()
クラス BiLink の記述:
Return next link.

オーバーライド:
クラス BiLink 内の next

prev

public BiLink prev()
クラス BiLink の記述:
Return previous link.

オーバーライド:
クラス BiLink 内の prev

first

public BiLink first()
Return first link.


last

public BiLink last()
Return last link.


atEnd

public boolean atEnd()
Return true if this link is either end.

オーバーライド:
クラス BiLink 内の atEnd

isEmpty

public boolean isEmpty()
Return true if this list is empty.


add

public BiLink add(java.lang.Object obj)
Append an element to the end of the list.


addAll

public BiLink addAll(BiList list)
Append all element in the list to the end.


append

public BiLink append(BiLink link)
Append a link to the end of the list.


addFirst

public BiLink addFirst(java.lang.Object obj)
Add an element before first element of the list.


addAllFirst

public BiLink addAllFirst(BiList list)
Add an element before first element of the list.


prepend

public BiLink prepend(BiLink link)
Prepend a link before first element of the list.


takeLast

public java.lang.Object takeLast()
Return last element and remove it


takeFirst

public java.lang.Object takeFirst()
Return first element and remove it


contains

public boolean contains(java.lang.Object obj)
Test if the list contains an object obj.


locate

public BiLink locate(java.lang.Object obj)
Find a link which has an object obj.


locateEqual

public BiLink locateEqual(java.lang.Object obj)
Find a link which has an object which equals to obj.


whereIs

public int whereIs(java.lang.Object obj)
Return the position of first occurence of an object obj.


remove

public BiLink remove(java.lang.Object obj)
Remove an link which has an object obj.


removeEqual

public BiLink removeEqual(java.lang.Object obj)
Remove an link which has an object which equals to obj.


addNew

public BiList addNew(java.lang.Object obj)
Add an object to the list only if not there.


clear

public void clear()
Clear the list. Make list empty.


concatenate

public BiList concatenate(BiList aList)
Concatenate two lists. Added list will be destroyed.

パラメータ:
aList - the list appended
戻り値:
this object itself

split

public BiList split(BiLink middle)
Split the list into two parts.

パラメータ:
middle - the first element of second half of the list
戻り値:
second half of the list (first half is this object)

copy

public BiList copy()
Make a copy of the list and return it. Do not copy the contents; they are shared.


length

public int length()
Return length of the list


sort

public void sort()
Sort list.


sort

public void sort(java.util.Comparator cmp)
Sort list according to Comparator.


equals

public boolean equals(java.lang.Object x)
Compare two lists

オーバーライド:
クラス java.lang.Object 内の equals

toArray

public java.lang.Object[] toArray()
Convert to array.


toString

public java.lang.String toString()
Visualize

オーバーライド:
クラス java.lang.Object 内の toString

clone

public java.lang.Object clone()
Return copy of the list.

オーバーライド:
クラス java.lang.Object 内の clone

iterator

public java.util.Iterator iterator()
Return iterator for the list.


sanityTest

public void sanityTest()
Check list consistency.


main

public static void main(java.lang.String[] args)