Proxy.AttributesRO

org.freeplane.plugin.script.proxy

## インタフェース Proxy.AttributesRO

- 既知のサブインタフェースのリスト:
    Proxy.Attributes
  含まれているインタフェース:
    Proxy

      public static interface Proxy.AttributesRO

  Node's attribute table: `node.attributes` - read-only.

  Attributes are name - value pairs assigned to a node. A node may have multiple attributes with the same name.

- - ### メソッドの概要

    メソッド
    修飾子とタイプ | メソッドと説明
    --- | ---
    `int` | `findAttribute(java.lang.String name)` 非推奨です。 since 1.2 - use `findFirst(String)` instead.
    `int` | `findFirst(java.lang.String name)` returns the index of the first attribute with the given name if one exists or -1 otherwise.
    `java.util.List<? extends Convertible>` | `findValues(groovy.lang.Closure<java.lang.Boolean> closure)` returns the values of all attributes for which the closure returns true.
    `java.lang.Object` | `get(int index)` returns the attribute value at the given index.
    `java.lang.Object` | `get(java.lang.String name)` 非推奨です。 before 1.1 - use `get(int)`, `getFirst(String)` or `getAll(String)` instead.
    `java.util.List<java.lang.Object>` | `getAll(java.lang.String name)` returns all values for the attribute name.
    `java.util.List<java.lang.String>` | `getAttributeNames()` 非推奨です。 since 1.2 use #getNames() instead.
    `java.lang.Object` | `getFirst(java.lang.String name)` returns the first value of an attribute with the given name or null otherwise.
    `java.lang.String` | `getKey(int index)` returns the attribute key at the given index.
    `java.util.Map<java.lang.String,java.lang.Object>` | `getMap()` returns all attributes as a map.
    `java.util.List<java.lang.String>` | `getNames()` returns all attribute names in the proper sequence.
    `java.util.List<? extends Convertible>` | `getValues()` returns all values as a list of `Convertible`.
    `boolean` | `isEmpty()` returns `getAttributeNames().isEmpty()`.
    `int` | `size()` the number of attributes.

- - ### メソッドの詳細

    - #### get

          @Deprecated
          java.lang.Object get(java.lang.String name)

      非推奨です。 before 1.1 - use `get(int)`, `getFirst(String)` or `getAll(String)` instead.
      alias for `getFirst(String)`.

    - #### getFirst

          java.lang.Object getFirst(java.lang.String name)

      returns the first value of an attribute with the given name or null otherwise.
      導入されたバージョン:
        1.2

    - #### getAll

          java.util.List<java.lang.Object> getAll(java.lang.String name)

      returns all values for the attribute name.

    - #### getNames

          java.util.List<java.lang.String> getNames()

      returns all attribute names in the proper sequence. The number of names returned is equal to the number of attributes.

             // rename attribute
             int i = 0;
             for (String name : attributes.getNames()) {
                 if (name.equals("xy"))
                     attributes.set(i, "xyz", attributes.get(i));
                 ++i;
             }

    - #### getAttributeNames

          java.util.List<java.lang.String> getAttributeNames()

      非推奨です。 since 1.2 use #getNames() instead.

    - #### getValues

          java.util.List<? extends Convertible> getValues()

      returns all values as a list of `Convertible`.
      導入されたバージョン:
        1.2

    - #### getMap

          java.util.Map<java.lang.String,java.lang.Object> getMap()

      returns all attributes as a map. Note that this will erase duplicate keys. `node.attributes = otherNode.attributes.map`
      導入されたバージョン:
        1.2

    - #### get

          java.lang.Object get(int index)

      returns the attribute value at the given index.
      例外:
        `java.lang.IndexOutOfBoundsException` - if index is out of range `(index < 0 || index >= size())`.

    - #### getKey

          java.lang.String getKey(int index)

      returns the attribute key at the given index.
      例外:
        `java.lang.IndexOutOfBoundsException` - if index is out of range `(index < 0 || index >= size())`.

    - #### findAttribute

          int findAttribute(java.lang.String name)

      非推奨です。 since 1.2 - use `findFirst(String)` instead.

    - #### findFirst

          int findFirst(java.lang.String name)

      returns the index of the first attribute with the given name if one exists or -1 otherwise. For searches for all attributes with a given name `getAttributeNames()` must be used.
      導入されたバージョン:
        1.2

    - #### findValues

          java.util.List<? extends Convertible> findValues(groovy.lang.Closure<java.lang.Boolean> closure)

      returns the values of all attributes for which the closure returns true. The fact that the values are returned as a list of `Convertible` enables conversion. The following formula sums all attributes whose names are not equal to 'TOTAL':

            = attributes.findValues{key,val-> key != 'TOTAL'}.sum(0){it.num0}

      パラメータ:
        `closure` - A closure that accepts two arguments (String key, Object value) and returns boolean/Boolean.
      導入されたバージョン:
        1.2

    - #### size

          int size()

      the number of attributes. It is `size() == getAttributeNames().size()`.

    - #### isEmpty

          boolean isEmpty()

      returns `getAttributeNames().isEmpty()`.
      導入されたバージョン:
        1.2