Ignore:
Timestamp:
08/16/12 16:08:48 (12 years ago)
Author:
sherbold
Message:
  • countless adaptations throughout nearly all components to remove errors introduced due to the refactoring of the event core
  • added StringEventType? as a simple-to-use event type instead of DummyEventType?
Location:
trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/Event.java

    r551 r553  
    3030     * </p> 
    3131     */ 
    32     public static final Event STARTEVENT = new Event(new DummyEventType()); 
     32    public static final Event STARTEVENT = new Event(new StringEventType("START")); 
    3333 
    3434    /** 
     
    3636     * Global end event that can be used to indicate the end of a sequence. 
    3737     */ 
    38     public static final Event ENDEVENT = new Event(new DummyEventType()); 
     38    public static final Event ENDEVENT = new Event(new StringEventType("END")); 
    3939 
    4040    /** 
     
    160160     */ 
    161161    public String getId() { 
    162         return "(" + type.toString() + ";" + target.toString() + ")"; 
     162        String id = type.toString(); 
     163        if( target!=null ) { 
     164            id += "." + target.toString(); 
     165        } 
     166        return id; 
    163167    } 
    164168 
  • trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/StringEventType.java

    r549 r553  
    1 package de.ugoe.cs.quest.usageprofiles.mock; 
    21 
    3 import de.ugoe.cs.quest.eventcore.IEventType; 
     2package de.ugoe.cs.quest.eventcore; 
    43 
     4import java.security.InvalidParameterException; 
     5 
     6/** 
     7 * <p> 
     8 * A simple event type that is identified by a string. 
     9 * </p> 
     10 *  
     11 * @version $Revision: $ $Date: Aug 16, 2012$ 
     12 * @author 2012, last modified by $Author: sherbold$ 
     13 */ 
    514public class StringEventType implements IEventType { 
    6     /**  */ 
     15 
     16    /** 
     17     * <p> 
     18     * Id for object serialization. 
     19     * </p> 
     20     */ 
    721    private static final long serialVersionUID = 1L; 
    8     String str; 
    922 
    10     public StringEventType(String str) { 
     23    /** 
     24     * <p> 
     25     * String that identifies the event type. 
     26     * </p> 
     27     */ 
     28    private String str; 
     29 
     30    /** 
     31     * <p> 
     32     * Constructor. Creates a new StringEventType. str must not be null. 
     33     * </p> 
     34     *  
     35     * @param str 
     36     *            string that identifies the event type 
     37     * @throws InvalidParameterException 
     38     *             thrown if str is null 
     39     */ 
     40    public StringEventType(String str) throws InvalidParameterException { 
    1141        if (str == null) { 
    12             throw new AssertionError( 
    13                                      "illegal use of mock StringEventType: str must nut be null"); 
     42            throw new InvalidParameterException("str must not be null"); 
    1443        } 
    1544        this.str = str; 
    1645    } 
    1746 
     47    /* 
     48     * (non-Javadoc) 
     49     *  
     50     * @see de.ugoe.cs.quest.eventcore.IEventType#getName() 
     51     */ 
     52    @Override 
    1853    public String getName() { 
    1954        return "StringEventType"; 
    2055    } 
    2156 
     57    /* 
     58     * (non-Javadoc) 
     59     *  
     60     * @see java.lang.Object#toString() 
     61     */ 
     62    @Override 
     63    public String toString() { 
     64        return str; 
     65    } 
     66 
     67    /* 
     68     * (non-Javadoc) 
     69     *  
     70     * @see java.lang.Object#hashCode() 
     71     */ 
     72    @Override 
     73    public int hashCode() { 
     74        return str.hashCode(); 
     75    } 
     76 
     77    /* 
     78     * (non-Javadoc) 
     79     *  
     80     * @see java.lang.Object#equals(java.lang.Object) 
     81     */ 
    2282    @Override 
    2383    public boolean equals(Object other) { 
Note: See TracChangeset for help on using the changeset viewer.