All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cdc.mf.model.MfLink Maven / Gradle / Ivy

The newest version!
package cdc.mf.model;

public abstract class MfLink

extends MfAbstractBasicElement

{ private boolean reversed = false; protected MfLink(Builder builder, MfElementFeatures features) { super(builder, features); } boolean isReversed() { return reversed; } boolean reverse() { if (!reversed) { final MfElementRef ref = getTargetRef(); if (ref.isValid()) { ((MfAbstractElement) ref.get()).addToReversed(this); reversed = true; } } return reversed; } public P getSource() { return getParent(); } public abstract MfElementRef getTargetRef(); public MfElement getTarget() { return getTargetRef().get(); } /** * Base builder of links. * * @author Damien Carbonne * * @param The builder type. * @param The built element type. * @param

The concrete parent type. */ public abstract static class Builder, E extends MfLink, P extends MfElement> extends MfAbstractBasicElement.Builder { protected Builder(P parent) { super(parent); } } }