Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有一个“等级”类,其“价值”属性设置为真实,我的问题是如何在 OCL 中编写这种条件:
等级是一组 {2, 3, 3.5, 4, 4.5, 5} 中的一个数字
它应该是
inv:Set{2, 3, 3.5, 4, 4.5, 5}->includes(self.value)
(诚然,我不是 OCL 专业人士)