def _getCleanDims(dims, dimsDefault=None): cleanDims = java.LinkedList() if dims is not None: for aDim in dims: cleanDims.add(aDim) elif dimsDefault is not None: for aDim in dimsDefault: cleanDims.add(aDim) return cleanDims
def to_jlist(pylist, idxName=None): if pylist is None: return None jList = java.LinkedList() if idxName is None: if type(pylist) is list: for key in pylist: jList.add(str(key)) elif type(pylist) is set: for key in list(pylist): jList.add(str(key)) else: jList.add(str(pylist)) else: for idx in idxName: jList.add(str(pylist[idx])) return jList
def to_jlist(pylist, idx_names=None): """Transforms a python list to a Java.LinkedList""" if pylist is None: return None jList = java.LinkedList() if idx_names is None: if type(pylist) is list: for key in pylist: jList.add(str(key)) elif type(pylist) is set: for key in list(pylist): jList.add(str(key)) else: jList.add(str(pylist)) else: for idx in idx_names: jList.add(str(pylist[idx])) return jList