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

com.futureplatforms.kirin.console.dropbox.ConsoleDropbox Maven / Gradle / Ivy

There is a newer version: 2.0.3
Show newest version
package com.futureplatforms.kirin.console.dropbox;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by douglas on 28/09/15.
 */
public class ConsoleDropbox {

    protected ConsoleDropbox() {}

    private final Map _Map = new HashMap<>();

    private int _NextToken = Integer.MIN_VALUE;

    public String putItem(T c) {
        int next = _NextToken;
        _NextToken++;
        _Map.put(next, c);
        return ""+next;
    }

    public T getItem(String token) {
        return _Map.remove(Integer.parseInt(token, 10));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy