pl.edu.agh.cast.common
Interface IReplicable

All Known Subinterfaces:
IDomainElement, IElement, IEntity, IGeneralElement, IManyToManyRelation, IOneToOneRelation, IPresentationElement<T>, IReference<T>, IReferenceList<T>, ISchemaConnection, ISchemaElement<T>, ISchemaNode, ITimedManyToManyRelation, ITimedOneToOneRelation, IVisualElement<M>, IVisualSchemaConnection, IVisualSchemaElement<T>, IVisualSchemaNode
All Known Implementing Classes:
AbstractElement, Entity, ManyToManyRelation, OneToOneRelation, PresentationElement, SchemaConnection, SchemaNode, TimedManyToManyRelation, TimedOneToOneRelation, VisualElement, VisualSchemaConnection, VisualSchemaNode

public interface IReplicable

Interface of objects that may be replicated. This is similar to Java cloning.

Author:
AGH CAST Team
See Also:
Cloneable

Method Summary
 Object replicate()
          Returns a replicated instance of this instance.
 Object replicateTo(Object replica)
          Replicates this instance state to given replica object.
 

Method Detail

replicate

Object replicate()
                 throws ReplicationException
Returns a replicated instance of this instance.

Returns:
replicated instance
Throws:
ReplicationException - if replication fails

replicateTo

Object replicateTo(Object replica)
                   throws IllegalArgumentException,
                          ReplicationException
Replicates this instance state to given replica object. The replica should be an instance of replicated instance's class (same class or subclass).

Parameters:
replica - the object to replicate to
Returns:
the replica object (the same instance as given)
Throws:
IllegalArgumentException - if given object is null or of invalid type
ReplicationException - if replication fails


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.