: Class OPunary

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## gnu.jel
Class OPunary

    java.lang.Object
      |
      +--gnu.jel.OP
            |
            +--gnu.jel.OPfunction
                  |
                  +--gnu.jel.OPunary

public class OPunary
extends OPfunction

Field Summary
`protected int` | `code`
`protected static java.lang.Class` | `sb_class`
`protected static java.lang.Class` | `string_class`
`protected static int[]` | `unary_prmtns`

Fields inherited from class gnu.jel.OP
`next, prev, resID, resType`

Constructor Summary
`OPunary(TypesStack typesStk, java.lang.Class cls, boolean allownarrowing)` Creates conversion operation to the given class.
`OPunary(TypesStack typesStk, int code)` Constructs a new unary operation.
`OPunary(TypesStack typesStk, int targetID, java.lang.Class targetClass, boolean allownarrowing)` Creates conversion operation to the given class.

Method Summary
`protected void` | `compile_pre(ClassFile cf)` Called to generate the code before the parameters processing starts.
`protected void` | `compile(ClassFile cf)` Called to generate the code implementing this OP.
`protected void` | `eval(OPlist list)` Attempts to perform this operation.
`int` | `getNParams()` Returns number of parameters for this function.
`java.lang.String` | `toString()`

Methods inherited from class gnu.jel.OPfunction
`compile_par`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### code

    protected int code

### sb_class

    protected static java.lang.Class sb_class

### string_class

    protected static java.lang.Class string_class

### unary_prmtns

    protected static final int[] unary_prmtns

Constructor Detail

### OPunary

    public OPunary(TypesStack typesStk,
                   int code)
            throws java.lang.IllegalStateException

  Constructs a new unary operation.

  Codes are following:

       0  -- negation (applicable to anything except boolean)
       1  -- bitwise not (applicable to all integral types)
       2  -- logical not (applicable to booleans only)
       3  -- return the type in stack

  Parameters:
    `typesStk` - stack holding the current types (will be updated)
    `code` - operation code
    `cls` - class to convert to (used only if code==11)

### OPunary

    public OPunary(TypesStack typesStk,
                   int targetID,
                   java.lang.Class targetClass,
                   boolean allownarrowing)

  Creates conversion operation to the given class.
  Parameters:
    `typesStk` - stack holding the current types (will be updated)
    `targetID` - ID of primitive type to convert to.
    `targetClass` - the class to convert to, in case cldID=8
    `allownarrowing` - if narrowing conversions are allowed.

### OPunary

    public OPunary(TypesStack typesStk,
                   java.lang.Class cls,
                   boolean allownarrowing)

  Creates conversion operation to the given class.
  Parameters:
    `typesStk` - stack holding the current types (will be updated)
    `cls` - the class to convert to, in case cldID=8
    `allownarrowing` - if narrowing conversions are allowed.

Method Detail

### getNParams

    public int getNParams()

  Returns number of parameters for this function.
  Overrides:
    `getNParams` in class `OPfunction`

### compile_pre

    protected void compile_pre(ClassFile cf)

  Description copied from class: `OPfunction`
  Called to generate the code before the parameters processing starts.
  Overrides:
    `compile_pre` in class `OPfunction`
  Following copied from class: `gnu.jel.OPfunction`
  Parameters:
    `cf` - class file to write the code into.

### compile

    protected void compile(ClassFile cf)

  Description copied from class: `OP`
  Called to generate the code implementing this OP.
  Overrides:
    `compile` in class `OP`
  Following copied from class: `gnu.jel.OP`
  Parameters:
    `cf` - class file to write the code into.

### eval

    protected void eval(OPlist list)

  Attempts to perform this operation.
  Overrides:
    `eval` in class `OPfunction`
  Parameters:
    `list` - is the list of OPs this one belong to, if eval is unsuccessful this list is not modified.

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD