IKVM11
11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
EnumerationWrapper.cs
Go to the documentation of this file.
1
using
System
;
2
using
System.Collections;
3
using
System.Collections.Generic;
4
5
namespace
java.util
6
{
7
8
class
EnumerationWrapper
<T> : IEnumerator<T>
9
{
10
11
readonly Enumeration _enumeration;
12
T? _current;
13
int
_position = -1;
14
20
public
EnumerationWrapper
(Enumeration enumeration)
21
{
22
_enumeration = enumeration ??
throw
new
ArgumentNullException(nameof(enumeration));
23
}
24
28
public
T
Current
=> _position > -1 ? _current! :
throw
new
InvalidOperationException();
29
33
object
? IEnumerator.Current => _current;
34
40
public
bool
MoveNext
()
41
{
42
if
(_enumeration.hasMoreElements())
43
{
44
_current = (T)_enumeration.nextElement();
45
_position++;
46
return
true
;
47
}
48
49
return
false
;
50
}
51
55
public
void
Dispose
()
56
{
57
58
}
59
64
public
void
Reset
()
65
{
66
throw
new
NotSupportedException();
67
}
68
69
}
70
71
}
java.util.EnumerationWrapper
Definition
EnumerationWrapper.cs:9
java.util.EnumerationWrapper.Dispose
void Dispose()
Disposes of the instance.
Definition
EnumerationWrapper.cs:55
java.util.EnumerationWrapper.MoveNext
bool MoveNext()
Moves to the next instance.
Definition
EnumerationWrapper.cs:40
java.util.EnumerationWrapper.Reset
void Reset()
Not supported.
Definition
EnumerationWrapper.cs:64
java.util.EnumerationWrapper.Current
T Current
Gets the current element.
Definition
EnumerationWrapper.cs:28
java.util.EnumerationWrapper.EnumerationWrapper
EnumerationWrapper(Enumeration enumeration)
Initializes a new instance.
Definition
EnumerationWrapper.cs:20
System
Definition
HexConverter.cs:9
java.util
Definition
CollectionExtensions.cs:4
src
IKVM.Java.Extensions
java
util
EnumerationWrapper.cs
Generated by
1.12.0