Set.empty Method

Determines whether the set is empty.

Syntax

public boolean empty()

Run On

Called

Return Value

Type: boolean
true if the set is empty; otherwise, false.

Remarks

This is equivalent to (elements() == 0).

Examples

The following example tests whether there are any elements in a set.

{ 
    Set mySet = new Set(Types::Integer); 
    ; 
    // ... 
    if (mySet.empty()) 
    { 
        print "There are no values in the set"; 
    } 
}

See Also

Set Class

Set.elements Method