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 __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)
def __getslice__(self, i, j): if j == sys.maxsize: j = _jpype.getArrayLength(self.__javaobject__) return _jpype.getArraySlice(self.__javaobject__, i, j)
def __getslice__(self, i, j): return _jpype.getArraySlice(self.__javaobject__, i, j)