Permalink
Browse files

prototype get_allows_children method

  • Loading branch information...
hovo1990 committed Jul 23, 2016
1 parent 938fadd commit f161d44413a780920727d734b5d974f618240a6c
@@ -406,11 +406,14 @@ def write_general_functions(self):
self.prime_numbers)
self.line_length = 150
self.line_length = 79
code = gen_functions.write_get_child_at()
self.write_function_implementation(code)
self.line_length = 79
code = gen_functions.write_get_allows_children()
self.write_function_implementation(code)
code = gen_functions.write_hashcode()
self.write_function_implementation(code)
@@ -313,6 +313,57 @@ def write_get_child_at(self):
'implementation': code,
'constructor_args': constructor_args})
########################################################################
def write_get_allows_children(self):
if len(self.child_lo_elements) == 0:
return
# do not write for C API
if self.is_java_api is False:
return
# create doc string header
function = 'getAllowsChildren'
title_line = '(non-Javadoc)--@see org.sbml.jsbml#getAllowsChildren()'
params = []
return_lines = []
additional = []
additional.append('Override')
# create function decl
return_type = 'boolean'
arguments = []
# create the function implementation
constructor_args = [] # arguments #self.write_copy_constructor_args(self)
code = []
clone = 'clone'
if self.has_children == True:
code_to_add = 'true'
else:
code_to_add = 'false'
implementation = []
implementation.append('return {0}'.format(code_to_add))
code.append(self.create_code_block('line', implementation))
return dict({'title_line': title_line,
'params': params,
'return_lines': return_lines,
'additional': additional,
'function': function,
'return_type': return_type,
'arguments': arguments,
'constant': False,
'virtual': False,
'object_name': self.object_name,
'implementation': code,
'constructor_args': constructor_args})
########################################################################

0 comments on commit f161d44

Please sign in to comment.