Java Doc for Util.java in  » Ajax » Laszlo-4.0.10 » org » openlaszlo » iv » flash » util » 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 » Ajax » Laszlo 4.0.10 » org.openlaszlo.iv.flash.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.openlaszlo.iv.flash.util.Util

Util
public class Util (Code)
Utility class.
author:
   Dmitry Skavish


Field Summary
public static  charfileSeparator
    
public static  StringgenVersion
    
public static  doublejavaVersion
    
public static  StringlineSeparator
    
public static  charpathSeparator
    


Method Summary
public static  Stringb2h(int v)
    
public static  StringconcatFileNames(String path, String name)
     Returns concatenation of path and filename.
public static  Stringd2h(int v)
    
public static  StringdecodeURLEncoded(String s)
    
public static  intdouble2fixed(double value)
    
public static  intdouble2twips(double value)
    
public static  voiddump(byte[] buffer, int start, int size, PrintStream out)
    
public static  StringexecuteJSFile(Context context, String fileName, String[] parms)
    
public static  StringexecuteJSString(Context context, String js_text, String[] parms)
    
public static  doublefixed2double(int value)
    
public static  floatfixed2float(int value)
    
public static  intfloat2fixed(float value)
    
public static  intfloat2twips(float value)
    
public static  LineReadergetArrayReader(FlashFile file, byte[] buf, int offset, int length)
    
public static  intgetDWord(byte a, byte b, byte c, byte d)
     Creates signed dword from four bytes.
public static  LineReadergetInputStreamReader(InputStream is, String encoding)
    
public static  StringgetInstallDir()
    
public static  intgetMax(int[] arr, int size)
     Returns maximum element of array.
public static  intgetMax(int[] arr)
     Returns maximum element of array.
public static  intgetMax(int a, int b)
     Returns maximum of absolute values of two numbers.
public static  intgetMax(int a, int b, int c)
     Returns maximum of absolute values of three numbers.
public static  intgetMax(int a, int b, int c, int d)
     Returns maximum of absolute values of four numbers.
public static  intgetMinBitsS(int v)
     Returns number of significant bits for signed integer.
public static  intgetMinBitsU(int v)
     Returns number of significant bits for unsigned integer.
public static  URLgetResource(String resource)
    
public static  FilegetSysFile(String name)
     Returns jgenerator file by its name.
public static  intgetUByte(byte a)
     Converts byte to unsigned byte.
public static  intgetUDWord(byte a, byte b, byte c, byte d)
     Creates unsigned dword from four bytes.
public static  intgetUWord(byte a, byte b)
     Creates unsigned word from two bytes.
public static  LineReadergetUrlReader(FlashFile file, IVUrl url)
    
public static  StringgetVersion()
     Returns version of JGenerator.
public static  intgetWord(byte a, byte b)
     Creates signed word from two bytes.
public static  booleanhasVar(String s)
     Returns whether specified string has generator variable or not.
public static  voidinit()
    
public static  voidinit(String installDir, String propFileName)
     Initialize JGenerator.
public static  voidinit(String installDir)
     Initialize JGenerator.
public static  booleanisDefault(String s)
    
public static  ObjectnewInstance(String className, Class[] parmsCls, Object[] parms)
    
public static  HashtableparseUrlParms(String s, int idx)
    
public static  StringprocessEscapes(String line)
     Processes escapes in the specified string.

Escapes to be processed:

  • \n - newline
  • \r - carriage return
  • \0x...
public static  FlashBufferreadUrl(IVUrl url)
     Reads data from specified url into FlashBuffer.
public static  booleantoBool(String v, boolean def)
     Converts specified string to boolean.
public static  AlphaColortoColor(String v, AlphaColor def)
     Converts specified string to color.
public static  doubletoDouble(String v, double def)
     Converts specified string to double.
public static  inttoInt(String v, int def)
     Converts specified string to int.
public static  longtoLong(String v, long def)
     Converts specified string to long.
public static  chartoPrint(char ch)
    
public static  URLtoURL(File file)
     Creates URL from specified file.
public static  StringtranslatePath(String path)
     Translates file separator in the specified string into file separator of the system jgenerator is running on.
public static  doubletwips2double(int value)
    
public static  floattwips2float(int value)
    
public static  Stringw2h(int v)
    

Field Detail
fileSeparator
public static char fileSeparator(Code)



genVersion
public static String genVersion(Code)



javaVersion
public static double javaVersion(Code)



lineSeparator
public static String lineSeparator(Code)



pathSeparator
public static char pathSeparator(Code)





Method Detail
b2h
public static String b2h(int v)(Code)
Returns hexadecimal representation of specified byte
Parameters:
  v - specified byte hex repsentation of specified byte



concatFileNames
public static String concatFileNames(String path, String name)(Code)
Returns concatenation of path and filename.
Parameters:
  path - path
