workcraft/workcraft

View on GitHub
workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/components/CreditComponent.java

Summary

Maintainability
A
0 mins
Test Coverage
package org.workcraft.plugins.xmas.components;

import org.workcraft.annotations.VisualClass;
import org.workcraft.observation.PropertyChangedEvent;

@VisualClass(VisualCreditComponent.class)
public class CreditComponent extends XmasComponent {
    public static final String PROPERTY_CAPACITY = "Capacity";
    public static final String PROPERTY_INIT = "Init";

    public int capacity = 1;
    public int init = 0;

    public void setCapacity(int value) {
        if (capacity != value) {
            capacity = value;
            sendNotification(new PropertyChangedEvent(this, PROPERTY_CAPACITY));
        }
    }

    public int getCapacity() {
        return capacity;
    }

    public void setInit(int value) {
        if (init != value) {
            init = value;
            sendNotification(new PropertyChangedEvent(this, PROPERTY_INIT));
        }
    }

    public int getInit() {
        return init;
    }
}