Class DirectivesMethod
- java.lang.Object
-
- org.eolang.jeo.representation.directives.DirectivesMethod
-
- All Implemented Interfaces:
Iterable<org.xembly.Directive>
public final class DirectivesMethod extends Object implements Iterable<org.xembly.Directive>
Directives Method.- Since:
- 0.1
- To do:
- #534:90min Refactor DirectivesMethod class to simplify the code. Currently, the class has a lot of methods and fields. It's kind of hard to understand what this class does. We need to refactor it to make it more readable and understandable. Moreover, in many places this class uses null checks, which is not good.
-
-
Constructor Summary
Constructors Constructor Description DirectivesMethod(String name)
Constructor.DirectivesMethod(String name, boolean counting, DirectivesMethodProperties properties)
Constructor.DirectivesMethod(String name, DirectivesMethodProperties properties)
Constructor.DirectivesMethod(Signature name, DirectivesMethodProperties properties, List<Iterable<org.xembly.Directive>> instructions, List<Iterable<org.xembly.Directive>> exceptions, DirectivesAnnotations annotations, List<Iterable<org.xembly.Directive>> dvalue, DirectivesAttributes attributes, boolean counting)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterator<org.xembly.Directive>
iterator()
DirectivesMethod
withAnnotation(DirectivesAnnotation annotation)
Add annotation to the directives.DirectivesMethod
withOpcode(int opcode, Object... operands)
Add opcode to the directives.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
DirectivesMethod
public DirectivesMethod(String name)
Constructor.- Parameters:
name
- Method name
-
DirectivesMethod
public DirectivesMethod(String name, DirectivesMethodProperties properties)
Constructor.- Parameters:
name
- Method nameproperties
- Method properties
-
DirectivesMethod
public DirectivesMethod(String name, boolean counting, DirectivesMethodProperties properties)
Constructor.- Parameters:
name
- Method namecounting
- Opcodes countingproperties
- Method properties
-
DirectivesMethod
public DirectivesMethod(Signature name, DirectivesMethodProperties properties, List<Iterable<org.xembly.Directive>> instructions, List<Iterable<org.xembly.Directive>> exceptions, DirectivesAnnotations annotations, List<Iterable<org.xembly.Directive>> dvalue, DirectivesAttributes attributes, boolean counting)
Constructor.- Parameters:
name
- Method nameproperties
- Method propertiesinstructions
- Method instructionsexceptions
- Method exceptionsannotations
- Method annotationsdvalue
- Annotation default valueattributes
- Method attributescounting
- Opcodes counting- Suppressed Checkstyle violations:
- ParameterNumberCheck (10 lines)
-
-
Method Detail
-
withOpcode
public DirectivesMethod withOpcode(int opcode, Object... operands)
Add opcode to the directives.- Parameters:
opcode
- Opcodeoperands
- Operands- Returns:
- This object
-
withAnnotation
public DirectivesMethod withAnnotation(DirectivesAnnotation annotation)
Add annotation to the directives.- Parameters:
annotation
- Annotation directives.- Returns:
- This object.
-
-