org.exolab.javasource

Class JEnum

public final class JEnum extends JClass

Describes the definition of a enum type class.

Author: Andrew Fawcett

Constructor Summary
protected JEnum(String name)
Method Summary
voidaddConstant(JEnumConstant jConstant)
Adds the given JEnumConstant to this JEnum.
voidaddMember(JMember jMember)
Adds the given JMember to this JEnum.
JEnumConstantgetConstant(String name)
Returns the member with the given name, or null if no member was found with the given name.
JEnumConstant[]getConstants()
Returns an array of all the JEnumConstant of this JEnum.
static voidmain(String[] args)
Test drive.
voidprint(JSourceWriter jsw)
Prints the source code for this JEnum to the given JSourceWriter.
voidsetSuperClass(String superClass)

Constructor Detail

JEnum

protected JEnum(String name)

Parameters: name the name for this JEnum

Method Detail

addConstant

public void addConstant(JEnumConstant jConstant)
Adds the given JEnumConstant to this JEnum.

Parameters: jConstant the constant to add

addMember

public void addMember(JMember jMember)
Adds the given JMember to this JEnum.

Parameters: jMember the JMember to add

getConstant

public JEnumConstant getConstant(String name)
Returns the member with the given name, or null if no member was found with the given name.

Parameters: name the name of the member to return

Returns: the member with the given name, or null if no member was found with the given name.

getConstants

public JEnumConstant[] getConstants()
Returns an array of all the JEnumConstant of this JEnum.

Returns: an array of all the JEnumConstant of this JEnum.

main

public static void main(String[] args)
Test drive.

Parameters: args command-line arguments.

print

public void print(JSourceWriter jsw)
Prints the source code for this JEnum to the given JSourceWriter.

Parameters: jsw the JSourceWriter to print to. Must not be null.

setSuperClass

public void setSuperClass(String superClass)

See Also: {@inheritDoc }

Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com