Parameters:
  name - filename concatenation of specified path and specified filename



d2h
public static String d2h(int v)(Code)
Returns hexadecimal representation of specified dword
Parameters:
  v - specified dword hex repsentation of specified dword



decodeURLEncoded
public static String decodeURLEncoded(String s)(Code)
Decodes url-encoded string
Parameters:
  s - url-encoded string decoded string



double2fixed
public static int double2fixed(double value)(Code)
Converts double to fixed value
Parameters:
  value - double value fixed value



double2twips
public static int double2twips(double value)(Code)
Converts double to twips
Parameters:
  value - double value twips value



dump
public static void dump(byte[] buffer, int start, int size, PrintStream out)(Code)
Prints hex dump of part of byte array to specified stream
Parameters:
  buffer - buffer to be dumped
Parameters:
  start - offset in the buffer to start the dump from
Parameters:
  size - size of the dumped area
Parameters:
  out - stream to print the dump to



executeJSFile
public static String executeJSFile(Context context, String fileName, String[] parms)(Code)
Executes specified javascript file in given Context
Parameters:
  context - specified context
Parameters:
  js_text - javascript text
Parameters:
  parms - parameters for javascript result of "printing" in javascript



executeJSString
public static String executeJSString(Context context, String js_text, String[] parms)(Code)
Executes specified javascript text in given Context
Parameters:
  context - specified context
Parameters:
  js_text - javascript text
Parameters:
  parms - parameters for javascript result of "printing" in javascript



fixed2double
public static double fixed2double(int value)(Code)
Converts fixed Flash value into double
Parameters:
  value - fixed Flash value double value



fixed2float
public static float fixed2float(int value)(Code)
Converts fixed Flash value into float
Parameters:
  value - fixed Flash value float value



float2fixed
public static int float2fixed(float value)(Code)
Converts float to fixed value
Parameters:
  value - float value fixed value



float2twips
public static int float2twips(float value)(Code)
Converts float to twips
Parameters:
  value - float value twips value



getArrayReader
public static LineReader getArrayReader(FlashFile file, byte[] buf, int offset, int length) throws IOException(Code)
Returns Reader of specified String using encoding from specified FlashFile
Parameters:
  file - file
Parameters:
  buf - buffer
Parameters:
  offset - offset in the buffer
Parameters:
  length - buffer length reader
exception:
  IOException -



getDWord
public static int getDWord(byte a, byte b, byte c, byte d)(Code)
Creates signed dword from four bytes.
Parameters:
  a - 0 byte (low)
Parameters:
  b - 1 byte
Parameters:
  c - 2 byte
Parameters:
  d - 3 byte (high) signed dword



getInputStreamReader
public static LineReader getInputStreamReader(InputStream is, String encoding) throws IOException(Code)
Returns BufferedReader of specified InputStream and encoding
Parameters:
  is - input stream
Parameters:
  encoding - encoding (may be null) reader



getInstallDir
public static String getInstallDir()(Code)
Returns directory where jgenerator is installed directory where jgenerator is installed



getMax
public static int getMax(int[] arr, int size)(Code)
Returns maximum element of array.
Parameters:
  arr - array to be searched for maximum
Parameters:
  size - size of the array maximim element of the array



getMax
public static int getMax(int[] arr)(Code)
Returns maximum element of array.
Parameters:
  arr - array to be searched for maximum maximim element of the array



getMax
public static int getMax(int a, int b)(Code)
Returns maximum of absolute values of two numbers.
Parameters:
  a - specified number
Parameters:
  b - specified number maximum of two numbers



getMax
public static int getMax(int a, int b, int c)(Code)
Returns maximum of absolute values of three numbers.
Parameters:
  a - specified number
Parameters:
  b - specified number
Parameters:
  c - specified number maximum of three numbers



getMax
public static int getMax(int a, int b, int c, int d)(Code)
Returns maximum of absolute values of four numbers.
Parameters:
  a - specified number
Parameters:
  b - specified number
Parameters:
  c - specified number
Parameters:
  d - specified number maximum of four specified numbers



getMinBitsS
public static int getMinBitsS(int v)(Code)
Returns number of significant bits for signed integer.
Parameters:
  v - signed integer number of significant bits for signed integer



getMinBitsU
public static int getMinBitsU(int v)(Code)
Returns number of significant bits for unsigned integer.
Parameters:
  v - unsigned integer number of significant bits for unsigned integer



getResource
public static URL getResource(String resource)(Code)
Gets resource's URL
Parameters:
  resource - resource name resource URL



getSysFile
public static File getSysFile(String name)(Code)
Returns jgenerator file by its name.

If name is relative returns absolute path constructing with Util.installDir and the specified name
Parameters:
  name - file name jgenerator absolute file




getUByte
public static int getUByte(byte a)(Code)
Converts byte to unsigned byte.



