Compiere Looks 1.2.1

org.compiere.util
Class Util

java.lang.Object
  |
  +--org.compiere.util.Util

public class Util
extends Object

General Utilities

Version:
$Id: Util.java,v 1.10 2003/03/10 05:36:52 jjanke Exp $
Author:
Jorg Janke

Constructor Summary
Util()
           
 
Method Summary
static void dump(Map map)
          Dump a Map (key=value) to out
static int findIndexOf(String str, char search)
          Find index of search character in str.
static int findIndexOf(String str, char search1, char search2)
          Find index of search characters in str.
static int findIndexOf(String str, String search)
          Find index of search character in str.
static int getCount(String string, char countChar)
          Get the number of occurances of countChar in string.
static AttributedCharacterIterator getIterator(AttributedString aString, AttributedCharacterIterator.Attribute[] relevantAttributes)
          Return a Iterator with only the relevant attributes.
static String initCap(String in)
          Init Cap Words With Spaces
static void main(String[] args)
          Test
static String maskHTML(String content)
          Mask HTML content.
static String removeCRLF(String in)
          Remove CR / LF from String
static String replace(String value, String oldPart, String newPart)
          Replace String values.
static String toHex(byte b)
          Return Hex String representation of byte b
static String toHex(char c)
          Return Hex String representation of char c
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

replace

public static String replace(String value,
                             String oldPart,
                             String newPart)
Replace String values.

Parameters:
value - string to be processed
oldPart - old part
newPart - replacement
Returns:
String with replaced values

removeCRLF

public static String removeCRLF(String in)
Remove CR / LF from String

Parameters:
in - input
Returns:
cleaned string

maskHTML

public static String maskHTML(String content)
Mask HTML content. i.e. replace characters with &values;

Parameters:
content - content
Returns:
masked content

getCount

public static int getCount(String string,
                           char countChar)
Get the number of occurances of countChar in string.

Parameters:
string - String to be searched
countChar - to be counted character
Returns:
number of occurances

findIndexOf

public static int findIndexOf(String str,
                              char search)
Find index of search character in str. This ignores content in () and 'texts'

Parameters:
str - string
search - search character
Returns:
index or -1 if not found

findIndexOf

public static int findIndexOf(String str,
                              char search1,
                              char search2)
Find index of search characters in str. This ignores content in () and 'texts'

Parameters:
str - string
search1 - first search character
search2 - second search character (or)
Returns:
index or -1 if not found

findIndexOf

public static int findIndexOf(String str,
                              String search)
Find index of search character in str. This ignores content in () and 'texts'

Parameters:
str - string
search - search character
Returns:
index or -1 if not found

toHex

public static String toHex(byte b)
Return Hex String representation of byte b

Parameters:
b - byte
Returns:
Hex

toHex

public static String toHex(char c)
Return Hex String representation of char c

Parameters:
c - character
Returns:
Hex

initCap

public static String initCap(String in)
Init Cap Words With Spaces

Parameters:
in - string
Returns:
init cap

getIterator

public static AttributedCharacterIterator getIterator(AttributedString aString,
                                                      AttributedCharacterIterator.Attribute[] relevantAttributes)
Return a Iterator with only the relevant attributes. Fixes implementation in AttributedString, which returns everything

Parameters:
aString - attributed string
relevantAttributes - relevant attributes
Returns:
iterator

dump

public static void dump(Map map)
Dump a Map (key=value) to out

Parameters:
map - Map

main

public static void main(String[] args)
Test

Parameters:
args - args

Compiere Looks 1.2.1

Copyright (c) 1999-2003 ComPiere, Inc. - Author: Jorg Janke