Package org.apache.sis.internal.jaxb.lan
Class LocaleAndCharset.Child
java.lang.Object
org.apache.sis.internal.jaxb.lan.LocaleAndCharset.Child
- All Implemented Interfaces:
TreeTable.Node
- Enclosing class:
LocaleAndCharset
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests this node with the given object for equality.Returns the children of this node.Returns the parent node, ornull
if this node is the root of the tree.Returns the user object associated to this node.<V> V
getValue
(TableColumn<V> column) Returns the value at the given column, with hard-coded names.int
hashCode()
Returns a hash code value for this node.boolean
isEditable
(TableColumn<?> c) Determines whether the value in the specified column is editable.boolean
isLeaf()
Returnstrue
if this node cannot have any children.newChild()
Creates a new child with the same columns than the other children, and adds it to the children collection.<V> void
setValue
(TableColumn<V> column, V value) Sets the value in the map entry key wrapped by this node.
-
Constructor Details
-
Child
private Child()
-
-
Method Details
-
getParent
Description copied from interface:TreeTable.Node
Returns the parent node, ornull
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 interfaceTreeTable.Node
- Returns:
- the parent, or
null
if none.
-
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 aCityLocation
class is defined as a (city name, latitude, longitude) tuple, then aTreeTable.Node
could be defined to have 3 columns for the above 3 tuple components, and the user object could be the originalCityLocation
instance.- Specified by:
getUserObject
in interfaceTreeTable.Node
- Returns:
- any object stored at this node by the user, or
null
if none.
-
isEditable
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 thisNode
instance, then this method returnsfalse
.- Specified by:
isEditable
in interfaceTreeTable.Node
- Parameters:
c
- the column to query.- Returns:
true
if the given column is a legal column for thisNode
implementation and the corresponding value is editable, orfalse
otherwise.
-
isLeaf
public boolean isLeaf()Description copied from interface:TreeTable.Node
Returnstrue
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 interfaceTreeTable.Node
- Returns:
true
if this node cannot have any children.
-
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 aList
, but not necessarily. For some implementations like the metadata tree table view, compliance to theList
contract is impractical or inefficient.- Specified by:
getChildren
in interfaceTreeTable.Node
- Returns:
- the children, or an empty collection if none.
-
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 interfaceTreeTable.Node
- Returns:
- the new child.
-
getValue
Returns the value at the given column, with hard-coded names.- Specified by:
getValue
in interfaceTreeTable.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
Sets the value in the map entry key wrapped by this node.- Specified by:
setValue
in interfaceTreeTable.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 interfaceTreeTable.Node
- Overrides:
hashCode
in classObject
- Returns:
- a hash code for this node, potentially based on values and children but ignoring parent.
-
equals
Tests this node with the given object for equality.- Specified by:
equals
in interfaceTreeTable.Node
- Overrides:
equals
in classObject
- 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.
-