372件ヒット
[1-100件を表示]
(0.123秒)
ライブラリ
- ビルトイン (186)
- date (12)
- openssl (48)
- prime (48)
-
racc
/ parser (12) -
rexml
/ document (48) - socket (12)
- thwait (6)
クラス
- BasicSocket (12)
- Date (12)
-
Encoding
:: Converter (12) - Enumerator (48)
- Integer (12)
- LocalJumpError (12)
- Object (30)
-
OpenSSL
:: OCSP :: BasicResponse (24) -
OpenSSL
:: X509 :: CRL (24) -
Prime
:: EratosthenesGenerator (12) -
Prime
:: Generator23 (12) -
Prime
:: PseudoPrimeGenerator (12) -
Prime
:: TrialDivisionGenerator (12) -
REXML
:: Child (36) -
REXML
:: Element (12) -
Racc
:: Parser (12) -
RubyVM
:: InstructionSequence (12) - StopIteration (12)
- String (36)
- Symbol (12)
- ThreadsWait (6)
キーワード
-
add
_ status (12) - getpeereid (12)
-
next
_ element (12) -
next
_ sibling (12) -
next
_ sibling= (12) -
next
_ token (12) -
next
_ update (12) -
next
_ update= (12) -
next
_ values (12) -
next
_ wait (6) - peek (12)
-
peek
_ values (12) -
previous
_ sibling= (12) -
primitive
_ errinfo (12) - reason (12)
- result (12)
- status (12)
- succ (96)
- succ! (12)
- then (14)
-
to
_ a (12) -
yield
_ self (16)
検索結果
先頭5件
-
Enumerator
# next -> object (18244.0) -
「次」のオブジェクトを返します。
...変化しません。
つまりもう一度 next を呼ぶと再び例外が発生します。
next メソッドによる外部列挙の状態は他のイテレータメソッドによる
内部列挙には影響を与えません。
ただし、 IO#each_line のようにおおもとの列挙メカ......1][ruby]{
str = "xyz"
enum = str.each_byte
str.bytesize.times do
puts enum.next
end
# => 120
# 121
# 122
//}
//emlist[例2][ruby]{
str = "xyz"
enum = str.each_byte
begin
puts enum.next while true
rescue StopIteration
puts "iteration reached at end"
end
# => 120
#......121
# 122
# iteration reached at end
puts enum.next
#=> 再度 StopIteration 例外が発生
//}
//emlist[例3: Kernel.#loop は StopIteration を捕捉します。][ruby]{
str = "xyz"
enum = str.each_byte
loop do
puts enum.next
end
# => 120
# 121
# 122
//}... -
String
# next -> String (18108.0) -
self の「次の」文字列を返します。
...a".succ # => "ab"
p "88".succ.succ # => "90"
//}
"99" → "100", "AZZ" → "BAA" のような繰り上げも行われます。
このとき負符号などは考慮されません。
//emlist[][ruby]{
p "99".succ # => "100"
p "ZZ".succ # => "AAA"
p "a9".succ # => "b0"
p "-9".succ #......は保存されます。
//emlist[][ruby]{
p "1.9.9".succ # => # "2.0.0"
//}
逆に self がアルファベットや数字をまったく含まない場合は、
単純に文字コードを 1 増やします。
//emlist[][ruby]{
p ".".succ # => "/"
//}
さらに、self が空文字列の場......ucc と逆の動作をするメソッドはありません。
また、succ という名前の由来は successor です。
//emlist[例][ruby]{
p "aa".succ # => "ab"
# 繰り上がり
p "99".succ # => "100"
p "a9".succ # => "b0"
p "Az".succ # => "Ba"
p "zz".succ # => "aaa"
p "-9".succ... -
REXML
:: Child # next _ sibling=(other) (9132.0) -
other を self の次の隣接ノードとします。
...ther を挿入します。
@param other 挿入するノード
//emlist[][ruby]{
require 'rexml/document'
a = REXML::Element.new("a")
b = a.add_element("b")
c = REXML::Element.new("c")
b.next_sibling = c
d = REXML::Element.new("d")
b.previous_sibling = d
p a.to_s # => "<a><d/><b/><c/></a>"
//}... -
REXML
:: Child # next _ sibling -> REXML :: Node (9114.0) -
次の隣接ノードを返します。
...次の隣接ノードを返します。
REXML::Node#next_sibling_node の別名です。
@see REXML::Child#next_sibling=... -
OpenSSL
:: X509 :: CRL # next _ update=(time) (9108.0) -
CRL の次回更新日時を Time オブジェクトで設定します。
...CRL の次回更新日時を Time オブジェクトで設定します。
@param time 最終更新日時
@raise OpenSSL::X509::CRLError 設定に失敗した場合に発生します
@see OpenSSL::X509::CRL#next_update... -
OpenSSL
:: X509 :: CRL # next _ update -> Time (9102.0) -
CRL の次回更新日時を Time オブジェクトで返します。
...CRL の次回更新日時を Time オブジェクトで返します。... -
Racc
:: Parser # next _ token (9102.0) -
@todo
@todo -
ThreadsWait
# next _ wait(nonblock = nil) -> Thread (6214.0) -
指定したスレッドのどれかが終了するまで待ちます。
...ちます。
@param nonblock true を与えると、キューが空の時、例外 ThreadsWait::ErrNoFinishedThread が発生します。
@raise ErrNoWaitingThread 終了をまつスレッドが存在しない時、発生します。
@raise ErrNoFinishedThread nonblock がtrue でかつ、キュ......ーが空の時、発生します。
#使用例
require 'thwait'
threads = []
2.times {|i|
threads << Thread.new { sleep i }
}
thall = ThreadsWait.new
thall.join_nowait(*threads)
until thall.empty?
th = thall.next_wait
p th
end
@see Queue#pop... -
Enumerator
# next _ values -> Array (6210.0) -
「次」のオブジェクトを配列で返します。
...を配列で返します。
Enumerator#next とほぼ同様の挙動をします。終端まで到達した場合は
StopIteration 例外を発生させます。
このメソッドは、
yield
と
yield nil
を区別するために使えます。
next メソッドによる外部列挙の状......#each_line のようにおおもとの列挙メカニズムが副作用を
伴っている場合には影響があり得ます。
//emlist[例: next と next_values の違いを][ruby]{
o = Object.new
def o.each
yield
yield 1
yield 1, 2
yield nil
yield [1, 2]
end
e = o.to_enum
p e.next_va......lues
p e.next_values
p e.next_values
p e.next_values
p e.next_values
e = o.to_enum
p e.next
p e.next
p e.next
p e.next
p e.next
## yield args next_values next
# yield [] nil
# yield 1 [1] 1
# yield 1, 2 [1, 2] [1, 2]
# yi...