Logo Search packages:      
Sourcecode: rjava version File versions  Download package

String org::rosuda::JRI::Rengine::jriReadConsole ( String  prompt,
int  addToHistory 
) [inline]

JRI: R_ReadConsole call-back from R.

Parameters:
prompt prompt to display before waiting for the input.
Note: implementations should block for input. Returning immediately is usually a bad idea, because the loop will be cycling.
addToHistory flag specifying whether the entered contents should be added to history
Returns:
content entered by the user. Returning null corresponds to an EOF and usually causes R to exit (as in q()</doce>).

Definition at line 458 of file Rengine.java.

References callback, DEBUG, jriWriteConsole(), org::rosuda::JRI::RMainLoopCallbacks::rReadConsole(), Rsync, org::rosuda::JRI::Mutex::safeLock(), and org::rosuda::JRI::Mutex::unlock().

    {
            if (DEBUG>1)
                  System.out.println("Rengine.jreReadConsole BEGIN "+Thread.currentThread());
        Rsync.unlock();
        String s=(callback==null)?null:callback.rReadConsole(this, prompt, addToHistory);
        if (!Rsync.safeLock()) {
            String es="\n>>JRI Warning: jriReadConsole detected a possible deadlock ["+Rsync+"]["+Thread.currentThread()+"]. Proceeding without lock, but this is inherently unsafe.\n";
            jriWriteConsole(es, 1);
            System.err.print(es);
        }
            if (DEBUG>1)
                  System.out.println("Rengine.jreReadConsole END "+Thread.currentThread());
        return s;
    }


Generated by  Doxygen 1.6.0   Back to index