001/**
002 * Get more info at : www.jrebirth.org .
003 * Copyright JRebirth.org © 2011-2016
004 * Contact : sebastien.bordes@jrebirth.org
005 *
006 * Licensed under the Apache License, Version 2.0 (the "License");
007 * you may not use this file except in compliance with the License.
008 * You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.jrebirth.af.api.component.behavior;
019
020import org.jrebirth.af.api.component.basic.Component;
021
022/**
023 * The Interface <b>Behavior</b> is used to define basic methods that each Behavior shall implements.
024 *
025 * A Behavior represents a piece of code that could be plugged and unplugged to any {@link BehavioredComponent} at any time.
026 *
027 * A behavior is also a {@link EnhancedComponent} and is stored into the {@link BehaviorFacade}.
028 *
029 * @param <D> the generic type of the behavior data
030 * @param <C> the generic type of the component using this behavior
031 */
032public interface Behavior<D extends BehaviorData, C extends BehavioredComponent<C>> extends Component<Behavior<?, ?>> {
033
034    /**
035     * Gets the {@link BehaviorData} used by this Behavior.
036     *
037     * @return the behavior data
038     */
039    D data();
040
041    /**
042     * Gets the {@link EnhancedComponent} concerned by this Behavior.
043     *
044     * @return the component
045     */
046    C component();
047
048}