org.acm.seguin.summary
Class Summary

java.lang.Object
  extended by org.acm.seguin.summary.Summary
All Implemented Interfaces:
java.io.Serializable, net.sourceforge.jrefactory.ast.ModifierHolder
Direct Known Subclasses:
FieldAccessSummary, FileSummary, ImportSummary, MessageSendSummary, MethodSummary, PackageSummary, TypeDeclSummary, TypeSummary, VariableSummary

public abstract class Summary
extends java.lang.Object
implements net.sourceforge.jrefactory.ast.ModifierHolder, java.io.Serializable

Basic summary class. Provides a single point for a visitor to encounter and a parent summary. All summaries have a parent except package summaries.

Author:
Chris Seguin
See Also:
Serialized Form

Field Summary
protected  int modifiers
           
 
Fields inherited from interface net.sourceforge.jrefactory.ast.ModifierHolder
ABSTRACT, EXPLICIT, FINAL, INTERFACE, names, NATIVE, PRIVATE, PROTECTED, PUBLIC, STATIC, STRICTFP, SYNCHRONIZED, TRANSIENT, VOLATILE
 
Constructor Summary
Summary(Summary initParent)
          Create a summary object
 
Method Summary
 java.lang.Object accept(SummaryVisitor visitor, java.lang.Object data)
          Provide method to visit a node
 void addModifier(java.lang.String mod)
          Add a modifier
 void copyModifiers(net.sourceforge.jrefactory.ast.ModifierHolder source)
          Copies the modifiers from another source
 int getDeclarationLine()
          Gets the DeclarationLine attribute of the MethodSummary object
 int getEndLine()
          Gets the EndLine attribute of the Summary object
 int getModifiers()
          Gets the modifier bits
 java.lang.String getModifiersString(int code)
          Returns a string containing all the modifiers
abstract  java.lang.String getName()
          Returns the name
 Summary getParent()
          Return the parent object
 int getStartLine()
          Gets the StartLine attribute of the Summary object
 boolean isAbstract()
          Determine if the object is abstract
 boolean isExplicit()
          Determine if the object is explicit
 boolean isFinal()
          Determine if the object is final
 boolean isInterface()
          Determine if the object is interface
 boolean isNative()
          Determine if the object is native
 boolean isPackage()
          Determines if this has package scope
 boolean isPrivate()
          Determine if the object is private
 boolean isProtected()
          Determine if the object is protected
 boolean isPublic()
          Determine if the object is public
 boolean isStatic()
          Determine if the object is static
 boolean isStrictFP()
          Determine if the object is strictFP
 boolean isSynchronized()
          Determine if the object is synchronized
 boolean isTransient()
          Determine if the object is transient
 boolean isVolatile()
          Determine if the object is volatile
 void setAbstract()
          Sets the abstract bit (to true) in the modifiers
 void setAbstract(boolean value)
          Sets the abstract bit in the modifiers
protected  void setCode(boolean value, int code)
          Sets or resets a single bit in the modifiers
protected  void setEndLine(int value)
          Sets the EndLine attribute of the Summary object
 void setFinal()
          Sets the Final bit (to true) of the in the modifiers
 void setModifiers(int modifiers)
          Sets the modifier bits
 void setPrivate()
          Sets the private bit (to true) in the modifiers
 void setPrivate(boolean value)
          Sets the private bit in the modifiers
 void setProtected()
          Sets the protected bit (to true) in the modifiers
 void setProtected(boolean value)
          Sets the protected bit in the modifiers
 void setPublic()
          Sets the public bit (to true) in the modifiers
 void setPublic(boolean value)
          Sets the public bit in the modifiers
protected  void setStartLine(int value)
          Sets the StartLine attribute of the Summary object
 void setStatic()
          Sets the Static bit (to true) in the modifiers
 void setStatic(boolean value)
          Sets the Static bit in the modifiers
 void setStrict()
          Sets the StrictFP bit (to true) of the in the modifiers
 void setSynchronized()
          Sets the Synchronized bit (to true) in the modifiers
 void setSynchronized(boolean value)
          Sets the Synchronized bit in the modifiers
 java.lang.String toStandardOrderString()
          Convert the object to a string
 java.lang.String toStringAlphabetical()
          Convert the object to a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modifiers

