Beispiel #1
0
 def __add__(self, other):
     command = proto.LIST_COMMAND_NAME +\
         proto.LIST_CONCAT_SUBCOMMAND_NAME +\
         self._get_object_id() + "\n" + other._get_object_id() +\
         "\n" + proto.END_COMMAND_PART
     answer = self._gateway_client.send_command(command)
     return get_return_value(answer, self._gateway_client)
Beispiel #2
0
 def count(self, value):
     command = proto.LIST_COMMAND_NAME +\
         proto.LIST_COUNT_SUBCOMMAND_NAME +\
         self._get_object_id() + "\n" + get_command_part(value) +\
         proto.END_COMMAND_PART
     answer = self._gateway_client.send_command(command)
     return get_return_value(answer, self._gateway_client)
Beispiel #3
0
 def count(self, value):
     command = proto.LIST_COMMAND_NAME +\
         proto.LIST_COUNT_SUBCOMMAND_NAME +\
         self._get_object_id() + "\n" + get_command_part(value) +\
         proto.END_COMMAND_PART
     answer = self._gateway_client.send_command(command)
     return get_return_value(answer, self._gateway_client)
Beispiel #4
0
 def __len__(self):
     command = proto.ARRAY_COMMAND_NAME +\
         proto.ARRAY_LEN_SUB_COMMAND_NAME +\
         self._get_object_id() + "\n"
     command += proto.END_COMMAND_PART
     answer = self._gateway_client.send_command(command)
     return get_return_value(answer, self._gateway_client)
Beispiel #5
0
 def __add__(self, other):
     command = proto.LIST_COMMAND_NAME +\
         proto.LIST_CONCAT_SUBCOMMAND_NAME +\
         self._get_object_id() + "\n" + other._get_object_id() +\
         "\n" + proto.END_COMMAND_PART
     answer = self._gateway_client.send_command(command)
     return get_return_value(answer, self._gateway_client)
Beispiel #6
0
 def __len__(self):
     command = proto.ARRAY_COMMAND_NAME +\
         proto.ARRAY_LEN_SUB_COMMAND_NAME +\
         self._get_object_id() + "\n"
     command += proto.END_COMMAND_PART
     answer = self._gateway_client.send_command(command)
     return get_return_value(answer, self._gateway_client)
Beispiel #7
0
 def _get_params(self, input):
     params = []
     temp = smart_decode(input.readline())[:-1]
     while temp != proto.END:
         param = get_return_value("y" + temp, self.java_client)
         params.append(param)
         temp = smart_decode(input.readline())[:-1]
     return params
Beispiel #8
0
 def __get_slice(self, indices):
     command = proto.LIST_COMMAND_NAME + proto.LIST_SLICE_SUBCOMMAND_NAME + \
         self._get_object_id() + "\n"
     for index in indices:
         command += get_command_part(index)
     command += proto.END_COMMAND_PART
     answer = self._gateway_client.send_command(command)
     return get_return_value(answer, self._gateway_client)
Beispiel #9
0
 def __compute_item(self, key):
     new_key = self.__compute_index(key)
     command = proto.ARRAY_COMMAND_NAME + proto.ARRAY_GET_SUB_COMMAND_NAME + \
         self._get_object_id() + "\n"
     command += get_command_part(new_key)
     command += proto.END_COMMAND_PART
     answer = self._gateway_client.send_command(command)
     return get_return_value(answer, self._gateway_client)
Beispiel #10
0
 def _get_params(self, input):
     params = []
     temp = smart_decode(input.readline())[:-1]
     while temp != proto.END:
         param = get_return_value("y" + temp, self.java_client)
         params.append(param)
         temp = smart_decode(input.readline())[:-1]
     return params
Beispiel #11
0
 def __get_slice(self, indices):
     command = proto.LIST_COMMAND_NAME +\
         proto.LIST_SLICE_SUBCOMMAND_NAME +\
         self._get_object_id() + "\n"
     for index in indices:
         command += get_command_part(index)
     command += proto.END_COMMAND_PART
     answer = self._gateway_client.send_command(command)
     return get_return_value(answer, self._gateway_client)
Beispiel #12
0
 def __compute_item(self, key):
     new_key = self.__compute_index(key)
     command = proto.ARRAY_COMMAND_NAME +\
         proto.ARRAY_GET_SUB_COMMAND_NAME +\
         self._get_object_id() + "\n"
     command += get_command_part(new_key)
     command += proto.END_COMMAND_PART
     answer = self._gateway_client.send_command(command)
     return get_return_value(answer, self._gateway_client)
Beispiel #13
0
 def __mul__(self, other):
     command = proto.LIST_COMMAND_NAME + proto.LIST_MULT_SUBCOMMAND_NAME + \
         self._get_object_id() + "\n" + get_command_part(other) + \
         proto.END_COMMAND_PART
     answer = self._gateway_client.send_command(command)
     return get_return_value(answer, self._gateway_client)
Beispiel #14
0
 def __mul__(self, other):
     command = proto.LIST_COMMAND_NAME + proto.LIST_MULT_SUBCOMMAND_NAME +\
         self._get_object_id() + "\n" + get_command_part(other) +\
         proto.END_COMMAND_PART
     answer = self._gateway_client.send_command(command)
     return get_return_value(answer, self._gateway_client)