net.sf.cglib.util

Class StringSwitcher.Generator

public static class StringSwitcher.Generator extends AbstractClassGenerator

Constructor Summary
Generator()
Method Summary
StringSwitchercreate()
Generate the StringSwitcher.
voidgenerateClass(ClassVisitor v)
voidsetFixedInput(boolean fixedInput)
Configure how unknown String keys will be handled.
voidsetInts(int[] ints)
Set the array of integer results.
voidsetStrings(String[] strings)
Set the array of recognized Strings.

Constructor Detail

Generator

public Generator()

Method Detail

create

public StringSwitcher create()
Generate the StringSwitcher.

generateClass

public void generateClass(ClassVisitor v)

setFixedInput

public void setFixedInput(boolean fixedInput)
Configure how unknown String keys will be handled.

Parameters: fixedInput if false, an unknown key will be returned from Generator as -1; if true, the result will be undefined, and the resulting code will be faster

setInts

public void setInts(int[] ints)
Set the array of integer results.

Parameters: ints the array of integer results; must be the same length as the key array

See Also: Generator

setStrings

public void setStrings(String[] strings)
Set the array of recognized Strings.

Parameters: strings the array of String keys; must be the same length as the value array

See Also: Generator

Copyright (c) 2001 - Apache Software Foundation