FileDocCategorySizeDatePackage
Shifter.javaAPI DocGlassfish v2 API3633Fri May 04 22:36:24 BST 2007com.sun.enterprise.admin.jmx.remote.internal

Shifter

public final class Shifter extends Object
author
Kedar Mhaswade
since
S1AS8.0
version
$Revision: 1.4 $

Fields Summary
private Object[]
args
Constructors Summary
public Shifter(Object[] in)

		if (in == null)
			throw new IllegalArgumentException("null array");
		this.args = new Object[in.length];
		System.arraycopy(in, 0, args, 0, in.length);
	
Methods Summary
public java.lang.ObjectshiftLeft()

		if (args.length == 0)
			throw new IllegalStateException("Can't Shift left, no elements");
		final Object ret = args[0];
		final Object[] tmp = new Object[args.length - 1];
		for (int i = 0 ; i < tmp.length ; i++) {
			tmp[i] = args[i + 1];
		}
		args = tmp;
		return ( ret );
	
public voidshiftRight(java.lang.Object addition)

		if (addition == null)
			throw new IllegalArgumentException ("Null argument");
		final Object[] tmp = new Object[args.length + 1];
		tmp[0] = addition;
		for (int i = 0 ; i < args.length ; i++) {
			tmp[i + 1] = args[i];
		}
		args = tmp;
	
public java.lang.Object[]state()

		return ( args );