Class PropCnrEvent

All Implemented Interfaces:
IPostEventProcessing

public class PropCnrEvent extends BubbleEvent
Event indicating a property container has had a property added or removed.
Author:
Christopher Mindus
  • Constructor Details

    • PropCnrEvent

      public PropCnrEvent(int eventID, PropCnr container, GProp<?> property, int index, PropMgr propMgr)
      Constructs a new property container event.
      Parameters:
      eventID - The event ID, see GEvent.PROP_*.
      container - The property container who is being modified.
      property - The property being added or removed.
      index - The index of the property added or it had when it was removed.
      propMgr - The remote Property Manager, null for local.
      See Also:
    • PropCnrEvent

      public PropCnrEvent(int eventID, PropCnr container, GProp<?> property, int index, IGProp<?> trigger, PropMgr propMgr)
      Constructs a new property container event.
      Parameters:
      eventID - The event ID, see GEvent.PROP_*.
      container - The property container who is being modified.
      property - The property being added or removed.
      index - The index of the property added or it had when it was removed.
      trigger - The trigger property, null for none.
      propMgr - Flag indicating this change is induced from a remote party.
      See Also:
  • Method Details

    • getRemotePropMgr

      public PropMgr getRemotePropMgr()
      Gets the (remote) Property Manager that caused the remote event.
      Returns:
      The Property Manager, null if not remote.
    • getIndex

      public int getIndex()
      Gets the index of the property.
      Returns:
      The index of the property it had when removed, and it has when added.
    • getContainer

      public PropCnr getContainer()
      Gets the container that got the property added or removed.
    • getProperty

      public GProp<?> getProperty()
      Gets the property being added or removed.
      Returns:
      the property being added or removed.
    • getTrigger

      public GProp<?> getTrigger()
      Gets the trigger of the container property change.
      Overrides:
      getTrigger in class GEvent
      Returns:
      The property that triggered this event, null for none.
    • getEventTarget

      public GProp<?> getEventTarget()
      Gets the event owner. The owner is the one the message relates to e.g. the property for value change or the property being added or removed for property container events.
      Overrides:
      getEventTarget in class GEvent
      Returns:
      The Generic Property for the event, the source, or originator.
    • isPropertyChange

      public boolean isPropertyChange(IGProp<?> property)
      Checks if the event is a property value change.
      Overrides:
      isPropertyChange in class GEvent
      Parameters:
      property - The property.
      Returns:
      true if the property just got changed in the container due to this event, false otherwise.
    • isPropertyChange

      public boolean isPropertyChange(PropCnr pc, Atom name)
      Checks if the event is a modification change of any property in the specified container.
      Overrides:
      isPropertyChange in class GEvent
      Parameters:
      pc - The property container.
      name - The property name to check for change.
      Returns:
      true if the property just got changed in the container due to this event, false otherwise.
    • isPropertyChange

      public boolean isPropertyChange(PropCnr pc, String name)
      Checks if the event is a modification change of any property in the specified container.
      Overrides:
      isPropertyChange in class GEvent
      Parameters:
      pc - The property container.
      name - The property name to check for change.
      Returns:
      true if the property just got changed in the container due to this event, false otherwise.
    • isClearCacheEvent

      public boolean isClearCacheEvent()
      Returns the state for a property container if this event is received in the onEventSelf method as a helper for it would need to clear the property container cache.
      Overrides:
      isClearCacheEvent in class GEvent
      Returns:
      true, always for this event.
    • isVerifyEvent

      public boolean isVerifyEvent()
      Returns if this event is a verify event for a container that processes verification.
      Overrides:
      isVerifyEvent in class GEvent
      Returns:
      true always.
    • paramString

      protected StringBuilder paramString(StringBuilder buf)
      Returns the parameter string representing the state of this event. This string is useful for debugging. Super classes adds extra information to the string by preceding it with a comma followed by the extra information.
      Overrides:
      paramString in class GEvent
      Parameters:
      buf - The StringBuilder to append the string to.
      Returns:
      The StringBuilder, i.e. the buf input parameter.