protected int modifiers
Constructor Detail

Summary

public Summary(Summary initParent)
Create a summary object

Parameters:
initParent - the parent
Method Detail

getParent

public Summary getParent()
Return the parent object

Returns:
the parent object

getStartLine

public int getStartLine()
Gets the StartLine attribute of the Summary object

Returns:
The StartLine value

getEndLine

public int getEndLine()
Gets the EndLine attribute of the Summary object

Returns:
The EndLine value

getDeclarationLine

public int getDeclarationLine()
Gets the DeclarationLine attribute of the MethodSummary object

Returns:
The DeclarationLine value

getName

public abstract java.lang.String getName()
Returns the name

Returns:
the name

accept

public java.lang.Object accept(SummaryVisitor visitor,
                               java.lang.Object data)
Provide method to visit a node

Parameters:
visitor - the visitor
data - the data for the visit
Returns:
some new data

setStartLine

protected void setStartLine(int value)
Sets the StartLine attribute of the Summary object

Parameters:
value - The new StartLine value

setEndLine

protected void setEndLine(int value)
Sets the EndLine attribute of the Summary object

Parameters:
value - The new EndLine value

setPrivate

public void setPrivate(boolean value)
Sets the private bit in the modifiers

Specified by:
setPrivate in interface net.sourceforge.jrefactory.ast.ModifierHolder
Parameters:
value - true if we are setting the private modifier

setPrivate

public void setPrivate()
Sets the private bit (to true) in the modifiers

Specified by:
setPrivate in interface net.sourceforge.jrefactory.ast.ModifierHolder

setProtected

public void setProtected(boolean value)
Sets the protected bit in the modifiers

Specified by:
setProtected in interface net.sourceforge.jrefactory.ast.ModifierHolder
Parameters:
value - true if we are setting the protected modifier

setProtected

public void setProtected()
Sets the protected bit (to true) in the modifiers

Specified by:
setProtected in interface net.sourceforge.jrefactory.ast.ModifierHolder

setPublic

public void setPublic(boolean value)
Sets the public bit in the modifiers

Specified by:
setPublic in interface net.sourceforge.jrefactory.ast.ModifierHolder
Parameters:
value - true if we are setting the public modifier

setPublic

public void setPublic()
Sets the public bit (to true) in the modifiers

Specified by:
setPublic in interface net.sourceforge.jrefactory.ast.ModifierHolder

setAbstract

public void setAbstract(boolean value)
Sets the abstract bit in the modifiers

Specified by:
setAbstract in interface net.sourceforge.jrefactory.ast.ModifierHolder
Parameters:
value - true if we are setting the modifier

setAbstract

public void setAbstract()
Sets the abstract bit (to true) in the modifiers

Specified by:
setAbstract in interface net.sourceforge.jrefactory.ast.ModifierHolder

setSynchronized

public void setSynchronized(boolean value)
Sets the Synchronized bit in the modifiers

Specified by:
setSynchronized in interface net.sourceforge.jrefactory.ast.ModifierHolder
Parameters:
value - The new Synchronized value

setSynchronized

public void setSynchronized()
Sets the Synchronized bit (to true) in the modifiers

Specified by:
setSynchronized in interface net.sourceforge.jrefactory.ast.ModifierHolder

setStatic

public void setStatic(boolean value)
Sets the Static bit in the modifiers

Specified by:
setStatic in interface net.sourceforge.jrefactory.ast.ModifierHolder
Parameters:
value - The new Static value

setStatic

public void setStatic()
Sets the Static bit (to true) in the modifiers

Specified by:
setStatic in interface net.sourceforge.jrefactory.ast.ModifierHolder

setFinal

public void setFinal()
Sets the Final bit (to true) of the in the modifiers

Specified by:
setFinal in interface net.sourceforge.jrefactory.ast.ModifierHolder

setStrict

public void setStrict()
Sets the StrictFP bit (to true) of the in the modifiers

Specified by:
setStrict in interface net.sourceforge.jrefactory.ast.ModifierHolder

isAbstract

public boolean isAbstract()
Determine if the object is abstract

Specified by:
isAbstract in interface net.sourceforge.jrefactory.ast.ModifierHolder
Returns:
true if this stores an ABSTRACT flag

