| Home >> All >> com >> jplanet >> [ xsldb Javadoc ] |
Source code: com/jplanet/xsldb/IOIndiv.java
1 /* 2 * (c) Copyright 2002 Christian Gehrke. 3 * All Rights Reserved. 4 */ 5 package com.jplanet.xsldb; 6 7 import java.io.*; 8 9 /** 10 * This class handles Input & Output streams. There shall be no others. 11 * @version 1.0 12 * @author Chris Gehrke 13 */ 14 public class IOIndiv { 15 16 /** 17 * Singleton Instance. 18 */ 19 private IOIndiv () {} 20 21 22 protected static void print (String str) { 23 24 System.out.print (str); 25 } 26 27 protected static void println (String str) { 28 29 System.out.println(str); 30 } 31 32 33 /** 34 * Prompt for user command. 35 * Finish input with <CR>. 36 */ 37 protected static String readln (String commandStr) { 38 39 print (commandStr); 40 String in = null; 41 try { 42 in = brin.readLine(); 43 } catch (Exception ex) { 44 45 } 46 return in; 47 } 48 49 50 /** 51 * Prompt for user command. 52 * Finish input with <CR>. 53 */ 54 protected static String readln () { 55 56 print ("[CMD:/] "); 57 String in = null; 58 try { 59 in = brin.readLine(); 60 } catch (Exception ex) { 61 62 } 63 return in; 64 } 65 66 protected static final BufferedReader brin= new BufferedReader(new InputStreamReader(System.in)); 67 }