com.starbase.starteam
Class ItemUpdateEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--com.starbase.starteam.ItemUpdateEvent
All Implemented Interfaces:
java.io.Serializable

public class ItemUpdateEvent
extends java.util.EventObject

An event triggered whenever an Item is added, moved, changed or deleted in a View.

See Also:
ItemUpdateListener, View.addItemUpdateListener(com.starbase.starteam.ItemUpdateListener, com.starbase.starteam.Type), Folder.addItemUpdateListener(com.starbase.starteam.ItemUpdateListener, com.starbase.starteam.Type, int), ItemListManager.addItemUpdateListener(com.starbase.starteam.ItemUpdateListener), Serialized Form

Constructor Summary
ItemUpdateEvent(Item oldItem, Item newItem)
          Constructs a new ItemUpdateEvent.
 
Method Summary
 boolean equals(java.lang.Object source)
          returns true if this object instance is equal to the source
 Item getNewItem()
          Gets the Item in its new state.
 Item getOldItem()
          Gets the Item in its old state.
 java.lang.Object getSource()
          The object on which the Event initially occurred.
 int hashCode()
          returns a unique hash for all instances of this type
 java.lang.String toString()
          Gets a short description of this Event.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ItemUpdateEvent

public ItemUpdateEvent(Item oldItem,
                       Item newItem)
Constructs a new ItemUpdateEvent.

Parameters:
oldItem - The item in its old state, or null.
newItem - The item in its new state, or null.
Method Detail

getNewItem

public Item getNewItem()
Gets the Item in its new state.

Used in itemAdded(), itemMoved() and itemChanged() events. In itemRemoved() events, getNewItem() returns null.

Item.getParentItem() will return a valid parent Folder object. For performance reasons, the same Folder object may be modified and re-used in subsequent events. If an application wants to modify the Folder, or save its state for later use, it should make its own private copy.

If an application wants to refresh the Items associated with the original Folder object, it must do so by explicitly calling Folder.refreshItems().

Returns:
The Item in its new state.
See Also:
ItemUpdateEvent.getOldItem(), Item, Folder.refreshItems(java.lang.String, java.lang.String[], int)

getOldItem

public Item getOldItem()
Gets the Item in its old state.

Used in itemChanged(), itemMoved() and itemRemoved() events. In itemAdded() events, getOldItem() returns null.

Item.getParentItem() will return a valid parent Folder object. For performance reasons, the same Folder object may be modified and re-used in subsequent events. If an application wants to modify the Folder, or save its state for later use, it should make its own private copy.

Returns:
The Item in its old state.
See Also:
ItemUpdateEvent.getNewItem(), Item

getSource

public java.lang.Object getSource()
The object on which the Event initially occurred.

Overrides:
getSource in class java.util.EventObject
Returns:
The object on which the Event initially occurred.

toString

public java.lang.String toString()
Gets a short description of this Event.

Overrides:
toString in class java.util.EventObject
Returns:
A short description of this Event.

equals

public boolean equals(java.lang.Object source)
returns true if this object instance is equal to the source

Overrides:
equals in class java.lang.Object
Parameters:
source - Object the source to comapre with
Returns:
boolean true if this object is equal to the source

hashCode

public int hashCode()
returns a unique hash for all instances of this type

Overrides:
hashCode in class java.lang.Object
Returns:
int a unique hash for all instances of this type


StarTeam SDK 10.4, Build 36
Copyright © 2003-2008 Borland Software Corporation. All rights reserved.