|
Trull | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.luc.cs.trull.EmptyComponent
edu.luc.cs.trull.TerminatingComponent
edu.luc.cs.trull.AbstractComponent
edu.luc.cs.trull.AbstractCombinator
edu.luc.cs.trull.SingleChildCombinator
edu.luc.cs.trull.Rename
public class Rename
A combinator for event renaming and event hiding. It provides an implementation of consistent renaming of event labels within a given component from any event labels seen externally.
Local| Nested Class Summary | |
|---|---|
protected class |
Rename.LocalListener
A dedicated listener that forwards the event to all external listeners. |
| Nested classes/interfaces inherited from class edu.luc.cs.trull.AbstractCombinator |
|---|
AbstractCombinator.DefaultTerminationListener |
| Field Summary | |
|---|---|
private java.beans.PropertyChangeListener |
internalListener
The listener to the child component. |
private java.util.Set |
localEvents
The set of hidden events local to this component. |
private static org.apache.log4j.Logger |
logger
|
private java.util.Map |
renameEventsInside
A hashmap for inside events that needs to be renamed when leaving the component. |
private java.util.Map |
renameEventsOutside
A hashmap for outside eventsthat needs to be renamed when entering the component. |
private TerminationListener |
terminationListener
The child termination listener of this component. |
| Fields inherited from class edu.luc.cs.trull.AbstractCombinator |
|---|
components |
| Constructor Summary | |
|---|---|
Rename()
Constructs a Rename component. |
|
Rename(Component body)
Rename([], [], body) |
|
Rename(java.lang.String[] internalLabels,
java.lang.String[] externalLabels,
Component body)
Constructs a Rename component. |
|
Rename(java.lang.String internalLabel,
java.lang.String externalLabel,
Component body)
Rename([internalLabel], [externalLabel], body) |
|
| Method Summary | |
|---|---|
void |
addEventRenaming(java.lang.String internalEvent,
java.lang.String externalEvent)
Adds an event renaming to this component. |
protected TerminationListener |
getChildTerminationListener()
Returns the internal listener that is notified if the child component terminates. |
protected Component |
getDefaultChild()
This method returns the default child component. |
java.util.Map.Entry[] |
getEventRenamings()
Returns the array of event renamings currently in effect. |
protected java.beans.PropertyChangeListener |
getInternalListener()
Returns the internal listener that listens to the child component. |
java.lang.String[] |
getLocalEvents()
Returns the event labels that have been hidden. |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
This method processes incoming events by forwarding them to the child component. |
void |
removeEventRenaming(java.lang.String internalEvent)
Removes the event renaming for the given internal event label. |
void |
setLocalEvent(java.lang.String label)
Sets the event label to be hidden. |
void |
setLocalEvents(java.util.Collection evts)
Sets the event labels to be hidden. |
void |
setLocalEvents(java.lang.String[] labels)
Sets the event labels to be hidden. |
| Methods inherited from class edu.luc.cs.trull.SingleChildCombinator |
|---|
addComponent, getChild, removeComponent, resume, start, stop, suspend |
| Methods inherited from class edu.luc.cs.trull.AbstractCombinator |
|---|
addComponent, addComponent, getComponent, getComponentCount, getComponents, removeAllComponents, removeComponent |
| Methods inherited from class edu.luc.cs.trull.AbstractComponent |
|---|
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getExternalListeners, getPropertyChangeListeners, removePropertyChangeListener |
| Methods inherited from class edu.luc.cs.trull.TerminatingComponent |
|---|
fireTermination, getParent, getTermEvent, scheduleTermination, setTerminationListener |
| Methods inherited from class edu.luc.cs.trull.EmptyComponent |
|---|
getTerminationListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface edu.luc.cs.trull.PropertyChangeSource |
|---|
addPropertyChangeListener, getPropertyChangeListeners, removePropertyChangeListener |
| Methods inherited from interface edu.luc.cs.trull.Terminating |
|---|
getTerminationListener, setTerminationListener |
| Field Detail |
|---|
private java.beans.PropertyChangeListener internalListener
private java.util.Set localEvents
private static final org.apache.log4j.Logger logger
private java.util.Map renameEventsInside
private java.util.Map renameEventsOutside
private TerminationListener terminationListener
| Constructor Detail |
|---|
public Rename()
public Rename(Component body)
Rename([], [], body)
public Rename(java.lang.String[] internalLabels,
java.lang.String[] externalLabels,
Component body)
internalLabels - the array of original event labels before the renaming.externalLabels - the array of resulting event labels after the renaming.body - the body component.
public Rename(java.lang.String internalLabel,
java.lang.String externalLabel,
Component body)
Rename([internalLabel], [externalLabel], body)
| Method Detail |
|---|
public void addEventRenaming(java.lang.String internalEvent,
java.lang.String externalEvent)
internalEvent - the original event seen inside the component.externalEvent - the corresponding event seen outside the component.protected TerminationListener getChildTerminationListener()
AbstractCombinator
getChildTerminationListener in class AbstractCombinatorprotected Component getDefaultChild()
SingleChildCombinator
getDefaultChild in class SingleChildCombinatorpublic java.util.Map.Entry[] getEventRenamings()
protected java.beans.PropertyChangeListener getInternalListener()
SingleChildCombinator
getInternalListener in class SingleChildCombinatorpublic java.lang.String[] getLocalEvents()
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange in interface java.beans.PropertyChangeListenerpropertyChange in class SingleChildCombinatorevt - the event received.public void removeEventRenaming(java.lang.String internalEvent)
internalEvent - the internal event label.public void setLocalEvent(java.lang.String label)
label - the event label to be hidden.public void setLocalEvents(java.util.Collection evts)
evts - the collection of event labels to be hidden.public void setLocalEvents(java.lang.String[] labels)
labels - the array of event labels to be hidden.
|
Trull | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||