javax.realtime
Class LTMemory

java.lang.Object
  extended byjavax.realtime.MemoryArea
      extended byjavax.realtime.ScopedMemory
          extended byjavax.realtime.LTMemory

public class LTMemory
extends ScopedMemory

A scoped memory area with an allocator that operates in linear-bounded time (with respect to the size of the allocation request).

Author:
Angelo Corsaro, Morgan Deters

Field Summary
 
Fields inherited from class javax.realtime.ScopedMemory
joinSynchronizer
 
Fields inherited from class javax.realtime.MemoryArea
logic, parent, sizeInBytes
 
Constructor Summary
LTMemory(long size)
          Creates an LTMemory of the given size.
LTMemory(long initial, long maximum)
          Creates an LTMemory of the given initial and maximal sizes.
LTMemory(long initial, long maximum, Runnable logic)
          Creates an LTMemory of the given initial and maximal sizes, associated with the given Runnable.
LTMemory(long size, Runnable logic)
          Creates an LTMemory of the given size, associated with the given Runnable.
LTMemory(SizeEstimator size)
          Creates an LTMemory of the given size.
LTMemory(SizeEstimator size, Runnable logic)
          Creates an LTMemory of the given size, associated with the given Runnable.
LTMemory(SizeEstimator initial, SizeEstimator maximum)
          Creates an LTMemory of the given initial and maximal sizes.
LTMemory(SizeEstimator initial, SizeEstimator maximum, Runnable logic)
          Creates an LTMemory of the given initial and maximal sizes, associated with the given Runnable.
 
Method Summary
 String toString()
          Returns a user-friendly representation of this ScopedMemory.
 
Methods inherited from class javax.realtime.ScopedMemory
enter, enter, getMaximumSize, getPortal, getReferenceCount, join, join, joinAndEnter, joinAndEnter, joinAndEnter, joinAndEnter, setPortal
 
Methods inherited from class javax.realtime.MemoryArea
executeInArea, finalize, getMemoryArea, guardedRun, memoryConsumed, memoryRemaining, newArray, newInstance, newInstance, size
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LTMemory

public LTMemory(long size)
Creates an LTMemory of the given size.

Parameters:
size - the size of the memory area to create
Throws:
IllegalArgumentException - if size is less than zero
OutOfMemoryError - if there isn't enough storage available for the backing memory

LTMemory

public LTMemory(long initial,
                long maximum)
Creates an LTMemory of the given initial and maximal sizes.

Parameters:
initial - the initial size for this memory area
maximum - the maximum size for this memory area
Throws:
IllegalArgumentException - if initial is less than zero or greater than maximum
OutOfMemoryError - if there isn't enough storage available for the backing memory

LTMemory

public LTMemory(long initial,
                long maximum,
                Runnable logic)
Creates an LTMemory of the given initial and maximal sizes, associated with the given Runnable.

Parameters:
initial - the initial size for this memory area
maximum - the maximum size for this memory area
logic - the Runnable to associate
Throws:
IllegalArgumentException - if initial is less than zero or greater than maximum
IllegalAssignmentError - if storing logic in this violates referencing rules
OutOfMemoryError - if there isn't enough storage available for the backing memory

LTMemory

public LTMemory(long size,
                Runnable logic)
Creates an LTMemory of the given size, associated with the given Runnable.

Parameters:
size - the size of the memory area to create
logic - the Runnable to associate
Throws:
IllegalArgumentException - if size is less than zero
IllegalAssignmentError - if storing logic in this violates referencing rules
OutOfMemoryError - if there isn't enough storage available for the backing memory

LTMemory

public LTMemory(SizeEstimator size)
Creates an LTMemory of the given size.

Parameters:
size - the size of the memory area to create
Throws:
IllegalArgumentException - if size is null
OutOfMemoryError - if there isn't enough storage available for the backing memory

LTMemory

public LTMemory(SizeEstimator initial,
                SizeEstimator maximum)
Creates an LTMemory of the given initial and maximal sizes.

Parameters:
initial - the initial size for this memory area
maximum - the maximum size for this memory area
Throws:
IllegalArgumentException - if initial is greater than maximum, or if either is null
OutOfMemoryError - if there isn't enough storage available for the backing memory

LTMemory

public LTMemory(SizeEstimator initial,
                SizeEstimator maximum,
                Runnable logic)
Creates an LTMemory of the given initial and maximal sizes, associated with the given Runnable.

Parameters:
initial - the initial size for this memory area
maximum - the maximum size for this memory area
logic - the Runnable to associate
Throws:
IllegalArgumentException - if initial is greater than maximum, or if either is null
IllegalAssignmentError - if storing logic in this violates referencing rules
OutOfMemoryError - if there isn't enough storage available for the backing memory

LTMemory

public LTMemory(SizeEstimator size,
                Runnable logic)
Creates an LTMemory of the given size, associated with the given Runnable.

Parameters:
size - the size of the memory area to create
logic - the Runnable to associate
Throws:
IllegalArgumentException - if size is null
IllegalAssignmentError - if storing logic in this violates referencing rules
OutOfMemoryError - if there isn't enough storage available for the backing memory
Method Detail

toString

public String toString()
Returns a user-friendly representation of this ScopedMemory. This String is of the form "(LTMemory) Scoped memory # N" where N is a unique ID identifying this scoped memory area.

Please see the implementation note in the superclass.

Overrides:
toString in class ScopedMemory
Returns:
the user-friendly String representation


jRate is developed and maintained by the jRate project development team.
Copyright (c) 2001-2006 Angelo Corsaro and Morgan Deters.