FileDocCategorySizeDatePackage
OfficeManager.javaAPI DocJBoss 4.2.13334Fri Jul 13 21:02:22 BST 2007test.dbc.office

OfficeManager

public class OfficeManager extends Object
author
Kabir Khan
version
$Revision: 57186 $
@org.jboss.aspects.dbc.Dbc
@org.jboss.aspects.dbc.Invariant
({"$tgt.computers != null", "$tgt.developers != null", "forall test.dbc.office.Computer c in $tgt.computers | c != null", "forall d in $tgt.developers | d != null"})

Fields Summary
ArrayList
computers
ArrayList
developers
Constructors Summary
Methods Summary
public voidassignComputer(Computer computer, Developer developer)
PreCond: The computer and developer must both be not-null, and not previously assigned PostCond: Make sure that all developers have a computer, and that that computer is associated with the developer in question

@org.jboss.aspects.dbc.PreCond
({"$0 != null", "$1 != null", "exists test.dbc.office.Computer c in $tgt.computers | c.getDeveloper() == null && c == $0", "exists test.dbc.office.Developer d in $tgt.developers | d.getComputer() == null && d == $1"})
@org.jboss.aspects.dbc.PostCond
({"forall d in $tgt.developers | exists c in $tgt.computers | (c == d.getComputer() && d == c.getDeveloper())"})

      System.out.println("========================= SET DEVELOPER ==============================");
      computer.setDeveloper(developer);
      System.out.println("========================= SET COMPUTER ==============================");
      developer.setComputer(computer);
   
public ComputercreateComputer(java.lang.String name)
PostCond: The computer should be unassigned after adding

@org.jboss.aspects.dbc.PostCond
({"exists test.dbc.office.Computer c in $tgt.computers | c.getDeveloper() == null && c == $rtn"})

   
                             
      
   
      Computer computer = new Computer(name);
      computers.add(computer);
      return computer;
   
public DevelopercreateDeveloper(java.lang.String name)
PostCond: The developer should not have a computer after adding

@org.jboss.aspects.dbc.PostCond
({"exists test.dbc.office.Developer d in $tgt.developers | d.getComputer() == null && d == $rtn"})

      Developer developer = new Developer(name);
      developers.add(developer);
      return developer;