Package net.ontopia.topicmaps.utils
Class AssociationBuilder
java.lang.Object
net.ontopia.topicmaps.utils.AssociationBuilder
PUBLIC: A helper class that makes it easier to build associations.
- Since:
- 1.2
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAssociationBuilder(TopicIF assoctype, TopicIF roletype) PUBLIC: Creates a new AssociationBuilder for unary associations.AssociationBuilder(TopicIF assoctype, TopicIF role1type, TopicIF role2type) PUBLIC: Creates a new AssociationBuilder for binary associations.AssociationBuilder(TopicIF assoctype, TopicIF role1type, TopicIF role2type, TopicIF role3type) PUBLIC: Creates a new AssociationBuilder for ternary associations.AssociationBuilder(TopicIF assoctype, TopicIF role1type, TopicIF role2type, TopicIF role3type, TopicIF role4type) PUBLIC: Creates a new AssociationBuilder for quad associations. -
Method Summary
Modifier and TypeMethodDescriptionPUBLIC: Returns the type of associations the builder creates.getScope()PUBLIC: Returns the scope added to all associations created by this builder.makeAssociation(TopicIF player) PUBLIC: Create a unary association of the configured type, where player is the role player.makeAssociation(TopicIF player1, TopicIF player2) PUBLIC: Create a binary association of the configured type, where player1 plays the first role and player2 the second.makeAssociation(TopicIF player1, TopicIF player2, TopicIF player3) PUBLIC: Create a ternary association of the configured type, where player1 plays the first role, player2 the second, and player3 the third.makeAssociation(TopicIF player1, TopicIF player2, TopicIF player3, TopicIF player4) PUBLIC: Create a quad association of the configured type, where player1 plays the first role, and player2 the second, and player3 the third, and player4 the fourth.voidsetScope(Collection<TopicIF> scope) PUBLIC: Sets the scope added to all associations created by this builder.
-
Field Details
-
topicmap
-
builder
-
assoctype
-
role1type
-
role2type
-
role3type
-
role4type
-
scope
-
-
Constructor Details
-
AssociationBuilder
PUBLIC: Creates a new AssociationBuilder for unary associations.- Parameters:
assoctype- The type of the created associationsroletype- The role type.- Since:
- 4.0
-
AssociationBuilder
PUBLIC: Creates a new AssociationBuilder for binary associations.- Parameters:
assoctype- The type of the created associationsrole1type- The first role type.role2type- The second role type.
-
AssociationBuilder
public AssociationBuilder(TopicIF assoctype, TopicIF role1type, TopicIF role2type, TopicIF role3type) PUBLIC: Creates a new AssociationBuilder for ternary associations.- Parameters:
assoctype- The type of the created associationsrole1type- The first role type.role2type- The second role type.role3type- The third role type.- Since:
- 1.3
-
AssociationBuilder
public AssociationBuilder(TopicIF assoctype, TopicIF role1type, TopicIF role2type, TopicIF role3type, TopicIF role4type) PUBLIC: Creates a new AssociationBuilder for quad associations.- Parameters:
assoctype- The type of the created associationsrole1type- The first role type.role2type- The second role type.role3type- The third role type.role4type- The fourth role type.- Since:
- 1.3
-
-
Method Details
-
getScope
PUBLIC: Returns the scope added to all associations created by this builder. -
setScope
PUBLIC: Sets the scope added to all associations created by this builder. -
makeAssociation
PUBLIC: Create a unary association of the configured type, where player is the role player.- Since:
- 4.0
-
makeAssociation
PUBLIC: Create a binary association of the configured type, where player1 plays the first role and player2 the second. -
makeAssociation
PUBLIC: Create a ternary association of the configured type, where player1 plays the first role, player2 the second, and player3 the third.- Throws:
IllegalArgumentException- if the builder is only configured for binary associations.- Since:
- 1.3
-
makeAssociation
public AssociationIF makeAssociation(TopicIF player1, TopicIF player2, TopicIF player3, TopicIF player4) PUBLIC: Create a quad association of the configured type, where player1 plays the first role, and player2 the second, and player3 the third, and player4 the fourth.- Throws:
IllegalArgumentException- if the builder is only configured for binary or ternary associations.- Since:
- 4.0
-
getAssociationType
PUBLIC: Returns the type of associations the builder creates.- Since:
- 2.0
-