Module: Muml_MultiplicityElement

Defined in:
lib/ontomde-uml2-java/collectionMapping.rb

Overview

Java collection mapping rules for UML property and UML parameter.

Instance Method Summary collapse

Instance Method Details

#java_getCollectionMappingObject

returns a Java_collectionMaping object containing mapping rules to java collection element (Array, List, Set, …)



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/ontomde-uml2-java/collectionMapping.rb', line 5

def java_getCollectionMapping
	if self.umlx_upperValueIsOne?
		return Java_collectionMapping_None.instance
	elsif java_use_Arrays?
		return Java_collectionMapping_Array.instance
	elsif uml_isOrdered?
		# this mapping is used wether or not isUnique
		return Java_collectionMapping_List_ArrayList.instance
	elsif uml_isUnique
		return Java_collectionMapping_Set_HashSet.instance
	else
		return Java_collectionMapping_Collection_ArrayList.instance
	end
end