Exemplo n.º 1
0
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
Exemplo n.º 2
0
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
Exemplo n.º 3
0
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