public final class SuperRootRow extends Object implements StructureRow
The super-root is a fictional row that is present in every forest as the parent of all root rows.
SuperRootRow
class is the representation of the super-root row.
Super-root is a concept with limited application; as of now, it can only be used in StructureAttributeService
for calculating totals
for the whole forest.
The super-root row has row ID of -1
. This row ID is reserved and must not be used for any other purpose. Creating a Forest
with row ID -1
will result in exception.
StructureAttributeService
StructureRow.ZeroRow
Modifier and Type | Field and Description |
---|---|
static int |
SUPER_ROOT_DEPTH
Super-root's depth in a forest.
|
static int |
SUPER_ROOT_INDEX
Super-root's index in an array of forest rows.
|
static ItemIdentity |
SUPER_ROOT_ITEM
An
ItemIdentity of the item in the super-root. |
static String |
SUPER_ROOT_ITEM_TYPE
A special item type for the super-root item.
|
static SuperRootRow |
SUPER_ROOT_ROW
A single instance of the super-root
StructureRow . |
static long |
SUPER_ROOT_ROW_ID
Super-root's row ID.
|
static long |
SUPER_ROOT_SEMANTICS
A special semantics of the super-root.
|
ROW_ZERO
Modifier and Type | Method and Description |
---|---|
<I> I |
getItem(Class<I> itemClass)
Tries to resolve the item based on its ID, that is, get an object that represents this item.
|
ItemIdentity |
getItemId()
Returns item ID for the item shown in this row.
|
long |
getRowId()
Returns row ID, a positive number.
|
long |
getSemantics()
Returns row's semantics.
|
String |
toString() |
public static final long SUPER_ROOT_ROW_ID
public static final SuperRootRow SUPER_ROOT_ROW
StructureRow
.public static final String SUPER_ROOT_ITEM_TYPE
public static final ItemIdentity SUPER_ROOT_ITEM
ItemIdentity
of the item in the super-root.public static final long SUPER_ROOT_SEMANTICS
@Internal public static final int SUPER_ROOT_INDEX
@Internal public static final int SUPER_ROOT_DEPTH
public long getRowId()
StructureRow
getRowId
in interface StructureRow
@NotNull public ItemIdentity getItemId()
StructureRow
getItemId
in interface StructureRow
public long getSemantics()
StructureRow
getSemantics
in interface StructureRow
@Nullable public <I> I getItem(@NotNull Class<I> itemClass)
StructureRow
Tries to resolve the item based on its ID, that is, get an object that represents this item. Resolution includes checking the current user's access to that item, unless the row is created with an additional flag indicating that the access check should be skipped.
This method may return null
in many different cases:
StructureRow
was created with the ItemAccessMode.ITEM_NOT_NEEDED
flag.itemClass
.getItem
in interface StructureRow
I
- type of item's objectsitemClass
- expected class of the item's objectnull
Copyright © 2024 Tempo Software. All Rights Reserved.