J avolution v3.7 (J2SE 1.5+)

javolution.realtime
Interface Realtime

All Known Implementing Classes:
CharacterData, FastCollection, FastList, FastMap, FastSet, FastTable, RealtimeObject, StackReference, Text, TextBuilder

public interface Realtime

This interface identifies classes whose instances can be moved to different 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:

     public class Person extends RealtimeObject  { // Implements Realtime.
         private Person _mother; // External.
         private Person _father; // External.
         private final FastList<Person> _children = new FastList<Person>();  
         ...
         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;
         }
     }

Version:
3.7, January 1, 2006
Author:
Jean-Marie Dautelle

Nested Class Summary
static class Realtime.ObjectSpace
          This class represents an object space which determinates when object recycling occurs.
 
Method Summary
 boolean move(Realtime.ObjectSpace os)
          Moves this real-time object to the specified object space.
 Text toText()
          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).
 

Method Detail

move

boolean move(Realtime.ObjectSpace os)
Moves this real-time object to the specified object space.

Parameters:
os - the object space to move this real-time object to.
Returns:
true if the move has to be propagated to external real-time references; false otherwise.

toText

Text toText()
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).

Returns:
this object's textual representation.

J avolution v3.7 (J2SE 1.5+)

Copyright © 2006 Javolution.