org.aminds.util
クラス CharQueue

java.lang.Object
  上位を拡張 java.util.AbstractCollection<E>
      上位を拡張 java.util.AbstractQueue<Character>
          上位を拡張 org.aminds.util.CharQueue
すべての実装されたインタフェース:
Appendable, CharSequence, Iterable<Character>, Readable, Collection<Character>, Queue<Character>

public class CharQueue
extends AbstractQueue<Character>
implements CharSequence, Appendable, Readable

作成者:
Masashi Nakanishi

フィールドの概要
protected  char[] buffer
           
protected  int count
           
protected  int pos
           
 
コンストラクタの概要
CharQueue()
           
CharQueue(char[] cbuf, int off, int len)
           
CharQueue(int initCapacity)
           
 
メソッドの概要
 Appendable append(char c)
           
 Appendable append(CharSequence csq)
           
 Appendable append(CharSequence csq, int start, int end)
           
 int capacity()
           
 char charAt(int index)
           
 void clear()
           
 int copyTo(char[] cbuf, int off, int len)
           
 int copyTo(int start, char[] cbuf, int off, int len)
           
 Character element()
           
 char elementc()
          Retrieves, but does not remove, the head of this queue.
 void ensureCapacity(int minCapacity)
           
 boolean isEmpty()
           
 Iterator<Character> iterator()
           
 int length()
           
 boolean offer(char[] cbuf)
           
 boolean offer(char[] cbuf, int off, int len)
           
 boolean offer(Character o)
           
 boolean offer(CharSequence s)
           
 boolean offer(String str)
           
 boolean offer(StringBuffer sb)
           
 boolean offer(StringBuilder sb)
           
 boolean offerc(char c)
          Inserts the specified element into this queue, if possible.
 Character peek()
           
 Character poll()
           
 int read(CharBuffer cb)
           
 Character remove()
           
 void remove(int n)
           
 char removec()
          Retrieves and removes the head of this queue.
 int size()
           
 char[] subArray(int start, int end)
           
 CharSequence subSequence(int start, int end)
           
 char[] toArray(char[] a)
           
 boolean trimTo(int size)
           
 void trimToSize()
           
 
クラス java.util.AbstractQueue から継承されたメソッド
add, addAll
 
クラス java.util.AbstractCollection から継承されたメソッド
contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toString
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
インタフェース java.lang.CharSequence から継承されたメソッド
toString
 
インタフェース java.util.Collection から継承されたメソッド
contains, containsAll, equals, hashCode, remove, removeAll, retainAll, toArray, toArray
 

フィールドの詳細

buffer

protected char[] buffer

pos

protected int pos

count

protected int count
コンストラクタの詳細

CharQueue

public CharQueue()

CharQueue

public CharQueue(int initCapacity)
          throws IllegalArgumentException
例外:
IllegalArgumentException

CharQueue

public CharQueue(char[] cbuf,
                 int off,
                 int len)
          throws NullPointerException,
                 IndexOutOfBoundsException
例外:
NullPointerException
IndexOutOfBoundsException
メソッドの詳細

offerc

public boolean offerc(char c)
Inserts the specified element into this queue, if possible. When using queues that may impose insertion restrictions (for example capacity bounds), method offer is generally preferable to method Collection.add(E), which can fail to insert an element only by throwing an exception.

パラメータ:
c - the element to insert.
戻り値:
true if it was possible to add the element to this queue, else false

offer

public boolean offer(char[] cbuf,
                     int off,
                     int len)
              throws NullPointerException,
                     IndexOutOfBoundsException
例外:
NullPointerException
IndexOutOfBoundsException

offer

public boolean offer(char[] cbuf)
              throws NullPointerException
例外:
NullPointerException

offer

public boolean offer(CharSequence s)
              throws NullPointerException
例外:
NullPointerException

offer

public boolean offer(String str)
              throws NullPointerException
例外:
NullPointerException

offer

public boolean offer(StringBuilder sb)
              throws NullPointerException
例外:
NullPointerException

offer

public boolean offer(StringBuffer sb)
              throws NullPointerException
