Package net.sf.laja.example.person.behaviour

Examples of net.sf.laja.example.person.behaviour.Person


     *     in PersonStateTemplate describes how each BMI attribute is mapped to an attribute in "Person state".
     *  - How to work with composition. In this case we gather all BMI calculations in the behaviour class BodyMassIndex
     *    and then we let 'Person' delegate to this object in the method calculateBmi().
     */
    public static void main(String... args) {
        Person person = Person.givenName("Joakim").surname("Tengstrand").weightInKilograms(82).height(Height.heightInCentimeters(186)).asPerson();
        System.out.println(person);
        System.out.println("Body Mass Index: " + person.calculateBmi());
        System.out.println("Has normal weight?: " + person.hasNormalWeight());
    }
View Full Code Here

TOP

Related Classes of net.sf.laja.example.person.behaviour.Person

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.