isExplicit

public boolean isExplicit()
Determine if the object is explicit

Specified by:
isExplicit in interface net.sourceforge.jrefactory.ast.ModifierHolder
Returns:
true if this stores an EXPLICIT flag

isFinal

public boolean isFinal()
Determine if the object is final

Specified by:
isFinal in interface net.sourceforge.jrefactory.ast.ModifierHolder
Returns:
true if this stores an FINAL flag

isInterface

public boolean isInterface()
Determine if the object is interface

Specified by:
isInterface in interface net.sourceforge.jrefactory.ast.ModifierHolder
Returns:
true if this stores an INTERFACE flag

isNative

public boolean isNative()
Determine if the object is native

Specified by:
isNative in interface net.sourceforge.jrefactory.ast.ModifierHolder
Returns:
true if this stores an NATIVE flag

isPrivate

public boolean isPrivate()
Determine if the object is private

Specified by:
isPrivate in interface net.sourceforge.jrefactory.ast.ModifierHolder
Returns:
true if this stores an PRIVATE flag

isProtected

public boolean isProtected()
Determine if the object is protected

Specified by:
isProtected in interface net.sourceforge.jrefactory.ast.ModifierHolder
Returns:
true if this stores an PROTECTED flag

isPublic

public boolean isPublic()
Determine if the object is public

Specified by:
isPublic in interface net.sourceforge.jrefactory.ast.ModifierHolder
Returns:
true if this stores an PUBLIC flag

isStatic

public boolean isStatic()
Determine if the object is static

Specified by:
isStatic in interface net.sourceforge.jrefactory.ast.ModifierHolder
Returns:
true if this stores an static flag

isStrictFP

public boolean isStrictFP()
Determine if the object is strictFP

Specified by:
isStrictFP in interface net.sourceforge.jrefactory.ast.ModifierHolder
Returns:
true if this stores an STRICTFP flag

isSynchronized

public boolean isSynchronized()
Determine if the object is synchronized

Specified by:
isSynchronized in interface net.sourceforge.jrefactory.ast.ModifierHolder
Returns:
true if this stores an SYNCHRONIZED flag

isTransient

public boolean isTransient()
Determine if the object is transient

Specified by:
isTransient in interface net.sourceforge.jrefactory.ast.ModifierHolder
Returns:
true if this stores an TRANSIENT flag

isVolatile

public boolean isVolatile()
Determine if the object is volatile

Specified by:
isVolatile in interface net.sourceforge.jrefactory.ast.ModifierHolder
Returns:
true if this stores an VOLATILE flag

isPackage

public boolean isPackage()
Determines if this has package scope

Specified by:
isPackage in interface net.sourceforge.jrefactory.ast.ModifierHolder
Returns:
true if this has package scope

addModifier

public void addModifier(java.lang.String mod)
Add a modifier

Specified by:
addModifier in interface net.sourceforge.jrefactory.ast.ModifierHolder
Parameters:
mod - the new modifier

toStringAlphabetical

public java.lang.String toStringAlphabetical()
Convert the object to a string

Returns:
a string describing the modifiers

toStandardOrderString

public java.lang.String toStandardOrderString()
Convert the object to a string

Returns:
a string describing the modifiers

copyModifiers

public void copyModifiers(net.sourceforge.jrefactory.ast.ModifierHolder source)
Copies the modifiers from another source

Specified by:
copyModifiers in interface net.sourceforge.jrefactory.ast.ModifierHolder
Parameters:
source - the source

setCode

protected void setCode(boolean value,
                       int code)
Sets or resets a single bit in the modifiers

Parameters:
value - true if we are setting the bit
code - The new Code value

getModifiers

public int getModifiers()
Gets the modifier bits

Specified by:
getModifiers in interface net.sourceforge.jrefactory.ast.ModifierHolder
Returns:
the modifier bits

setModifiers

public void setModifiers(int modifiers)
Sets the modifier bits

Specified by:
setModifiers in interface net.sourceforge.jrefactory.ast.ModifierHolder
Parameters:
modifiers - the modifier bits

getModifiersString

public java.lang.String getModifiersString(int code)
Returns a string containing all the modifiers

Parameters:
code - the code used to determine the order of the modifiers
Returns:
the string representationof the order