Ignore:
Timestamp:
06/21/11 11:25:45 (13 years ago)
Author:
sherbold
Message:
  • documentation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/EventBenchCore/src/de/ugoe/cs/eventbench/data/ReplayableEvent.java

    r57 r79  
    66import de.ugoe.cs.eventbench.IReplayDecorator; 
    77 
     8/** 
     9 * <p> 
     10 * Subclass of {@link Event} for events that contain all informations required 
     11 * for replaying them, i.e., generating scripts that can used for automated 
     12 * software execution. 
     13 * </p> 
     14 *  
     15 * @author Steffen Herbold 
     16 * @version 1.0 
     17 *  
     18 * @param <T> 
     19 *            Allows only types that extend {@link IReplayable} and is used to 
     20 *            define a list of replayables that describe the replay of the 
     21 *            event. 
     22 */ 
    823public class ReplayableEvent<T extends IReplayable> extends Event<T> { 
    924 
     25        /** 
     26         * <p> 
     27         * List of {@link IReplayable}s of type T that describes the replay of an 
     28         * event. The {@link IReplayable}s can be interpreted as <it>sub-events</it> 
     29         * on the platform level that make up the abstract event. 
     30         * </p> 
     31         */ 
    1032        private List<T> replayEvents = new LinkedList<T>();; 
    1133 
     34        /** 
     35         * <p> 
     36         * Defines whether the replay is valid or invalid. It may be invalid, e.g., 
     37         * due to errors during the generation of the event or lack of vital 
     38         * information. 
     39         * </p> 
     40         */ 
    1241        private boolean replayValid = true; 
    13          
     42 
     43        /** 
     44         * <p> 
     45         * {@link IReplayDecorator} used when replays of this type are written. 
     46         * </p> 
     47         */ 
    1448        private IReplayDecorator decorator = null; 
    15          
     49 
     50        /** 
     51         * <p> 
     52         * Constructor. Creates a new event with the given type. 
     53         * <p> 
     54         *  
     55         * @param type 
     56         *            type of the event 
     57         * @see Event#Event(String) 
     58         */ 
    1659        public ReplayableEvent(String type) { 
    1760                super(type); 
    1861        } 
    19          
     62 
     63        /** 
     64         * <p> 
     65         * Adds a new {@link IReplayable} of type T to the replay sequence. 
     66         * </p> 
     67         *  
     68         * @param replayable 
     69         *            element that is added to the sequence 
     70         */ 
     71        public void addReplayEvent(T replayable) { 
     72                replayEvents.add(replayable); 
     73        } 
     74 
     75        /** 
     76         * <p> 
     77         * Adds a {@link List}ist of {@link IReplayable} to the replay sequence. 
     78         * </p> 
     79         *  
     80         * @param generatedReplaySeq 
     81         *            {@link List} that is added to the sequence 
     82         */ 
    2083        public void addReplaySequence(List<T> generatedReplaySeq) { 
    2184                replayEvents.addAll(generatedReplaySeq); 
    2285        } 
    2386 
    24         public void addReplayEvent(T replayable) { 
    25                 replayEvents.add(replayable); 
     87        /** 
     88         * <p> 
     89         * Returns the {@link IReplayDecorator} of the event. 
     90         * </p> 
     91         *  
     92         * @return {@link IReplayDecorator} of the event; null if no decorator has 
     93         *         been set 
     94         */ 
     95        public IReplayDecorator getReplayDecorator() { 
     96                return decorator; 
    2697        } 
    27          
     98 
    2899        /** 
    29100         * <p> 
    30101         * Returns a the list of replay events. 
    31          * </p>  
     102         * </p> 
    32103         * <p> 
    33104         * The return value is a copy of the list used internally! 
    34105         * </p> 
    35          * @return list of replay events.  
     106         *  
     107         * @return list of replay events. 
    36108         */ 
    37109        public List<T> getReplayMessages() { 
    38110                return new LinkedList<T>(replayEvents); 
    39111        } 
    40          
     112 
     113        /** 
     114         * <p> 
     115         * Returns whether the replay is valid or not. 
     116         * </p> 
     117         *  
     118         * @return true, if replay is valid; false otherwise. 
     119         */ 
    41120        public boolean hasValidReplay() { 
    42121                return replayValid; 
    43122        } 
    44123 
     124        /** 
     125         * <p> 
     126         * Marks the replay as invalid. Once marked as invalid, it remains so and 
     127         * cannot be changed back to valid. 
     128         * </p> 
     129         */ 
    45130        public void invalidateReplay() { 
    46131                replayValid = false; 
    47132        } 
    48133 
     134        /** 
     135         * <p> 
     136         * Sets the {@link IReplayDecorator} associated with the event. 
     137         * </p> 
     138         *  
     139         * @param decorator 
     140         *            decorator associated with the event 
     141         */ 
    49142        public void setDecorator(IReplayDecorator decorator) { 
    50143                this.decorator = decorator; 
    51144        } 
    52          
    53         public IReplayDecorator getReplayDecorator() { 
    54                 return decorator; 
    55         } 
    56145 
    57146} 
Note: See TracChangeset for help on using the changeset viewer.