Class | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.jsp.jml
Class JmlNumber

    java.lang.Object
      |
      +--oracle.jsp.jml.JmlNumber

public final class JmlNumber
extends java.lang.Object
implements java.io.Serializable

JmlNumber wraps the primitive type `int` in a Java bean. It has a single property, `value` that represents the bean's typed value. It is designed to work more effectively in JSPs than Java primitive types or their corresponding wrapper `java.lang.*` objects. Specifically, JmlNumber overcomes:

- inability to attach Java primitive types on JSP scope (objects).
- inability to declare most `java.lang.*` objects using
- inability to modify a `java.lang.*` object's value after created.

See Also:
  Serialized Form

Constructor Summary
`JmlNumber()` Constructs a default `JmlNumber` object.
`JmlNumber(int num)` Constructs a `JmlNumber` object whose value is `int`.
`JmlNumber(java.lang.Integer num)` Constructs a `JmlNumber` object whose value is `java.lang.Integer`.
`JmlNumber(JmlNumber num)` Constructs a `JmlNumber` object whose value is `JmlNumber`.
`JmlNumber(java.lang.String num)` Constructs a `JmlNumber` object whose value is `java.lang.String`.

Method Summary
`boolean` | `equals(int num)` Tests whether the beans's `value` property is equal to `int`.
`int` | `getValue()` Returns the beans's `value` property as a `int`.
`void` | `setTypedValue(int num)` Sets the beans's `value` property to the `int`.
`void` | `setTypedValue(java.lang.Integer num)` Sets the beans's `value` property to the `java.lang.Integer`.
`void` | `setTypedValue(JmlNumber num)` Sets the beans's `value` property to the `JmlNumber`.
`void` | `setTypedValue(java.lang.String num)` Sets the beans's `value` property to the `java.lang.String`.
`void` | `setValue(int num)` Sets the beans's `value` property to the `int`.
`java.lang.String` | `toString()` Returns the beans's `value` property as a `java.lang.String`.
`boolean` | `typedEquals(java.lang.Integer num)` Tests whether the beans's `value` property is equal to `java.lang.Integer`.
`boolean` | `typedEquals(JmlNumber num)` Tests whether the beans's `value` property is equal to `JmlNumber`.
`boolean` | `typedEquals(java.lang.String num)` Tests whether the beans's `value` property is equal to `java.lang.String`.

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

Constructor Detail

### JmlNumber

    public JmlNumber()

  Constructs a default `JmlNumber` object. The object's default `value` is `0`.

### JmlNumber

    public JmlNumber(int num)

  Constructs a `JmlNumber` object whose value is `int`.

### JmlNumber

    public JmlNumber(java.lang.String num)

  Constructs a `JmlNumber` object whose value is `java.lang.String`. Conversion is equivalent to `java.lang.Integer.valueOf()`.

### JmlNumber

    public JmlNumber(java.lang.Integer num)

  Constructs a `JmlNumber` object whose value is `java.lang.Integer`.

### JmlNumber

    public JmlNumber(JmlNumber num)

  Constructs a `JmlNumber` object whose value is `JmlNumber`.

Method Detail

### getValue

    public int getValue()

  Returns the beans's `value` property as a `int`.

### setValue

    public void setValue(int num)

  Sets the beans's `value` property to the `int`.

### setTypedValue

    public void setTypedValue(java.lang.String num)

  Sets the beans's `value` property to the `java.lang.String`. Conversion occurs according to the same rules as `java.lang.Integer.valueOf()`.

### setTypedValue

    public void setTypedValue(java.lang.Integer num)

  Sets the beans's `value` property to the `java.lang.Integer`.

### setTypedValue

    public void setTypedValue(int num)

  Sets the beans's `value` property to the `int`.

### setTypedValue

    public void setTypedValue(JmlNumber num)

  Sets the beans's `value` property to the `JmlNumber`.

### equals

    public boolean equals(int num)

  Tests whether the beans's `value` property is equal to `int`.

### typedEquals

    public boolean typedEquals(java.lang.Integer num)

  Tests whether the beans's `value` property is equal to `java.lang.Integer`.

### typedEquals

    public boolean typedEquals(java.lang.String num)

  Tests whether the beans's `value` property is equal to `java.lang.String`. The comparison is made after converting the `java.lang.String` to a `JmlNumber`.

### typedEquals

    public boolean typedEquals(JmlNumber num)

  Tests whether the beans's `value` property is equal to `JmlNumber`.

### toString

    public java.lang.String toString()

  Returns the beans's `value` property as a `java.lang.String`. The `java.lang.String` is represented as `java.lang.Integer.toString()`.
  Overrides:
    toString in class java.lang.Object

Class | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD