Java Doc for U.java in  » Scripting » jscheme » jsint » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Scripting » jscheme » jsint 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   jsint.U

U
abstract public class U (Code)
A class to hold static utility methods; the name "U" stands for "Utility", but is short because it will be used a lot.
author:
   Peter Norvig, Copyright 1998, peter@norvig.com, license
author:
   subsequently modified by Jscheme project members
author:
   licensed under zlib licence (see license.txt)


Field Summary
final public static  Object[]EMPTY_ARGS
    
final public static  BooleanFALSE
     Same as Boolean.FALSE.
final public static  SymbolMISSING
     The value to use when a parameter is not supplied to a procedure.
final public static  Object[]NO_ARGS
     An argument list with zero arguments.
final public static  DoubleONE
     A Double with value 1.0.
final public static  BooleanTRUE
     Same as Boolean.TRUE.
final public static  SymbolUNDEFINED
     The value to return when a variable is not defined.
final public static  DoubleZERO
     A Double with value 0.0.
public static  booleanuseJavaSyntax
    


Method Summary
public static  Objectand1(Object x)
     One argument and used by (and) macro.
public static  Objectappend(Object args)
     args is a list of lists to be appended together.
public static  Objectapply(Procedure p, Pair args)
     R5RS apply as requested by "Hoehle, Joerg-Cyril" .
public static  PairarrayToList(Object x)
    
public static  ObjectcallCC(Procedure k)
     A continuation exception is a specially marked RuntimeException.
public static  ObjectcallWithInputFile(Object filename, Procedure proc)
    
public static  ObjectcallWithOutputFile(Object filename, Procedure proc)
    
public static  booleancheckNargs(int min, int max, int given, Object form)
     Check that the form has between min and max arguments (exclusive of the first element of the form).
public static  booleanequal(Object x, Object y)
     Structural equality.
public static  booleaneqv(Object x, Object y)
     Atomic equality.
public static  Objectfirst(Object x)
     Return the first element of a Pair, or error.
public static  longgcd(Pair args)
    
static  longgcd(long a, long b)
    
public static  booleanisFalse(Object x)
    
public static  booleanisList(Object x)
     Return true if x is a proper list: null-terminated and finite. Return false if it is an infinite or non-null-terminated list. Not to be confused with (or (pair? x) (null? x)).
public static  booleanisPair(Object x)
     Check if the argument is a non-empty list.
public static  booleanisVector(Object x)
    
static  longlcm(Object args)
    
public static  Pairlist(Object a, Object b, Object c)
     Creates a three element list.
public static  Pairlist(Object a, Object b)
     Creates a two element list.
public static  Pairlist(Object a)
     Creates a one element list.
public static  ObjectlistToArray(Class C, Object x)
    
public static  StringlistToString(Object chars)
     Convert a list of characters to a String.
public static  Object[]listToVector(Object x)
    
public static  StringmakeString(int size, Object fill)
    
public static  ObjectmakeVector(Object x)
    
public static  ObjectmakeVector(Object x, Object fill)
    
public static  Pairmap(Procedure proc, Object args, Pair result)
     Map proc over a list of lists of args. If result is a passed in as a Pair, then accumulate values there.
public static  ClassmaybeToClass(Object c)
    
public static  ObjectmemberAssoc(Object obj, Object list, boolean member, int eq)
    
public static  Booleannot(Object x)
     Returns TRUE if x is FALSE or null.
public static  ObjectnumCompute(Object x, Pair args, char op)
     Compute (x op arg1 op arg2 op ...), in ints or doubles.
public static  ObjectnumCompute(long result, Pair args, char op)
     Compute (result op arg1 op arg2 op ...).
public static  ObjectnumCompute(double result, Pair args, char op)
     Compute (result op arg1 op arg2 op ...).
public static  ObjectnumberToString(Object x, Object y)
    
public static  InputPortopenInputFile(Object filename)
     Opens a file, resource, or URL.
public static  PrintWriteropenOutputFile(Object filename)
    
public static  Objectp(String x, Object y)
     Used for debugging.
public static  Objectrest(Object x)
     Return the rest of a Pair, or error.
public static  Objectsecond(Object x)
     Return the second element of a list.
public static  StringstringAppend(Pair args)
    
