Using Class element
Scala Example Code
// ˅
import java.util.*
import java.text.*
import scala.collection.mutable.*
// ˄
trait Foo {
// ˅
// ˄
// ˅
// ˄
}
// ˅
// ˄
Using Interface element
Scala Example Code
// ˅
import java.util.*
import java.text.*
import scala.collection.mutable.*
// ˄
trait Foo {
// ˅
// ˄
// ˅
// ˄
}
// ˅
// ˄
Scala Example Code
// ˅
import java.util.*
import java.text.*
import scala.collection.mutable.*
// ˄
enum Foo {
case Red
case Green
case Blue
// ˅
// ˄
}
// ˅
// ˄
Scala Example Code
// ˅
import java.util.*
import java.text.*
import scala.collection.mutable.*
// ˄
object Foo {
// ˅
// ˄
// ˅
// ˄
}
// ˅
// ˄
Scala Example Code
// ˅
import java.util.*
import java.text.*
import scala.collection.mutable.*
// ˄
case class Foo {
// ˅
// ˄
// ˅
// ˄
}
// ˅
// ˄
Scala Example Code
// ˅
import java.util.*
import java.text.*
import scala.collection.mutable.*
// ˄
class Foo(name: String) {
// ˅
// ˄
// ˅
// ˄
}
// ˅
// ˄
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 "Seq".
Seq
Set
Array
ArrayList
List
LinkedList
HashSet
LinkedHashSet
TreeSet
Stack
Select the Association End tab.
Enter “*” for the upper limit in the Multiplicity.
Scala Example Code
// ˅
import java.util.*
import java.text.*
import scala.collection.mutable.*
// ˄
class Foo {
// ˅
// ˄
private var cntBar: Set[Bar]
// ˅
// ˄
}
// ˅
// ˄
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 "Seq".
Seq
Set
Array
ArrayList
List
LinkedList
HashSet
LinkedHashSet
TreeSet
Stack
Select the Association End tab.
Enter “*” for the upper limit in the Multiplicity.
Scala Example Code
// ˅
import java.util.*
import java.text.*
import scala.collection.mutable.*
// ˄
class Foo {
// ˅
// ˄
private var cntBar: Set[Bar]
// ˅
// ˄
}
// ˅
// ˄
Using TaggedValue
Scala Example Code
// ˅
import java.util.*
import java.text.*
import scala.collection.mutable.*
import Bar
// ˄
class Foo {
// ˅
// ˄
private var cntBar: Map[Int, Bar]
// ˅
// ˄
}
// ˅
// ˄
Using Stereotype
Scala Example Code
// ˅
import java.util.*
import java.text.*
import scala.collection.mutable.*
import Bar
// ˄
class Foo {
// ˅
// ˄
private var cntBar: Map[Int, Bar]
// ˅
// ˄
}
// ˅
// ˄
Scala Example Code
// ˅
import java.util.*
import java.text.*
import scala.collection.mutable.*
// ˄
sealed class Foo {
// ˅
// ˄
// ˅
// ˄
}
// ˅
// ˄
Using TaggedValue
Scala Example Code
// ˅
import java.util.*
import java.text.*
import scala.collection.mutable.*
// ˄
class Foo {
// ˅
// ˄
@transient
@volatile
private var sum: Int
// ˅
// ˄
}
// ˅
// ˄
Using Stereotype
Scala Example Code
// ˅
import java.util.*
import java.text.*
import scala.collection.mutable.*
// ˄
class Foo {
// ˅
// ˄
@transient
@volatile
private var sum: Int
// ˅
// ˄
}
// ˅
// ˄
Using TaggedValue
Scala Example Code
// ˅
import java.util.*
import java.text.*
import scala.collection.mutable.*
import Base
// ˄
class Derived(p: Int) extends Base(p) {
// ˅
// ˄
// ˅
// ˄
}
// ˅
// ˄
Using Stereotype
Scala Example Code
// ˅
import java.util.*
import java.text.*
import scala.collection.mutable.*
import Base
// ˄
class Derived(p: Int) extends Base(p) {
// ˅
// ˄
// ˅
// ˄
}
// ˅
// ˄