Source (Java):

 

package flip;

public interface iFlip {

     public int flip(int i);

     }

 

package flip;

public class foo implements iFlip {

     public foo(){}

     public flip(int i) {

         return i * -1;

         }

     }

 

package flip;

public class FlipClient {

     public static void main(String[] args) {

         foo f= new foo();

         iFlip g=(iFlip) f;

         f.flip(100);

         }

     }

 

<?xml version="1.0" encoding="UTF-8"?>
<kdm:Segment xmi:version="2.1"

xmlns:xmi="http://www.omg.org/XMI"

xmlns:action="http://kdm.omg.org/action"

xmlns:code="http://kdm.omg.org/code"

xmlns:kdm="http://kdm.omg.org/kdm"

name="Interface Example">
 
<model xmi:id="id.0" xmi:type="code:CodeModel">
    <codeElement xmi:id="id.1" xmi:type="code:Package" name="flip">
      <codeElement xmi:id="id.2" xmi:type="code:ClassUnit" name="foo">
        <codeRelation xmi:id="id.3" xmi:type="code:Implements" to="id.21" from="id.2"/>
        <codeElement xmi:id="id.4" xmi:type="code:MethodUnit" name="flip" type="id.23">
          <codeRelation xmi:id="id.5" xmi:type="code:ImplementationOf" to="id.22" from="id.4"/>
         
<entryFlow xmi:id="id.6" to="id.10" from="id.4"/>
          <codeElement xmi:id="id.7" xmi:type="code:Signature" name="flip">
            <parameterUnit xmi:id="id.8" name="i" type="id.53"/>
            <parameterUnit xmi:id="id.9" type="id.53" kind="return"/>
          </codeElement>
          <codeElement xmi:id="id.10" xmi:type="action:ActionElement" name="d1" kind="Multiply">
            <codeElement xmi:id="id.11" xmi:type="code:Value" name="-1" type="id.53"/>
            <codeElement xmi:id="id.12" xmi:type="code:StorableUnit" name="t5" type="id.53" kind="register"/>
            <actionRelation xmi:id="id.13" xmi:type="action:Reads" to="id.8" from="id.10"/>
            <actionRelation xmi:id="id.14" xmi:type="action:Reads" to="id.11" from="id.10"/>
            <actionRelation xmi:id="id.15" xmi:type="action:Writes" to="id.12" from="id.10"/>
            <actionRelation xmi:id="id.16" xmi:type="action:Flow" to="id.17" from="id.10"/>
          </codeElement>
          <codeElement xmi:id="id.17" xmi:type="action:ActionElement" name="d2" kind="Return">
            <actionRelation xmi:id="id.18" xmi:type="action:Reads" to="id.12" from="id.17"/>
          </codeElement>
        </codeElement>
        <codeElement xmi:id="id.19" xmi:type="code:MethodUnit" name="foo" type="id.20" kind="constructor">
          <codeElement xmi:id="id.20" xmi:type="code:Signature" name="foo"/>
        </codeElement>
      </codeElement>
      <codeElement xmi:id="id.21" xmi:type="code:InterfaceUnit" name="IFlip">
        <codeElement xmi:id="id.22" xmi:type="code:MethodUnit" name="flip" type="id.23" kind="abstract"/>
        <codeElement xmi:id="id.23" xmi:type="code:Signature" name="flip">
          <parameterUnit xmi:id="id.24" name="i" type="id.53" pos="1"/>
          <parameterUnit xmi:id="id.25" type="id.53" kind="return" pos="0"/>
       
</codeElement>
      </codeElement>
      <codeElement xmi:id="id.26" xmi:type="code:ClassUnit" name="Flipclient">
       
<codeElement xmi:id="id.27" xmi:type="code:MethodUnit" name="main" type="id.29">
          <entryFlow xmi:id="id.28" to="id.35" from="id.27"/>
          <codeElement xmi:id="id.29" xmi:type="code:Signature" name="main">
            <parameterUnit xmi:id="id.30" name="args" type="id.31" pos="1">
              <codeElement xmi:id="id.31" xmi:type="code:ArrayType">
                <itemUnit xmi:id="id.32" name="args[]" type="id.54"/>
              </codeElement>
            </parameterUnit>
          </codeElement>
          <codeElement xmi:id="id.33" xmi:type="code:StorableUnit" name="f" type="id.2" kind="local"/>
          <codeElement xmi:id="id.34" xmi:type="code:StorableUnit" name="g" type="id.21" kind="local"/>
          <codeElement xmi:id="id.35" xmi:type="action:ActionElement" name="a1" kind="New">
            <actionRelation xmi:id="id.36" xmi:type="action:Creates" to="id.2" from="id.35"/>
            <actionRelation xmi:id="id.37" xmi:type="action:Writes" to="id.33" from="id.35"/>
            <actionRelation xmi:id="id.38" xmi:type="action:Flow" to="id.39" from="id.35"/>
          </codeElement>
          <codeElement xmi:id="id.39" xmi:type="action:ActionElement" name="a2" kind="MethodCall">
            <actionRelation xmi:id="id.40" xmi:type="action:CompliesTo" to="id.20" from="id.39"/>
            <actionRelation xmi:id="id.41" xmi:type="action:Addresses" to="id.33" from="id.39"/>
            <actionRelation xmi:id="id.42" xmi:type="action:Calls" to="id.19" from="id.39"/>
            <actionRelation xmi:id="id.43" xmi:type="action:Flow" to="id.44" from="id.39"/>
          </codeElement>
          <codeElement xmi:id="id.44" xmi:type="action:ActionElement" name="a3" kind="DynCast">
            <actionRelation xmi:id="id.45" xmi:type="action:Reads" to="id.33" from="id.44"/>
            <actionRelation xmi:id="id.46" xmi:type="action:UsesType" to="id.21" from="id.44"/>
            <actionRelation xmi:id="id.47" xmi:type="action:Writes" to="id.34" from="id.44"/>
            <actionRelation xmi:id="id.48" xmi:type="action:Flow" to="id.49" from="id.44"/>
          </codeElement>
          <codeElement xmi:id="id.49" xmi:type="action:ActionElement" name="a4" kind="InterfaceCall">
            <actionRelation xmi:id="id.50" xmi:type="action:CompliesTo" to="id.23" from="id.49"/>
            <actionRelation xmi:id="id.51" xmi:type="action:Addresses" to="id.34" from="id.49"/>
            <actionRelation xmi:id="id.52" xmi:type="action:Calls" to="id.22" from="id.49"/>
          </codeElement>
        </codeElement>
      </codeElement>
    </codeElement>
    <codeElement xmi:id="id.53" xmi:type="code:IntegerType" name="int"/>
   
<codeElement xmi:id="id.54" xmi:type="code:StringType" name="String"/>
  </model>
</kdm:Segment>