All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.baltoro.remote.CQueue Maven / Gradle / Ivy

There is a newer version: 4.0.12
Show newest version
package io.baltoro.remote;

public class CQueue
{

    private int s; 
    private E[] e;
    private int i = -1;
  
    public CQueue(int s) 
    {
        this.s = s;
        e = (E[]) new Object[s];
        
    }

    
    public void add(E item) 
    {
    	i++;
    	if( i >= s)
    	{
    		i = 0;
    	}
        e[i] = item;
    }

    public E get(int i)
    {
    	int _i = s % i;
        return e[_i];
    }

    public int getIndex()
    {
    	return i;
    }
   
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy