Class DrawStatement
- java.lang.Object
-
- patterntesting.runtime.log.internal.DrawStatement
-
public final class DrawStatement extends java.lang.Object
Internal class for caching the different draw statements.- Since:
- 1.4.1 (17.01.2014)
- Author:
- oliver
-
-
Field Summary
Fields Modifier and Type Field Description static DrawStatement
NULL
The Constant NULL.
-
Constructor Summary
Constructors Constructor Description DrawStatement(java.lang.String senderName, java.lang.Object createdObject, java.lang.String typeName, org.aspectj.lang.JoinPoint.StaticPart jpInfo)
Instantiates a new draw statement.DrawStatement(java.lang.String receiverName, java.lang.String returnee, java.lang.Object returnValue, org.aspectj.lang.JoinPoint.StaticPart jpInfo)
Instantiates a new draw statement.DrawStatement(java.lang.String sender, java.lang.String target, org.aspectj.lang.JoinPoint.StaticPart jpInfo, java.lang.Object[] args)
Instantiates a new draw statement.DrawStatement(DrawType type, java.lang.String name, java.lang.String objectName)
Instantiates a new draw statement of type 'ACTOR' or 'OBJECT'.DrawStatement(DrawType type, java.lang.String sender, org.aspectj.lang.JoinPoint.StaticPart jpInfo)
Instantiates a new draw statement of type 'PLACE_HOLDER'.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
createTargetName(java.lang.Object createdObject)
Creates the target name depending on the given object.boolean
equals(java.lang.Object obj)
Equals.java.lang.Object[]
getArgs()
Gets the args.java.lang.String
getArgsAsString()
Gets the args as string.org.aspectj.lang.JoinPoint.StaticPart
getJpInfo()
Gets the jp info.java.lang.String
getSender()
Gets the sender.java.lang.String
getTarget()
Gets the target.DrawType
getType()
Gets the type.boolean
hasActor(java.lang.String name)
If the given name is part of any stored actor in this statement 'true' will be returned.int
hashCode()
Hash code.boolean
hasMessage()
Checks for message.boolean
hasMessageToLeft()
A message points to left, if the given senderName was created after the given targetName.boolean
hasMessageToRight()
Checks for message to right.boolean
hasSameSignatureAs(org.aspectj.lang.JoinPoint.StaticPart otherJpInfo)
Checks if the given parameter has the same origin and source location as theDrawStatement
.boolean
isFromCallJoinpoint()
Checks if theDrawStatement
is generated from call joinpoint.boolean
isFromExecutionJoinpoint()
Checks if theDrawStatement
is generated from execution joinpoint.java.lang.String
toString()
To string.
-
-
-
Field Detail
-
NULL
public static final DrawStatement NULL
The Constant NULL.
-
-
Constructor Detail
-
DrawStatement
public DrawStatement(DrawType type, java.lang.String sender, org.aspectj.lang.JoinPoint.StaticPart jpInfo)
Instantiates a new draw statement of type 'PLACE_HOLDER'.- Parameters:
type
- the typesender
- the sender (or name) for the given typejpInfo
- the jp info
-
DrawStatement
public DrawStatement(DrawType type, java.lang.String name, java.lang.String objectName)
Instantiates a new draw statement of type 'ACTOR' or 'OBJECT'.- Parameters:
type
- the typename
- the nameobjectName
- the object name
-
DrawStatement
public DrawStatement(java.lang.String senderName, java.lang.Object createdObject, java.lang.String typeName, org.aspectj.lang.JoinPoint.StaticPart jpInfo)
Instantiates a new draw statement.- Parameters:
senderName
- the sender namecreatedObject
- the created objecttypeName
- the type namejpInfo
- the jp info
-
DrawStatement
public DrawStatement(java.lang.String sender, java.lang.String target, org.aspectj.lang.JoinPoint.StaticPart jpInfo, java.lang.Object[] args)
Instantiates a new draw statement.- Parameters:
sender
- the sendertarget
- the targetjpInfo
- the jp infoargs
- the args
-
DrawStatement
public DrawStatement(java.lang.String receiverName, java.lang.String returnee, java.lang.Object returnValue, org.aspectj.lang.JoinPoint.StaticPart jpInfo)
Instantiates a new draw statement.- Parameters:
receiverName
- the receiver namereturnee
- the returneereturnValue
- the return valuejpInfo
- the jp info
-
-
Method Detail
-
createTargetName
public static java.lang.String createTargetName(java.lang.Object createdObject)
Creates the target name depending on the given object. If the given object has an id this id will be part of the generated name.- Parameters:
createdObject
- the created object- Returns:
- the string
-
getType
public DrawType getType()
Gets the type.- Returns:
- the type
-
getSender
public java.lang.String getSender()
Gets the sender.- Returns:
- the sender
-
getTarget
public java.lang.String getTarget()
Gets the target.- Returns:
- the target
-
getJpInfo
public org.aspectj.lang.JoinPoint.StaticPart getJpInfo()
Gets the jp info.- Returns:
- the jp info
-
getArgs
public java.lang.Object[] getArgs()
Gets the args.- Returns:
- the args
-
getArgsAsString
public java.lang.String getArgsAsString()
Gets the args as string.- Returns:
- the args as string
-
isFromCallJoinpoint
public boolean isFromCallJoinpoint()
Checks if theDrawStatement
is generated from call joinpoint.- Returns:
- true, if is generated from a call joinpoint
-
isFromExecutionJoinpoint
public boolean isFromExecutionJoinpoint()
Checks if theDrawStatement
is generated from execution joinpoint.- Returns:
- true, if is generated from a execution joinpoint
-
hasSameSignatureAs
public boolean hasSameSignatureAs(org.aspectj.lang.JoinPoint.StaticPart otherJpInfo)
Checks if the given parameter has the same origin and source location as theDrawStatement
.- Parameters:
otherJpInfo
- the other Joinpoint info- Returns:
- true, if successful
-
hasActor
public boolean hasActor(java.lang.String name)
If the given name is part of any stored actor in this statement 'true' will be returned.- Parameters:
name
- the name- Returns:
- true, if is involved
-
hasMessage
public boolean hasMessage()
Checks for message.- Returns:
- true, if successful
-
hasMessageToLeft
public boolean hasMessageToLeft()
A message points to left, if the given senderName was created after the given targetName. This information can be derived from the name.- Returns:
- true, if successful
-
hasMessageToRight
public boolean hasMessageToRight()
Checks for message to right.- Returns:
- true, if successful
-
hashCode
public int hashCode()
Hash code.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- the int
- See Also:
Object.hashCode()
-
equals
public boolean equals(java.lang.Object obj)
Equals.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the obj- Returns:
- true, if successful
- See Also:
Object.equals(java.lang.Object)
-
toString
public java.lang.String toString()
To string.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the string
- See Also:
Object.toString()
-
-