本文整理汇总了Python中java.util.Arrays.binarySearch方法的典型用法代码示例。如果您正苦于以下问题:Python Arrays.binarySearch方法的具体用法?Python Arrays.binarySearch怎么用?Python Arrays.binarySearch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.Arrays
的用法示例。
在下文中一共展示了Arrays.binarySearch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: while
# 需要导入模块: from java.util import Arrays [as 别名]
# 或者: from java.util.Arrays import binarySearch [as 别名]
ParserLoop:
while(true) {
char token:=0;
if(i>=len) {
state := ParseState.END;
}
else {
token := move.charAt(i);
}
if(checkMate && state!=ParseState.END) {
throw new ParseException("", 0);
}
switch (state) {
case FIGURE:
int result := Arrays.binarySearch(figures, token);
if(result>=0) {
switch (token) {
case 'B': figure := new Bishop(board, player, null); break;
case 'K': figure := new King(board, player, null); break;
case 'N': figure := new Knight(board, player, null); break;
case 'Q': figure := new Queen(board, player, null); break;
case 'P': figure := new Pawn(board, player, null); break;
case 'R': figure := new Rook(board, player, null); break;
}
i++;
}
else {
figure := new Pawn(board, player, null);
}
state := ParseState.SOURCE_TARGET;