edu.uci.ics.jung.utils
Interface UserDataContainer.CopyAction

All Known Implementing Classes:
UserDataContainer.CopyAction.Clone, UserDataContainer.CopyAction.Remove, UserDataContainer.CopyAction.Shared
Enclosing interface:
UserDataContainer

public static interface UserDataContainer.CopyAction

Decides what to do when a user datum is copied. Some of the more common responses might include returning null, returning the object, or returning a clone of the object.

Author:
danyelf

Nested Class Summary
static class UserDataContainer.CopyAction.Clone
          Implements UserData.CLONE
static class UserDataContainer.CopyAction.Remove
          Implements UserData.REMOVE
static class UserDataContainer.CopyAction.Shared
          Implements UserData.SHARED
 
Method Summary
 java.lang.Object onCopy(java.lang.Object value, UserDataContainer source, UserDataContainer target)
          The callback triggered when a UserDatum is copied.
 

Method Detail

onCopy

public java.lang.Object onCopy(java.lang.Object value,
                               UserDataContainer source,
                               UserDataContainer target)
The callback triggered when a UserDatum is copied. Implement this method to create your own CopyAction.

Parameters:
value - The item of UserData that is being copied
source - The UserDataContainer that holds this datum
target - The UserDataContainer that will hold the new datum
Returns:
Object The copy of the UserData