FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
zstack/utils/src/main/java/org/zstack/utils/Bucket.java at master · zstackio/zstack · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
zstackio
/
zstack
Public
Notifications
You must be signed in to change notification settings
Fork
399
Star
1.4k
Code
Issues
163
Pull requests
13
Actions
Projects
Wiki
Security and quality
4
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
zstack
/
utils
/
src
/
main
/
java
/
org
/
zstack
/
utils
/
Bucket.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
31 lines (24 loc) · 673 Bytes
Breadcrumbs
zstack
/
utils
/
src
/
main
/
java
/
org
/
zstack
/
utils
/
Bucket.java
Copy path
File metadata and controls
executable file
·
31 lines (24 loc) · 673 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package
org
.
zstack
.
utils
;
/**
*/
public
class
Bucket
{
private
Object
[]
objects
;
public
Bucket
(
Object
...
objs
) {
objects
=
objs
;
}
public
static
Bucket
newBucket
(
Object
...
objs
) {
return
new
Bucket
(
objs
);
}
public
<
T
>
T
get
(
int
index
) {
if
(
index
<
0
||
index
>=
objects
.
length
) {
throw
new
IllegalArgumentException
(
String
.
format
(
"illegal index[%s], bucket size is :%s"
,
index
,
objects
.
length
));
}
return
(
T
)
objects
[
index
];
}
public
<
T
>
T
safeGet
(
int
index
) {
if
(
index
<
0
||
index
>=
objects
.
length
) {
return
null
;
}
return
get
(
index
);
}
}
Back
|
FazBrowse Home
|
New Git URL