def _jarrayInit(self, *args) :
	if len(args) == 2 and args[0] == _jclass._SPECIAL_CONSTRUCTOR_KEY :
		_JavaArrayClass.__init__(self, args[1])
	elif len(args) != 1 :
		raise ParameterException, "Array classes only take 2 parameters, %s given" % (len(args)+1,)
	else:
		values = None
		if operator.isSequenceType(args[0]) :
			sz = len(args[0])
			values = args[0]
		else :
			sz = args[0]
			
		_JavaArrayClass.__init__(self, _jpype.newArray(self.__class__.__javaclass__, sz))
		
		if values is not None :
			_jpype.setArrayValues(self.__javaobject__, values)
Exemplo n.º 2
0
def _jarrayInit(self, *args) :
    if len(args) == 2 and args[0] == _jclass._SPECIAL_CONSTRUCTOR_KEY :
        _JavaArrayClass.__init__(self, args[1])
    elif len(args) != 1 :
        raise TypeError("Array classes only take 2 parameters, {0} given".format(len(args) + 1))
    else:
        values = None
        if isinstance(args[0], collections.Sequence):
            sz = len(args[0])
            values = args[0]
        else :
            sz = args[0]

        _JavaArrayClass.__init__(self, _jpype.newArray(self.__class__.__javaclass__, sz))

        if values is not None :
            _jpype.setArrayValues(self.__javaobject__, values)
Exemplo n.º 3
0
def _jarrayInit(self, *args) :
	if len(args) == 2 and args[0] == _jclass._SPECIAL_CONSTRUCTOR_KEY :
		_JavaArrayClass.__init__(self, args[1])
	elif len(args) != 1 :
		raise ParameterException, "Array classes only take 2 parameters, %s given" % (len(args)+1,)
	else:
		values = None
		if operator.isSequenceType(args[0]) :
			sz = len(args[0])
			values = args[0]
		else :
			sz = args[0]
			
		_JavaArrayClass.__init__(self, _jpype.newArray(self.__class__.__javaclass__, sz))
		
		if values is not None :
			_jpype.setArrayValues(self.__javaobject__, values)
Exemplo n.º 4
0
def _jarrayInit(self, *args):
    if len(args) == 2 and args[0] == _jclass._SPECIAL_CONSTRUCTOR_KEY:
        _JavaArrayClass.__init__(self, args[1])
    elif len(args) != 1:
        raise TypeError(
            "Array classes only take 2 parameters, {0} given".format(
                len(args) + 1))
    else:
        values = None
        if isinstance(args[0], collections.Sequence):
            sz = len(args[0])
            values = args[0]
        else:
            sz = args[0]

        _JavaArrayClass.__init__(
            self, _jpype.newArray(self.__class__.__javaclass__, sz))

        if values is not None:
            _jpype.setArrayValues(self.__javaobject__, values)