示例#1
0
    def __getitem__(self, ndx):
        if type(ndx) is not slice:
            # Simple index
            return _jpype.getArrayItem(self.__javaobject__, ndx)

        # Slice
        start = ndx.start if ndx.start is not None else 0
        stop = ndx.stop if ndx.stop is not None else 0

        if stop >= start and ndx.step in (None, 1):
            # Normal slice
            return _jpype.getArraySlice(self.__javaobject__, start, stop)
        else:
            # Complex slice
            start, stop, step = ndx.indices(self.__len__())
            return [_jpype.getArrayItem(self.__javaobject__, index)
                    for index in range(start, stop, step)]
示例#2
0
文件: _jarray.py 项目: 736907871/zyl
    def __getitem__(self, ndx):
        if type(ndx) is not slice:
            # Simple index
            return _jpype.getArrayItem(self.__javaobject__, ndx)

        # Slice
        start = ndx.start if ndx.start is not None else 0
        stop = ndx.stop if ndx.stop is not None else 0

        if stop >= start and ndx.step in (None, 1):
            # Normal slice
            return _jpype.getArraySlice(self.__javaobject__, start, stop)
        else:
            # Complex slice
            start, stop, step = ndx.indices(self.__len__())
            return [
                _jpype.getArrayItem(self.__javaobject__, index)
                for index in range(start, stop, step)
            ]
	def __getslice__(self, i, j) : 
		return _jpype.getArraySlice(self.__javaobject__, i, j)
示例#4
0
文件: _jarray.py 项目: Sunyifan/jpype
 def __getslice__(self, i, j):
     if j == sys.maxsize:
         j = _jpype.getArrayLength(self.__javaobject__)
     return _jpype.getArraySlice(self.__javaobject__, i, j)
示例#5
0
 def __getslice__(self, i, j):
     if j == sys.maxsize:
         j = _jpype.getArrayLength(self.__javaobject__)
     return _jpype.getArraySlice(self.__javaobject__, i, j)
示例#6
0
 def __getslice__(self, i, j):
     return _jpype.getArraySlice(self.__javaobject__, i, j)