public static  intstringCompareIgnoreCase(Object x, Object y)
     Return <0 if x is alphabetically first, >0 if y is first, 0 if same.
public static  ObjectstringToList(Object x)
    
public static  ObjectstringToNumber(Object x, Object y)
    
public static  StringBufferstringify(Object x, boolean quoted, StringBuffer buf)
     Convert a Scheme object to its printed representation, as a java String.
public static  Stringstringify(Object x)
     Convert x to a String giving its external representation.
public static  Stringstringify(Object x, boolean quoted)
     Convert x to a String giving its external representation.
public static  PairtimeCall(Procedure proc, int nTimes)
     Call the procedure repeatedly nTimes, and return a list of the the last result, the elapsed time, and the memory used.
public static  BooleantoBool(boolean x)
     Convert boolean to Boolean.
public static  BooleantoBool(Object x)
     Convert Scheme object to Boolean.
public static  CharactertoChar(char ch)
     Converts a char to a Character.
public static  ClasstoClass(Object c)
    
public static  InputPorttoInPort(Object x)
     Cast a Scheme object to a Scheme input port, which is an InputPort. If the argument is missing, returns Scheme.getInput().
public static  inttoInt(Object x)
     Converts a Scheme object to an int, or calls error.
public static  inttoInt(Object x, int defaultVal)
     Converts a Scheme object to an int, return the default if it is not possible to convert the object to an int.
public static  PairtoList(Object x)
     Cast a Scheme object to a Pair or the empty list.
public static  IntegertoNum(int i)
     Convert int to Integer.
public static  NumbertoNum(long i)
     Convert long to Number, either Integer or Long.
public static  DoubletoNum(double x)
     Convert double to Double.
public static  PrintWritertoOutPort(Object x)
     Cast a Scheme object to a Scheme input port, which is a PrintWriter. If the argument is missing, returns Scheme.getOutput().
