input
stringlengths
10
828
output
stringlengths
5
107
public string decode string value throws decoder exception if value null return null try return decode text value catch unsupported encoding exception e throw new decoder exception e get message
decodes a base64 string into its original form
public object encode object value throws encoder exception if value null return null else if value instanceof string return encode string value else throw new encoder exception objects of type value get class get name cannot be encoded using bcodec
encodes an object into its base64 form using the default charset
public object decode object value throws decoder exception if value null return null else if value instanceof string return decode string value else throw new decoder exception objects of type value get class get name cannot be decoded using bcodec
decodes a base64 object into its original form
public object encode object p object throws encoder exception if p object null return null else if p object instanceof byte return encode byte p object else if p object instanceof string return encode string p object else throw new encoder exception objects of type p object get class get name cannot be quoted printable encoded
encodes an object into its quoted printable safe form
public string double metaphone string value return double metaphone value false
encode a value with double metaphone
public object decode object p object throws decoder exception if p object null return null else if p object instanceof byte return decode byte p object else if p object instanceof string return decode string p object else throw new decoder exception objects of type p object get class get name cannot be quoted printable decoded
decodes a quoted printable object into its original form
public string encode string p string string charset throws unsupported encoding exception if p string null return null return new string encode p string get bytes charset string encodings us ascii
encodes a string into its quoted printable form using the specified charset
public object encode object obj throws encoder exception if obj instanceof string throw new encoder exception double metaphone encode parameter is not of type string return double metaphone string obj
encode the value using double metaphone
public string encode string value return double metaphone value
encode the value using double metaphone
public object encode object p object throws encoder exception if p object instanceof java lang string throw new encoder exception parameter supplied to metaphone encode is not of type java lang string return metaphone string p object
encodes an object using the metaphone algorithm
public boolean is double metaphone equal string value1 string value2 return is double metaphone equal value1 value2 false
check if the double metaphone values of two code string code values
public string encode string p string return metaphone p string
encodes a string using the metaphone algorithm
public boolean is metaphone equal string str1 string str2 return metaphone str1 equals metaphone str2
tests is the metaphones of two strings are identical
public object encode object p object throws encoder exception if p object instanceof string throw new encoder exception parameter supplied to soundex encode is not of type java lang string return soundex string p object
encodes an object using the soundex algorithm
public int get max code len return this max code len
returns the max code len
public string encode string p string return soundex p string
encodes a string using the soundex algorithm
private char get mapping code string str int index char mapped char this map str char at index hw rule check if index 1 mapped char 0 char hw char str char at index 1 if h hw char w hw char char pre hwchar str char at index 2 char first code this map pre hwchar if first code mapped char h pre hwchar w pre hwchar return 0 return mapped char
used internally by the sound ex algorithm
public int get max length return this max length
returns the max length
private char map char ch int index ch a if index 0 index this get soundex mapping length throw new illegal argument exception the character is not mapped ch return this get soundex mapping index
maps the given upper case character to its soudex code
public void set max length int max length this max length max length
sets the max length
public void set max code len int max code len this max code len max code len
sets the max code len
private void set soundex mapping char soundex mapping this soundex mapping soundex mapping
sets the soundex mapping
public string soundex string str if str null return null str soundex utils clean str if str length 0 return str char out 0 0 0 0 char last mapped int incount 1 count 1 out 0 str char at 0 last get mapping code str 0 while incount str length count out length mapped get mapping code str incount if mapped 0 if mapped 0 mapped last out count mapped last mapped return new string out
retreives the soundex code for a given string object
public int difference string s1 string s2 throws encoder exception return soundex utils difference this s1 s2
returns the number of characters in the two encoded strings that are the
public object encode object p object throws encoder exception if p object instanceof java lang string throw new encoder exception parameter supplied to refined soundex encode is not of type java lang string return soundex string p object
encodes an object using the refined soundex algorithm
public string soundex string str if str null return null str soundex utils clean str if str length 0 return str string buffer s buf new string buffer s buf append str char at 0 char last current last for int i 0 i str length i current get mapping code str char at i if current last continue else if current 0 s buf append current last current return s buf to string
retreives the refined soundex code for a given string object
public boolean is printable int ch return ch this last printable
checks whether the specified character is printable or not
private boolean condition c0 string value int index if contains value index 4 chia return true else if index 1 return false else if is vowel char at value index 2 return false else if contains value index 1 3 ach return false else char c char at value index 2 return c i c e contains value index 2 6 bacher macher
complex condition 0 for c
private boolean condition ch0 string value int index if index 0 return false else if contains value index 1 5 harac haris contains value index 1 3 hor hym hia hem return false else if contains value 0 5 chore return false else return true
complex condition 0 for ch
private boolean condition ch1 string value int index return contains value 0 4 van von contains value 0 3 sch contains value index 2 6 orches archit orchid contains value index 2 1 t s contains value index 1 1 a o u e index 0 contains value index 2 1 l r n m b h f v w space index 1 value length 1
complex condition 1 for ch
private boolean condition l0 string value int index if index value length 3 contains value index 1 4 illo illa alle return true else if contains value index 1 2 as os contains value value length 1 1 a o contains value index 1 4 alle return true else return false
complex condition 0 for l
public void set encoding encoding info enc info encoding enc info get name encoding info enc info
sets the encoding for this output method with an code encoding info code
public encoding info get encoding info if encoding info null encoding info encodings get encoding info encoding return encoding info
returns an code encoding info code instance for the encoding
private boolean condition m0 string value int index if char at value index 1 m return true return contains value index 1 3 umb index 1 value length 1 contains value index 2 2 er
complex condition 0 for m
private boolean is slavo germanic string value return value index of w 1 value index of k 1 value index of cz 1 value index of witz 1
determines whether or not a value is of slavo germanic orgin
private boolean is vowel char ch return vowels index of ch 1
determines whether or not a character is a vowel or not
private boolean is silent start string value boolean result false for int i 0 i silent start length i if value starts with silent start i result true break return result
determines whether or not the value starts with a silent letter
private string clean input string input if input null return null input input trim if input length 0 return null return input to upper case
cleans the input
protected char char at string value int index if index 0 index value length return character min value return value char at index
gets the character at index code index code if available otherwise
public boolean is strict multiline parsing return strict multiline parsing
return whether strict multiline parsing is enabled as per rfx 959 section 4
public boolean get preserve empty attributes return preserve empty attributes
returns the preserve empty attribute flag
public void set preserve empty attributes boolean preserve preserve empty attributes preserve
sets the preserve empty attribute flag
public void set strict multiline parsing boolean strict multiline parsing this strict multiline parsing strict multiline parsing
set strict multiline parsing
public string get debug info return description
returns a string representation of this object useful for debugging purposes
public string to string return get debug info
returns a string representation of this object useful for debugging purposes
public source formatter set indent string final string indent string if indent string null throw new illegal argument exception indent string property must not be null this indent string indent string return this
sets the string to be used for indentation
public iterator get option element iterator overridden in select form control throw new unsupported operation exception only select controls contain option elements
returns an iterator over the
public form control output style get output style return output style
returns the current
public boolean is checked throw new unsupported operation exception this property is only relevant for checkbox and radio controls
indicates whether this form control is a target blank href http www
public string get predefined value return element container predefined value
returns the a target blank href http www
public source formatter set indent all elements final boolean indent all elements this indent all elements indent all elements return this
sets whether all elements are to be indented including
public collection get predefined values return get predefined value null collections singleton get predefined value collections empty set
returns a collection of all
public boolean get indent all elements return indent all elements
indicates whether all elements are to be indented including
public char sequence get source text return source text
returns the original source text upon which this output document is based
public void remove final segment segment register new remove output segment segment
removes the specified
public void remove final collection segments for iterator i segments iterator i has next remove segment i next
removes all the segments from this output document represented by the specified source
public void insert final int pos final char sequence text register new string output segment pos pos text
inserts the specified text at the specified character position in this output document
public void replace final segment segment final char sequence text replace segment get begin segment get end text
replaces the specified
public void replace final int begin final int end final char sequence text register new string output segment begin end text
replaces the specified segment of this output document with the specified text
public void replace final int begin final int end final char ch register new char output segment begin end ch
replaces the specified segment of this output document with the specified character
public void replace final form control form control form control replace in output document this
replaces the specified
public map replace final attributes attributes boolean convert names to lower case attributes output segment attributes output segment new attributes output segment attributes convert names to lower case register attributes output segment return attributes output segment get map
replaces the specified
public void register final output segment output segment output segments add output segment
registers the specified
public string to string return char stream source util to string this
returns the final content of this output document as a code string code
public list get registered output segments collections sort output segments output segment comparator return output segments
returns a list all of the
public segment get name segment final int name segment begin begin get tag type start delimiter prefix length return new segment source name segment begin name segment begin name length
returns the segment spanning the
public void set user data final object user data this user data user data
associates the specified general purpose user data object with this tag
public tag find next tag if next tag not cached next tag find next tag source begin 1 return next tag
returns the next tag in the source document
public tag find previous tag if previous tag not cached previous tag find previous tag source begin 1 return previous tag
returns the previous tag in the source document
public string get end tag name final string start tag name return is static get name prefix start tag name
returns the end tag
public string generate html final string start tag name return is static static string super generate html start tag name
generates the html text of an
public string get name return name segment to string
returns the name of this attribute in original case
public segment get name segment return name segment
returns the segment spanning the
public boolean has value return value segment null
indicates whether this attribute has a value
public segment get value segment return value segment
returns the segment spanning the
public segment get value segment including quotes return value segment including quotes
returns the segment spanning the
public char get quote char if value segment value segment including quotes return no quotes return source char at value segment including quotes get begin
returns the character used to quote the value
public string get debug info final string buffer sb new string buffer append key append super get debug info append name append name segment get debug info if has value sb append value append value segment get debug info append append value segment append append config new line else sb append no value append config new line return sb to string
returns a string representation of this object useful for debugging purposes
public text extractor set convert non breaking spaces boolean convert non breaking spaces this convert non breaking spaces convert non breaking spaces return this
sets whether non breaking space
public boolean get convert non breaking spaces return convert non breaking spaces
indicates whether non breaking space
public text extractor set include attributes boolean include attributes this include attributes include attributes return this
sets whether any attribute values are included in the output
public boolean get include attributes return include attributes
indicates whether any attribute values are included in the output
public boolean include attribute final start tag start tag final attribute attribute attribute include checker attribute include checker attribute include checker map get attribute get key if attribute include checker null return false return attribute include checker include attribute start tag attribute
indicates whether the value of the specified
public int get count return map size
returns the number of code form field code objects
public text extractor set exclude non htmlelements boolean exclude non htmlelements this exclude non htmlelements exclude non htmlelements return this
sets whether the content of a href htmlelements
public int size return get count
returns the number of code form field code objects
public boolean get exclude non htmlelements return exclude non htmlelements
indicates whether the content of a href htmlelements
public form field get string field name if config current compatibility mode is form field name case insensitive field name field name to lower case return form field map get field name
returns the code form field code with the specified
public boolean contains at final string str final int pos for int i 0 i str length i if str char at i text pos i return false return true
indicates whether this parse text contains the specified string at the specified position
public boolean exclude element final start tag start tag return false
indicates whether the text inside the
public iterator iterator return map values iterator
returns an iterator over the
public char char at final int index return text index
returns the character at the specified index
public list get values final string field name final form field form field get field name return form field null null form field get values
returns a list of the a href form field
public void clear values for final iterator i form controls iterator i has next form control i next clear values
clears the a href form control
public void set data set final map data set clear values if map null return for final iterator i data set entry set iterator i has next final map entry entry map entry i next final string field name entry get key to string final form field form field get field name if form field null if entry get value instanceof collection form field add values collection entry get value else form field add values char sequence entry get value
sets the a href form control
public int length return text length
returns the length of the parse text
public boolean set value final string field name final char sequence value final form field form field get field name return form field null false form field set value value
sets the a href form field
public string substring final int begin index final int end index return new string text begin index end index begin index
returns a new string that is a substring of this parse text
public char sequence sub sequence final int begin index final int end index return substring begin index end index
returns a new character sequence that is a subsequence of this sequence
public boolean add value final string field name final char sequence value final form field form field get field name return form field null false form field add value value
adds the specified value to the a href form field