Package org.jfree.layouting.layouter.context

## Class DefaultElementContext

- java.lang.Object
- - org.jfree.layouting.layouter.context.DefaultElementContext

- All Implemented Interfaces:
    `ElementContext`
  Direct Known Subclasses:
    `LogicalPageElementContext`, `PhysicalPageElementContext`

      public class DefaultElementContext
      extends java.lang.Object
      implements ElementContext

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DefaultElementContext​(ElementContext parentContext)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `getCounterValue​(java.lang.String counterName)` | Returns the value for the given counter.
    `java.lang.String` | `getString​(java.lang.String name)` | Retrieves the value for a given string.
    `void` | `incrementCounter​(java.lang.String name, int value)` | Increments the counter with the given name.
    `boolean` | `isCounterDefined​(java.lang.String counterName)` | Checks, whether a counter is defined in this or one of the parent contexts.
    `void` | `resetCounter​(java.lang.String name, int value)` | Reseting an counter creates a new Counter-Instance.
    `void` | `setString​(java.lang.String name, java.lang.String value, boolean define)` | Sets a named string.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultElementContext

          public DefaultElementContext​(ElementContext parentContext)

  - ### Method Detail

    - #### getCounterValue

          public int getCounterValue​(java.lang.String counterName)

      Returns the value for the given counter. If no counter exists under that name, this method returns 0.
      Specified by:
        `getCounterValue` in interface `ElementContext`
      Parameters:
        `counterName` -
      Returns:
        the value for the given counter.

    - #### incrementCounter

          public void incrementCounter​(java.lang.String name,
                                       int value)

      Increments the counter with the given name. If no counter is known under that name, the root node will create one.
      Specified by:
        `incrementCounter` in interface `ElementContext`
      Parameters:
        `name` -
        `value` -

    - #### resetCounter

          public void resetCounter​(java.lang.String name,
                                   int value)

      Reseting an counter creates a new Counter-Instance. Counters from parent elements are not affected and remain unchanged. All further operations issued by all sub-elements will now work with this counter.
      Specified by:
        `resetCounter` in interface `ElementContext`
      Parameters:
        `name` -
        `value` -

    - #### isCounterDefined

          public boolean isCounterDefined​(java.lang.String counterName)

      Description copied from interface: `ElementContext`
      Checks, whether a counter is defined in this or one of the parent contexts. A counter gets defined by the 'counter-reset' property.
      Specified by:
        `isCounterDefined` in interface `ElementContext`
      Parameters:
        `counterName` - the counter name.
      Returns:
        true, if the counter is defined, false otherwise.

    - #### setString

          public void setString​(java.lang.String name,
                                java.lang.String value,
                                boolean define)

      Sets a named string.
      Specified by:
        `setString` in interface `ElementContext`
      Parameters:
        `name` - the name
        `value` - the value
        `define` - if set to true, this defines a new nesting context.

    - #### getString

          public java.lang.String getString​(java.lang.String name)

      Retrieves the value for a given string. The value returned always represents the *actual* value, ignoring any possibly defined page-policies.
      Specified by:
        `getString` in interface `ElementContext`
      Parameters:
        `name` -
      Returns: