org.hecl.misc
Class HeclUtils

java.lang.Object
  extended by org.hecl.misc.HeclUtils

public class HeclUtils
extends java.lang.Object


Field Summary
static java.lang.String PROMPT
           
static java.lang.String PROMPT2
           
 
Constructor Summary
HeclUtils()
           
 
Method Summary
static org.awt.Dimension getDimension(org.awt.Dimension dim, Thing[] argv, int pos)
           
static org.awt.geom.Point2D getPoint(org.awt.geom.Point2D p, Thing[] argv, int pos)
           
static byte[] getResourceAsBytes(java.lang.Class cl, java.lang.String resname)
           
static java.io.InputStream getResourceAsStream(java.lang.Class cl, java.lang.String resname)
           
static java.lang.String getResourceAsString(java.lang.Class cl, java.lang.String resname, java.lang.String encoding)
           
static java.lang.String hexdump(byte[] buf)
           
static void readEvalPrint(Interp ip, java.io.InputStream in, java.io.PrintStream out, java.io.PrintStream err)
           
static java.lang.String readLine(java.io.InputStreamReader is)
           
static int testArguments(Thing[] argv, int min, int max)
           
static boolean thing2bool(Thing thing)
           
static org.awt.Dimension thing2Dimension(Thing[] argv, int pos)
           
static int thing2int(Thing thing)
           
static int thing2int(Thing thing, boolean usedefault, int defaultvalue)
           
static int thing2len(Thing thing, int minlen)
           
static org.awt.geom.Point2D thing2Point(Thing[] argv, int pos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROMPT

public static java.lang.String PROMPT

PROMPT2

public static java.lang.String PROMPT2
Constructor Detail

HeclUtils

public HeclUtils()
Method Detail

testArguments

public static int testArguments(Thing[] argv,
                                int min,
                                int max)

thing2Point

public static org.awt.geom.Point2D thing2Point(Thing[] argv,
                                               int pos)
                                        throws HeclException
Throws:
HeclException

getPoint

public static org.awt.geom.Point2D getPoint(org.awt.geom.Point2D p,
                                            Thing[] argv,
                                            int pos)
                                     throws HeclException
Throws:
HeclException

thing2Dimension

public static org.awt.Dimension thing2Dimension(Thing[] argv,
                                                int pos)
                                         throws HeclException
Throws:
HeclException

getDimension

public static org.awt.Dimension getDimension(org.awt.Dimension dim,
                                             Thing[] argv,
                                             int pos)
                                      throws HeclException
Throws:
HeclException

thing2int

public static int thing2int(Thing thing)
                     throws HeclException
Throws:
HeclException

thing2int

public static int thing2int(Thing thing,
                            boolean usedefault,
                            int defaultvalue)
                     throws HeclException
Throws:
HeclException

thing2len

public static int thing2len(Thing thing,
                            int minlen)
                     throws HeclException
Throws:
HeclException

thing2bool

public static boolean thing2bool(Thing thing)
                          throws HeclException
Throws:
HeclException

readLine

public static java.lang.String readLine(java.io.InputStreamReader is)

getResourceAsStream

public static java.io.InputStream getResourceAsStream(java.lang.Class cl,
                                                      java.lang.String resname)

getResourceAsBytes

public static byte[] getResourceAsBytes(java.lang.Class cl,
                                        java.lang.String resname)
                                 throws java.io.IOException
Throws:
java.io.IOException

hexdump

public static java.lang.String hexdump(byte[] buf)

getResourceAsString

public static java.lang.String getResourceAsString(java.lang.Class cl,
                                                   java.lang.String resname,
                                                   java.lang.String encoding)
                                            throws java.io.IOException
Throws:
java.io.IOException

readEvalPrint

public static void readEvalPrint(Interp ip,
                                 java.io.InputStream in,
                                 java.io.PrintStream out,
                                 java.io.PrintStream err)