public static  PairtoPair(Object x)
     Cast a Scheme object to a Pair (can't be the empty list).
public static  ProceduretoProc(Object x)
     Cast a Scheme object to a procedure, or call error.
public static  doubletoReal(Object x)
     Converts a Scheme object to a double, or calls error.
public static  StringtoStr(Object x)
     Cast a Scheme object to a String, or call error.
public static  SymboltoSym(Object x)
     Cast a Scheme object to a Scheme symbol, or call error.
public static  ObjecttoVec(Object x)
     Cast a Scheme object to a Scheme vector, or call error.
public static  booleanto_bool(Object x)
     Convert Scheme object to boolean.
public static  charto_char(Object x)
     Converts a Character to a char, or calls error for non-Characters.
public static  charto_lc_char(Object x)
     Converts a Character to a lowercase char, or calls error for non-Characters.
public static  ObjectvectorFill(Object vec, Object fill)
    
public static  ObjectvectorLength(Object x)
    
public static  ObjectvectorRef(Object x, Object y)
    
public static  ObjectvectorSet(Object x, Object y, Object z)
    
public static  PairvectorToList(Object vec)
    
public static  Objectwrite(Object x, PrintWriter port, boolean quoted)
     Write the object to a port.

Field Detail
EMPTY_ARGS
final public static Object[] EMPTY_ARGS(Code)



FALSE
final public static Boolean FALSE(Code)
Same as Boolean.FALSE. *



MISSING
final public static Symbol MISSING(Code)
The value to use when a parameter is not supplied to a procedure. *



NO_ARGS
final public static Object[] NO_ARGS(Code)
An argument list with zero arguments. *



ONE
final public static Double ONE(Code)
A Double with value 1.0. Defined here so that we need only one. *



TRUE
final public static Boolean TRUE(Code)
Same as Boolean.TRUE. *



UNDEFINED
final public static Symbol UNDEFINED(Code)
The value to return when a variable is not defined. *



ZERO
final public static Double ZERO(Code)
A Double with value 0.0. Defined here so that we need only one. *



useJavaSyntax
public static boolean useJavaSyntax(Code)
a flag which specifies whether Java (or Scheme) syntax should be used when printing Scheme terms





Method Detail
and1
public static Object and1(Object x)(Code)
One argument and used by (and) macro. *



append
public static Object append(Object args)(Code)
args is a list of lists to be appended together. *



apply
public static Object apply(Procedure p, Pair args)(Code)
R5RS apply as requested by "Hoehle, Joerg-Cyril" . We splice the last argument onto the end of the argument list.



arrayToList
public static Pair arrayToList(Object x)(Code)



callCC
public static Object callCC(Procedure k)(Code)
A continuation exception is a specially marked RuntimeException. *



callWithInputFile
public static Object callWithInputFile(Object filename, Procedure proc)(Code)



callWithOutputFile
public static Object callWithOutputFile(Object filename, Procedure proc)(Code)



checkNargs
public static boolean checkNargs(int min, int max, int given, Object form)(Code)
Check that the form has between min and max arguments (exclusive of the first element of the form). If the form has the wrong number of arguments, then complain. *



equal
public static boolean equal(Object x, Object y)(Code)
Structural equality. *



eqv
public static boolean eqv(Object x, Object y)(Code)
Atomic equality. *



first
public static Object first(Object x)(Code)
Return the first element of a Pair, or error. *



gcd
public static long gcd(Pair args)(Code)



gcd
static long gcd(long a, long b)(Code)



isFalse
public static boolean isFalse(Object x)(Code)
#f and #null are treated as false *



isList
public static boolean isList(Object x)(Code)
Return true if x is a proper list: null-terminated and finite. Return false if it is an infinite or non-null-terminated list. Not to be confused with (or (pair? x) (null? x)). *



isPair
public static boolean isPair(Object x)(Code)
Check if the argument is a non-empty list. *



isVector
public static boolean isVector(Object x)(Code)



lcm
static long lcm(Object args)(Code)



list
public static Pair list(Object a, Object b, Object c)(Code)
Creates a three element list. *



list
public static Pair list(Object a, Object b)(Code)
Creates a two element list. *



list
public static Pair list(Object a)(Code)
Creates a one element list. *



listToArray
public static Object listToArray(Class C, Object x)(Code)



listToString
public static String listToString(Object chars)(Code)
Convert a list of characters to a String. *



listToVector
public static Object[] listToVector(Object x)(Code)



makeString
public static String makeString(int size, Object fill)(Code)



makeVector
public static Object makeVector(Object x)(Code)



makeVector
public static Object makeVector(Object x, Object fill)(Code)



map
public static Pair map(Procedure proc, Object args, Pair result)(Code)
Map proc over a list of lists of args. If result is a passed in as a Pair, then accumulate values there. Otherwise, just return the empty list. *



maybeToClass
public static Class maybeToClass(Object c)(Code)



memberAssoc
public static Object memberAssoc(Object obj, Object list, boolean member, int eq)(Code)



not
public static Boolean not(Object x)(Code)
Returns TRUE if x is FALSE or null. *



numCompute
public static Object numCompute(Object x, Pair args, char op)(Code)
Compute (x op arg1 op arg2 op ...), in ints or doubles. *



numCompute
public static Object numCompute(long result, Pair args, char op)(Code)
Compute (result op arg1 op arg2 op ...). Return the result as an Object, but along the way, use result (a long) as an accumulator of the result so far. For compare ops, returns FALSE for false, and a number for true. *



numCompute
public static Object numCompute(double result, Pair args, char op)(Code)
Compute (result op arg1 op arg2 op ...). Return the result as an Object, but along the way, use result (a double) as an accumulator of the result so far. For compare ops, returns FALSE for false, and a number for true. *



numberToString
public static Object numberToString(Object x, Object y)(Code)



openInputFile
public static InputPort openInputFile(Object filename)(Code)
Opens a file, resource, or URL. Returns null if unsuccessful.*



openOutputFile
public static PrintWriter openOutputFile(Object filename)(Code)



p
public static Object p(String x, Object y)(Code)
Used for debugging. *



rest
public static Object rest(Object x)(Code)
Return the rest of a Pair, or error. *



second
public static Object second(Object x)(Code)
Return the second element of a list. *



stringAppend
public static String stringAppend(Pair args)(Code)



stringCompareIgnoreCase
public static int stringCompareIgnoreCase(Object x, Object y)(Code)
Return <0 if x is alphabetically first, >0 if y is first, 0 if same. Case insensitive iff ci is true. Error if not strings. NOTE: In Java 2, just use String.CompareIgnorecase. But that method is missing in Java 1.0 and 1.1. *



stringToList
public static Object stringToList(Object x)(Code)



stringToNumber
public static Object stringToNumber(Object x, Object y)(Code)



stringify
public static StringBuffer stringify(Object x, boolean quoted, StringBuffer buf)(Code)
Convert a Scheme object to its printed representation, as a java String. If quoted is true, use "str" and #\c, otherwise use str and c. You need to pass in a StringBuffer that is used to accumulate the results. (If the interface didn't work that way, the system would use lots of little internal StringBuffers. But note that you can still call stringify(x) and a new StringBuffer will be created for you. If useJavaSyntax is true, then literals are printed using a Java syntax



stringify
public static String stringify(Object x)(Code)
Convert x to a String giving its external representation. Strings and characters are quoted. *



stringify
public static String stringify(Object x, boolean quoted)(Code)
Convert x to a String giving its external representation. Strings and characters are quoted iff quoted is true.. *



timeCall
public static Pair timeCall(Procedure proc, int nTimes)(Code)
Call the procedure repeatedly nTimes, and return a list of the the last result, the elapsed time, and the memory used. *



toBool
public static Boolean toBool(boolean x)(Code)
Convert boolean to Boolean. *



toBool
public static Boolean toBool(Object x)(Code)
Convert Scheme object to Boolean. *



toChar
public static Character toChar(char ch)(Code)
Converts a char to a Character. Caches low-numbered chars. *



toClass
public static Class toClass(Object c)(Code)



toInPort
public static InputPort toInPort(Object x)(Code)
Cast a Scheme object to a Scheme input port, which is an InputPort. If the argument is missing, returns Scheme.getInput(). *



toInt
public static int toInt(Object x)(Code)
Converts a Scheme object to an int, or calls error. *



toInt
public static int toInt(Object x, int defaultVal)(Code)
Converts a Scheme object to an int, return the default if it is not possible to convert the object to an int. *



toList
public static Pair toList(Object x)(Code)
Cast a Scheme object to a Pair or the empty list. *



toNum
public static Integer toNum(int i)(Code)
Convert int to Integer. Caches small ints so that we only ever make one copy of new Integer(0), new Integer(1), etc. *



toNum
public static Number toNum(long i)(Code)
Convert long to Number, either Integer or Long. *



toNum
public static Double toNum(double x)(Code)
Convert double to Double. Caches 0 and 1; makes new for others. *



toOutPort
public static PrintWriter toOutPort(Object x)(Code)
Cast a Scheme object to a Scheme input port, which is a PrintWriter. If the argument is missing, returns Scheme.getOutput(). *



toPair
public static Pair toPair(Object x)(Code)
Cast a Scheme object to a Pair (can't be the empty list). *



toProc
public static Procedure toProc(Object x)(Code)
Cast a Scheme object to a procedure, or call error. *



toReal
public static double toReal(Object x)(Code)
Converts a Scheme object to a double, or calls error. *



toStr
public static String toStr(Object x)(Code)
Cast a Scheme object to a String, or call error. *



toSym
public static Symbol toSym(Object x)(Code)
Cast a Scheme object to a Scheme symbol, or call error. *



toVec
public static Object toVec(Object x)(Code)
Cast a Scheme object to a Scheme vector, or call error. *



to_bool
public static boolean to_bool(Object x)(Code)
Convert Scheme object to boolean. *



to_char
public static char to_char(Object x)(Code)
Converts a Character to a char, or calls error for non-Characters. *



to_lc_char
public static char to_lc_char(Object x)(Code)
Converts a Character to a lowercase char, or calls error for non-Characters. *



vectorFill
public static Object vectorFill(Object vec, Object fill)(Code)



vectorLength
public static Object vectorLength(Object x)(Code)



vectorRef
public static Object vectorRef(Object x, Object y)(Code)



vectorSet
public static Object vectorSet(Object x, Object y, Object z)(Code)



vectorToList
public static Pair vectorToList(Object vec)(Code)



write
public static Object write(Object x, PrintWriter port, boolean quoted)(Code)
Write the object to a port. If quoted is true, use "str" and #\c, otherwise use str and c. *



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.