Using TaggedValue
Click an association element.
Select the TaggedValue tab.
Enter "collection_kind" in the Name and a collection type in the Value. The following collection types can be entered. If this TaggedValue is not set, it is the same as setting "List".
List
Set
Array
ArrayList
LinkedList
HashSet
LinkedHashSet
TreeSet
Stack
Select the Association End tab.
Enter “*” for the upper limit in the Multiplicity.
Java Example Code
// ˅
import java.util.*;
import java.text.*;
import Bar;
// ˄
public class Foo {
// ˅
// ˄
private Set<Bar> bars;
// ˅
// ˄
}
// ˅
// ˄
Using Stereotype
Click an association element.
Select the Stereotype tab.
Enter "collection_kind=(collection type)" in the Name. The following collection types can be entered. If this Stereotype is not set, it is the same as setting "List".
List
Set
Array
ArrayList
LinkedList
HashSet
LinkedHashSet
TreeSet
Stack
Select the Association End tab.
Enter “*” for the upper limit in the Multiplicity.
Java Example Code
// ˅
import java.util.*;
import java.text.*;
import Bar;
// ˄
public class Foo {
// ˅
// ˄
private Set<Bar> bars;
// ˅
// ˄
}
// ˅
// ˄
Using TaggedValue
Java Example Code
// ˅
import java.util.*;
import java.text.*;
import Bar;
// ˄
public class Foo {
// ˅
// ˄
private HashMap<int, Bar> bars;
// ˅
// ˄
}
// ˅
// ˄
Using Stereotype
Java Example Code
// ˅
import java.util.*;
import java.text.*;
import Bar;
// ˄
public class Foo {
// ˅
// ˄
private HashMap<int, Bar> bars;
// ˅
// ˄
}
// ˅
// ˄
Using TaggedValue
Java Example Code
// ˅
import java.util.*;
import java.text.*;
// ˄
public class Foo {
// ˅
// ˄
@Override
public void toString() {
// ˅
throw new UnsupportedOperationException("Not implemented.");
// ˄
}
// ˅
// ˄
}
// ˅
// ˄
Using Stereotype
Java Example Code
// ˅
import java.util.*;
import java.text.*;
// ˄
public class Foo {
// ˅
// ˄
@Override
public void toString() {
// ˅
throw new UnsupportedOperationException("Not implemented.");
// ˄
}
// ˅
// ˄
}
// ˅
// ˄
Java Example Code
// ˅
import java.util.*;
import java.text.*;
// ˄
public strictfp class Foo {
// ˅
// ˄
// ˅
// ˄
}
// ˅
// ˄
Using TaggedValue
Java Example Code
// ˅
import java.util.*;
import java.text.*;
// ˄
public class Foo {
// ˅
// ˄
public void calc() throws Exception {
// ˅
throw new UnsupportedOperationException("Not implemented.");
// ˄
}
// ˅
// ˄
}
// ˅
// ˄
Using Stereotype
Java Example Code
// ˅
import java.util.*;
import java.text.*;
// ˄
public class Foo {
// ˅
// ˄
public void calc() throws Exception {
// ˅
throw new UnsupportedOperationException("Not implemented.");
// ˄
}
// ˅
// ˄
}
// ˅
// ˄