例外:
NullPointerException

offer

public boolean offer(Character o)
定義:
インタフェース Queue<Character> 内の offer

elementc

public char elementc()
              throws NoSuchElementException
Retrieves, but does not remove, the head of this queue. This method differs from the peek method only in that it throws an exception if this queue is empty.

戻り値:
the head of this queue.
例外:
NoSuchElementException - if this queue is empty.

element

public Character element()
                  throws NoSuchElementException
定義:
インタフェース Queue<Character> 内の element
オーバーライド:
クラス AbstractQueue<Character> 内の element
例外:
NoSuchElementException

peek

public Character peek()
定義:
インタフェース Queue<Character> 内の peek

removec

public char removec()
             throws NoSuchElementException
Retrieves and removes the head of this queue. This method differs from the poll method in that it throws an exception if this queue is empty.

戻り値:
the head of this queue.
例外:
NoSuchElementException - if this queue is empty.

remove

public void remove(int n)
            throws IllegalArgumentException,
                   NoSuchElementException
例外:
IllegalArgumentException
NoSuchElementException

remove

public Character remove()
                 throws NoSuchElementException
定義:
インタフェース Queue<Character> 内の remove
オーバーライド:
クラス AbstractQueue<Character> 内の remove
例外:
NoSuchElementException

poll

public Character poll()
定義:
インタフェース Queue<Character> 内の poll

clear

public void clear()
定義:
インタフェース Collection<Character> 内の clear
オーバーライド:
クラス AbstractQueue<Character> 内の clear

isEmpty

public boolean isEmpty()
定義:
インタフェース Collection<Character> 内の isEmpty
オーバーライド:
クラス AbstractCollection<Character> 内の isEmpty

size

public int size()
定義:
インタフェース Collection<Character> 内の size
定義:
クラス AbstractCollection<Character> 内の size

toArray

public char[] toArray(char[] a)

charAt

public char charAt(int index)
            throws IndexOutOfBoundsException
定義:
インタフェース CharSequence 内の charAt
例外:
IndexOutOfBoundsException

length

public int length()
定義:
インタフェース CharSequence 内の length

subSequence

public CharSequence subSequence(int start,
                                int end)
                         throws IndexOutOfBoundsException
定義:
インタフェース CharSequence 内の subSequence
例外:
IndexOutOfBoundsException

copyTo

public int copyTo(char[] cbuf,
                  int off,
                  int len)
           throws NullPointerException,
                  IndexOutOfBoundsException
例外:
NullPointerException
IndexOutOfBoundsException

copyTo

public int copyTo(int start,
                  char[] cbuf,
                  int off,
                  int len)
           throws NullPointerException,
                  IndexOutOfBoundsException
例外:
NullPointerException
IndexOutOfBoundsException

subArray

public char[] subArray(int start,
                       int end)
                throws IndexOutOfBoundsException
例外:
IndexOutOfBoundsException

trimToSize

public void trimToSize()

trimTo

public boolean trimTo(int size)

ensureCapacity

public void ensureCapacity(int minCapacity)

capacity

public int capacity()

iterator

public Iterator<Character> iterator()
定義:
インタフェース Iterable<Character> 内の iterator
定義:
インタフェース Collection<Character> 内の iterator
定義:
クラス AbstractCollection<Character> 内の iterator

append

public Appendable append(CharSequence csq)
                  throws IOException
定義:
インタフェース Appendable 内の append
例外:
IOException

append

public Appendable append(char c)
                  throws IOException
定義:
インタフェース Appendable 内の append
例外:
IOException

append

public Appendable append(CharSequence csq,
                         int start,
                         int end)
                  throws IOException,
                         IndexOutOfBoundsException
定義:
インタフェース Appendable 内の append
例外:
IOException
IndexOutOfBoundsException

read

public int read(CharBuffer cb)
         throws IOException,
                NullPointerException,
                ReadOnlyBufferException
定義:
インタフェース Readable 内の read
例外:
IOException
NullPointerException
ReadOnlyBufferException


Copyright (c) 2008-2011 Masashi Nakanishi.