getUDWord
public static int getUDWord(byte a, byte b, byte c, byte d)(Code)
Creates unsigned dword from four bytes.
Parameters:
  a - 0 byte (low)
Parameters:
  b - 1 byte
Parameters:
  c - 2 byte
Parameters:
  d - 3 byte (high) unsigned dword



getUWord
public static int getUWord(byte a, byte b)(Code)
Creates unsigned word from two bytes.
Parameters:
  a - low byte
Parameters:
  b - high byte unsigned word



getUrlReader
public static LineReader getUrlReader(FlashFile file, IVUrl url) throws IOException(Code)
Returns Reader of specified IVUrl using encoding either from specified IVUrl or specified FlashFile
Parameters:
  file - file
Parameters:
  url - url Reader



getVersion
public static String getVersion()(Code)
Returns version of JGenerator. version of JGenerator



getWord
public static int getWord(byte a, byte b)(Code)
Creates signed word from two bytes.
Parameters:
  a - low byte
Parameters:
  b - high byte signed word



hasVar
public static boolean hasVar(String s)(Code)
Returns whether specified string has generator variable or not.
Parameters:
  s - string to be searched for generator variable true if the specified string has generator variable



init
public static void init()(Code)
Initialize JGenerator

Usually you need to call this method from standalone applications only




init
public static void init(String installDir, String propFileName)(Code)
Initialize JGenerator.

Sets installation directory and reads and caches some basic properties and iv.properties file
Parameters:
  installDir - jgenerator installation directory
Parameters:
  propFileName - iv.properties file name




init
public static void init(String installDir)(Code)
Initialize JGenerator.

Sets installation directory and reads and caches some basic properties and iv.properties file
Parameters:
  installDir - jgenerator installation directory




isDefault
public static boolean isDefault(String s)(Code)
Returns true if the specified string is "default" in some language
Parameters:
  s - string to be tested for "default" true if the specified string is "default"



newInstance
public static Object newInstance(String className, Class[] parmsCls, Object[] parms) throws Exception(Code)
Creates new instance of an specified class
Parameters:
  className - specified class name
Parameters:
  parmsCls - parameters types of constructor
Parameters:
  parms - parameters of constructor new instance
exception:
  Exception -



parseUrlParms
public static Hashtable parseUrlParms(String s, int idx)(Code)
Parses parameters of url-string begining after the specified index (usually index of '?')

Parameters are pairs: name=value, separated by ampersand
Parameters:
  s - url
Parameters:
  idx - specified index hashtable of parameter
exception:
  IVException -




processEscapes
public static String processEscapes(String line)(Code)
Processes escapes in the specified string.

Escapes to be processed:

  • \n - newline
  • \r - carriage return
  • \0x... - hex value
  • \0... - octal value

Parameters:
  line - string to be processed escape-processed string



readUrl
public static FlashBuffer readUrl(IVUrl url) throws IOException(Code)
Reads data from specified url into FlashBuffer.
Parameters:
  url - IVUrl to read from FlashBuffer with data read
exception:
  IOException -



toBool
public static boolean toBool(String v, boolean def)(Code)
Converts specified string to boolean.
Parameters:
  v - string to be converted
Parameters:
  def - default value to be used if there are some problems during conversion boolean value



toColor
public static AlphaColor toColor(String v, AlphaColor def)(Code)
Converts specified string to color.
Parameters:
  v - string to be converted
Parameters:
  def - default value to be used if there are some problems during conversion color



toDouble
public static double toDouble(String v, double def)(Code)
Converts specified string to double.
Parameters:
  v - string to be converted
Parameters:
  def - default value to be used if there are some problems during conversion double value



toInt
public static int toInt(String v, int def)(Code)
Converts specified string to int.
Parameters:
  v - string to be converted
Parameters:
  def - default value to be used if there are some problems during conversion int value



toLong
public static long toLong(String v, long def)(Code)
Converts specified string to long.
Parameters:
  v - string to be converted
Parameters:
  def - default value to be used if there are some problems during conversion long value



toPrint
public static char toPrint(char ch)(Code)
Returns specified char if it's printable or '.'
Parameters:
  ch - char to be converted to printable char printable char



toURL
public static URL toURL(File file) throws MalformedURLException(Code)
Creates URL from specified file.
Parameters:
  file - file to be used to create URL created URL from File
exception:
  MalformedURLException -



translatePath
public static String translatePath(String path)(Code)
Translates file separator in the specified string into file separator of the system jgenerator is running on.
Parameters:
  path - path to be translated translated path



twips2double
public static double twips2double(int value)(Code)
Converts twips to double
Parameters:
  value - twips value double value



twips2float
public static float twips2float(int value)(Code)
Converts twips to float
Parameters:
  value - twips value float value



w2h
public static String w2h(int v)(Code)
Returns hexadecimal representation of specified word
Parameters:
  v - specified word hex repsentation of specified word



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.