Tv.java :  » UML » xuml-compiler » moten » david » xuml » model » example » tv » Java Open Source

Java Open Source » UML » xuml compiler 
xuml compiler » moten » david » xuml » model » example » tv » Tv.java
package moten.david.xuml.model.example.tv;

import model.Class;
import model.Package;
import model.Primitive;
import moten.david.xuml.model.Multiplicity;
import moten.david.xuml.model.util.SystemBase;

public class Tv extends SystemBase {

  public Tv() {
    super(null, "Tv");
    initialise();
  }

  private void initialise() {
    Package pkg = createRootPackage("tv", "tv root package");

    Class channel = createClassWithArbitraryId(pkg, "Channel",
        "Digital TV channels");
    createAttribute(channel, "name").setUnique(true);
    createAttribute(channel, "description").setMandatory(false);

    Class recording = createClassWithArbitraryId(pkg, "Recording",
        "Scheduled and completed recordings");
    createAttribute(recording, "jobNumber", Primitive.INTEGER).setUnique(
        true);
    createAttribute(recording, "startTime", Primitive.TIMESTAMP);
    createAttribute(recording, "durationMinutes", Primitive.DECIMAL);
    createAttribute(recording, "name");
    createAttribute(recording, "description");

    createAssociation("R1", createAssociationEndPrimary(recording,
        Multiplicity.MANY, "is recorded by"),
        createAssociationEndSecondary(channel, Multiplicity.ONE,
            "records"));
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.