558件ヒット
[1-100件を表示]
(0.064秒)
別のキーワード
ライブラリ
- ビルトイン (255)
- date (66)
- openssl (33)
- prime (99)
-
rexml
/ document (33) -
rexml
/ parsers / pullparser (22) - socket (11)
- thwait (6)
- zlib (33)
クラス
- BasicSocket (11)
- Date (66)
-
Encoding
:: Converter (11) - Enumerator (66)
- Float (20)
- Integer (33)
- LocalJumpError (11)
- Object (26)
-
OpenSSL
:: OCSP :: BasicResponse (22) -
OpenSSL
:: X509 :: CRL (11) -
Prime
:: EratosthenesGenerator (33) -
Prime
:: Generator23 (22) -
Prime
:: PseudoPrimeGenerator (22) -
Prime
:: TrialDivisionGenerator (22) -
REXML
:: Child (11) -
REXML
:: Element (11) -
REXML
:: Parsers :: PullParser (22) -
RubyVM
:: InstructionSequence (11) - StopIteration (11)
- String (44)
- Symbol (22)
- ThreadsWait (6)
-
Zlib
:: Inflate (11) -
Zlib
:: ZStream (22)
モジュール
-
REXML
:: Node (11)
キーワード
- << (11)
- >> (11)
-
add
_ status (11) - empty? (11)
- feed (11)
-
flush
_ next _ in (11) -
flush
_ next _ out (11) - getpeereid (11)
-
has
_ next? (11) - next! (11)
-
next
_ day (11) -
next
_ element (11) -
next
_ float (10) -
next
_ month (11) -
next
_ sibling (11) -
next
_ sibling _ node (11) -
next
_ update (11) -
next
_ values (11) -
next
_ wait (6) -
next
_ year (11) - peek (11)
-
peek
_ values (11) - pred (11)
-
prev
_ float (10) -
primitive
_ errinfo (11) - reason (11)
- result (11)
- rewind (22)
- status (11)
- succ (88)
- succ! (11)
- then (12)
-
to
_ a (11) -
yield
_ self (14)
検索結果
先頭5件
-
Enumerator
# next -> object (18238.0) -
「次」のオブジェクトを返します。
...合は、
StopIteration 例外を発生します。このとき列挙状態は変化しません。
つまりもう一度 next を呼ぶと再び例外が発生します。
next メソッドによる外部列挙の状態は他のイテレータメソッドによる
内部列挙には影響を与え......m.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
//}... -
Prime
:: EratosthenesGenerator # next -> Integer (18220.0) -
次の(擬似)素数を返します。なお、この実装においては擬似素数は真に素数です。
...いては擬似素数は真に素数です。
また内部的な列挙位置を進めます。
//emlist[例][ruby]{
require 'prime'
generator = Prime::EratosthenesGenerator.new
p generator.next #=> 2
p generator.next #=> 3
p generator.succ #=> 5
p generator.succ #=> 7
p generator.next #=> 11
//}... -
Symbol
# next -> Symbol (18220.0) -
シンボルに対応する文字列の「次の」文字列に対応するシンボルを返します。
...シンボルに対応する文字列の「次の」文字列に対応するシンボルを返します。
(self.to_s.next.intern と同じです。)
:a.next # => :b
:foo.next # => :fop
@see String#succ... -
Integer
# next -> Integer (18214.0) -
self の次の整数を返します。
...self の次の整数を返します。
//emlist[][ruby]{
1.next #=> 2
(-1).next #=> 0
1.succ #=> 2
(-1).succ #=> 0
//}
@see Integer#pred... -
Date
# next -> Date (18202.0) -
翌日の日付オブジェクトを返します。
翌日の日付オブジェクトを返します。 -
Prime
:: Generator23 # next -> Integer (18202.0) -
次の擬似素数を返します。
次の擬似素数を返します。
また内部的な列挙位置を進めます。 -
Prime
:: PseudoPrimeGenerator # next -> () (18202.0) -
次の擬似素数を返します。 また内部的な位置を進めます。
次の擬似素数を返します。
また内部的な位置を進めます。
サブクラスで実装してください。
@raise NotImplementedError 必ず発生します。 -
Prime
:: TrialDivisionGenerator # next -> Integer (18202.0) -
次の(擬似)素数を返します。なお、この実装においては擬似素数は真に素数です。
次の(擬似)素数を返します。なお、この実装においては擬似素数は真に素数です。
また内部的な列挙位置を進めます。 -
String
# next -> String (18202.0) -
self の「次の」文字列を返します。
...# => "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 # => "-10"......存されます。
//emlist[][ruby]{
p "1.9.9".succ # => # "2.0.0"
//}
逆に self がアルファベットや数字をまったく含まない場合は、
単純に文字コードを 1 増やします。
//emlist[][ruby]{
p ".".succ # => "/"
//}
さらに、self が空文字列の場合は......a".succ # => "ab"
# 繰り上がり
p "99".succ # => "100"
p "a9".succ # => "b0"
p "Az".succ # => "Ba"
p "zz".succ # => "aaa"
p "-9".succ # => "-10"
p "9".succ # => "10"
p "09".succ # => "10"
# アルファベット・数字とそれ以外の混在
p "1.9.9".succ # => # "2.0.0"
#... -
Enumerator
# next _ values -> Array (6304.0) -
「次」のオブジェクトを配列で返します。
...を配列で返します。
Enumerator#next とほぼ同様の挙動をします。終端まで到達した場合は
StopIteration 例外を発生させます。
このメソッドは、
yield
と
yield nil
を区別するために使えます。
next メソッドによる外部列挙の状......list[例: 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_values
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
## yie......ld args next_values next
# yield [] nil
# yield 1 [1] 1
# yield 1, 2 [1, 2] [1, 2]
# yield nil [nil] nil
# yield [1, 2] [[1, 2]] [1, 2]
//}
@raise StopIteration 列挙状態が既に最後...