    

 ## On this page

  

 

 # addItem

 Last update: 18.06.2026 

public [addItem](add-item.md)(name: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html), link: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html)): [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* adds a new entry to the monitor with the given name and link

#### Return

returns -1 if the linking failed and the entry was not added or the index of the entry if it was successfully added and linked

#### Parameters

namethe name of the entrylinkthe full name of the item to which the entry will be linked