2009-01-09 1.2.0

org.eclipse.soda.dk.device.nslog.servlet
Class NSBuffer

java.lang.Object
  extended by org.eclipse.soda.dk.device.nslog.servlet.NSBuffer

public class NSBuffer
extends java.lang.Object

Copyright (c) 2005, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation

Since:
1.0
Version:
1.2.0

Field Summary
protected  java.lang.Object[][] elements
          Define the elements (Object[][]) field.
(package private)  int length
          Define the length (int) field.
 
Constructor Summary
NSBuffer()
          Constructs a standard BaseNotification object.
NSBuffer(int size)
          Constructs an instance of this class from the specified size parameter.
 
Method Summary
 java.lang.Object[] dequeue()
          Perform the dequeue method and return the Object result.
 void enqueue(java.lang.Object topic, java.lang.Object data)
          Enqueue with the specified topic and data parameters.
 int getMaxSize()
          Gets the maximum size of the buffer.
 java.lang.Object[][] getOrderedBuffer()
          Sorted buffer contents without removing or losing origional position.
 void resize(int newsize)
          Resize the buffer.
 int size()
          Gets the current number elements in the buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

elements

protected java.lang.Object[][] elements
Define the elements (Object[][]) field.


length

int length
Define the length (int) field.

Constructor Detail

NSBuffer

public NSBuffer()
Constructs a standard BaseNotification object.

See Also:
NSBuffer(int)

NSBuffer

public NSBuffer(int size)
Constructs an instance of this class from the specified size parameter.

Parameters:
size - The size (int) parameter.
See Also:
NSBuffer()
Method Detail

dequeue

public java.lang.Object[] dequeue()
Perform the dequeue method and return the Object result.

Returns:
Results of the dequeue (Object[]) value.

enqueue

public void enqueue(java.lang.Object topic,
                    java.lang.Object data)
Enqueue with the specified topic and data parameters.

Parameters:
topic - The topic (Object) parameter.
data - The data (Object) parameter.

getMaxSize

public int getMaxSize()
Gets the maximum size of the buffer.

Returns:
Results of the get max size (int) value.

getOrderedBuffer

public java.lang.Object[][] getOrderedBuffer()
Sorted buffer contents without removing or losing origional position.

Returns:
Object[][] with contents sorted from oldest to newest.

resize

public void resize(int newsize)
Resize the buffer.

Parameters:
newsize - The newsize (int) parameter.

size

public int size()
Gets the current number elements in the buffer.

Returns:
Returns a int

2009-01-09 1.2.0

Copyright (c) 2009 IBM. See license in Legal section.