Instant methods: contains()
The instant method contains() verifies whether a styles or a set operand completely encloses another styles or set operand.
Declaration
bool styles.contains( styles aStyles )
bool user‑defined‑set‑type.contains( user‑defined‑set‑type aSet )
Parameters
aStyles
The operand to test the inclusion.
aSet
The operand to test the inclusion.
Discussion
Operands of the styles or set data types can be considered as collections containing multiple options you can individually include or exclude. They are sets.
The first version of the method contains() tests whether all options in the styles operand passed in the parameter aStyles are completely included in the operand in context of which this method has been called. In such case the method returns true. Otherwise false is returned. For example:
var styles a = [ Style1, Style3, Style16 ]; var styles b = [ Style3, Style16 ]; var styles c = [ Style1, Style8 ]; var bool result = a.contains( b ); // result = true var bool result = a.contains( c ); // result = false
The second version of the method contains() tests whether all options in the operand of a user defined set data type passed in the parameter aSet are completely included in the operand in context of which this method has been called. In such case the method returns true. Otherwise false is returned. For example:
var Core::Layout a = Core::Layout[ AlignToLeft, AlignToTop, ResizeHorz ]; var Core::Layout b = Core::Layout[ AlignToLeft, ResizeHorz ]; var Core::Layout c = Core::Layout[ AlignToTop, ResizeVert ]; var bool result = a.contains( b ); // result = true var bool result = a.contains( c ); // result = false