max

목록에서 가장 큰 값(또는 목록이 비어 있는 경우 null)을 판별합니다.

목록에는 다음을 포함하여(단, 이에 한하지는 않음) 비교 가능한 오브젝트 유형이 포함될 수 있습니다.

참고: 비교하기 전에 Number의 모든 인스턴스를 CER의 고유 숫자 형식으로 변환합니다(java.math.BigDecimal이 지원).
<?xml version="1.0" encoding="UTF-8"?>
<RuleSet name="Example_max"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation=
"http://www.curamsoftware.com/CreoleRulesSchema.xsd">
  <Class name="MaxExampleRuleClass">

    <!-- "가장 큰" 문자열 값으로 "Cherry"를 선택합니다. -->
    <Attribute name="alphabeticallyLastFruit">
      <type>
        <javaclass name="String"/>
      </type>
      <derivation>
        <max>
          <reference attribute="fruits"/>
        </max>
      </derivation>
    </Attribute>

    <Attribute name="fruits">
      <type>
        <javaclass name="List">
          <javaclass name="String"/>
        </javaclass>
      </type>
      <derivation>
        <fixedlist>
          <listof>
            <javaclass name="String"/>
          </listof>
          <members>
            <String value="Apple"/>
            <String value="Banana"/>
            <String value="Cherry"/>
          </members>
        </fixedlist>
      </derivation>
    </Attribute>

    <!-- 반점이 가장 많은 개의 반점 수를 판별합니다. -->
    <Attribute name="largestNumberOfSpots">
      <type>
        <javaclass name="Number"/>
      </type>
      <derivation>
        <max>
          <dynamiclist>
            <list>
              <reference attribute="dalmatians"/>
            </list>
            <listitemexpression>
              <reference attribute="numberOfSpots">
                <current/>
              </reference>
            </listitemexpression>
          </dynamiclist>
        </max>
      </derivation>
    </Attribute>

    <Attribute name="dalmatians">
      <type>
        <javaclass name="List">
          <ruleclass name="Dalmation"/>
        </javaclass>
      </type>
      <derivation>
        <specified/>
      </derivation>
    </Attribute>

  </Class>

  <Class name="Dalmation">

    <Attribute name="numberOfSpots">
      <type>
        <javaclass name="Number"/>
      </type>
      <derivation>
        <specified/>
      </derivation>
    </Attribute>

  </Class>

</RuleSet>