Class LocaleAndCharset.Child

java.lang.Object
org.apache.sis.internal.jaxb.lan.LocaleAndCharset.Child
All Implemented Interfaces:
TreeTable.Node
Enclosing class:
LocaleAndCharset

private final class LocaleAndCharset.Child extends Object implements TreeTable.Node
The only child of the node containing a Locale value. This child contains the associated Charset value. That value is replaceable if the wrapped node is editable, which depends on whether the metadata instance is modifiable or not.
  • Constructor Details

    • Child

      private Child()
  • Method Details

    • getParent

      public TreeTable.Node getParent()
      Description copied from interface: TreeTable.Node
      Returns the parent node, or null if this node is the root of the tree.

      There is intentionally no setParent(Node) method, as children and parent managements are highly implementation-dependant. If the children collection is modifiable, then implementations are encouraged to update automatically the parent when a child is added to or removed from that collection.

      Specified by:
      getParent in interface TreeTable.Node
      Returns:
      the parent, or null if none.
    • getUserObject

      public Object getUserObject()
      Description copied from interface: TreeTable.Node
      Returns the user object associated to this node. The user object is for information purpose only and does not appear in the rendered tree. It is typically a Java object whose content is splitted into the various table columns.
      Example: If a CityLocation class is defined as a (city name, latitude, longitude) tuple, then a TreeTable.Node could be defined to have 3 columns for the above 3 tuple components, and the user object could be the original CityLocation instance.
      Specified by:
      getUserObject in interface TreeTable.Node
      Returns:
      any object stored at this node by the user, or null if none.
    • isEditable

      public boolean isEditable(TableColumn<?> c)
      Description copied from interface: TreeTable.Node
      Determines whether the value in the specified column is editable. If the given column is not a legal column for this Node instance, then this method returns false.
      Specified by:
      isEditable in interface TreeTable.Node
      Parameters:
      c - the column to query.
      Returns:
      true if the given column is a legal column for this Node implementation and the corresponding value is editable, or false otherwise.
    • isLeaf

      public boolean isLeaf()
      Description copied from interface: TreeTable.Node
      Returns true if this node cannot have any children. The children collection of a leaf node can only be empty, and adding new child is an unsupported operation.

      This value is provided as a tip for graphical user interfaces, in order to determine if a node is expandable (even if empty). TreeTableFormat does not use this value.

      Specified by:
      isLeaf in interface TreeTable.Node
      Returns:
      true if this node cannot have any children.
    • getChildren

      public Collection<TreeTable.Node> getChildren()
      Description copied from interface: TreeTable.Node
      Returns the children of this node. The returned collection may or may not be modifiable, at implementation choice. If the collection is modifiable, then it shall be live, i.e. any modification to the returned collection are reflected immediately in the tree. This allows addition or removal of child nodes as below: The collection is often a List, but not necessarily. For some implementations like the metadata tree table view, compliance to the List contract is impractical or inefficient.
      Specified by:
      getChildren in interface TreeTable.Node
      Returns:
      the children, or an empty collection if none.
    • newChild

      public TreeTable.Node newChild()
      Description copied from interface: TreeTable.Node
      Creates a new child with the same columns than the other children, and adds it to the children collection. The new child is typically added at the end of the collection, but this is not mandatory: implementations can add the child at whatever position they see fit.
      Specified by:
      newChild in interface TreeTable.Node
      Returns:
      the new child.
    • getValue

      public <V> V getValue(TableColumn<V> column)
      Returns the value at the given column, with hard-coded names.
      Specified by:
      getValue in interface TreeTable.Node
      Type Parameters:
      V - the base type of values in the given column.
      Parameters:
      column - identifier of the column from which to get the value.
      Returns:
      the value in the given column, or null if none.
      See Also:
    • setValue

      public <V> void setValue(TableColumn<V> column, V value)
      Sets the value in the map entry key wrapped by this node.
      Specified by:
      setValue in interface TreeTable.Node
      Type Parameters:
      V - the base type of values in the given column.
      Parameters:
      column - identifier of the column into which to set the value.
      value - the value to set.
      See Also:
    • hashCode

      public int hashCode()
      Returns a hash code value for this node.
      Specified by:
      hashCode in interface TreeTable.Node
      Overrides:
      hashCode in class Object
      Returns:
      a hash code for this node, potentially based on values and children but ignoring parent.
    • equals

      public boolean equals(Object other)
      Tests this node with the given object for equality.
      Specified by:
      equals in interface TreeTable.Node
      Overrides:
      equals in class Object
      Parameters:
      other - the other object to compare with this node.
      Returns:
      whether the two objects are nodes with equal values and equal children, ignoring parents.