/*
 * Javolution - Java(TM) Solution for Real-Time and Embedded Systems
 * Copyright (C) 2005 - Javolution (http://javolution.org/)
 * All rights reserved.
 * 
 * Permission to use, copy, modify, and distribute this software is
 * freely granted, provided that this notice is preserved.
 */
package javolution37.javolution.realtime;
import javolution37.javolution.lang.Text;

/**
 * 

This interface identifies classes whose instances can be moved to * different {@link ObjectSpace ObjectSpace} for higher * performance and higher predictability.

* *

Real-time objects may contain references to external real-time objects. * These referenced objects might have to be moved along when the real-time * object is moved. For example:[code] * public class Person extends RealtimeObject { // Implements Realtime. * private Person _mother; // External. * private Person _father; // External. * private final FastList _children = new FastList(); * ... * public boolean move(ObjectSpace os) { * if (super.move(os)) { // Propagates to referenced objects. * _mother.move(os); * _father.move(os); * // The children list itself is part of this object * // and does not require any particular action, but it * // references external objects which need to be moved along. * for (Person child : _children) child.move(os); * return true; // For sub-classes to do their part. * } * return false; * } * }[/code]

* * @author Jean-Marie Dautelle * @version 3.7, January 1, 2006 */ public interface Realtime { /** * Moves this real-time object to the specified object space. * * @param os the object space to move this real-time object to. * @return true if the move has to be propagated to * external real-time references; false otherwise. */ boolean move(ObjectSpace os); /** * Returns the textual representation of this real-time object * (equivalent to toString except that the returned value * can be allocated from the local context space). * * @return this object's textual representation. */ Text toText(); /** * This class represents an object space which determinates when object * recycling occurs.

Ads help maintain this website.