About the 'type' and 'value' of Node

I hava two questions.
First : after reading the code of map-matching about the strategy of generated for type and value for ‘Node’ , i.e the file OSMReader.java the function boolean addNode(ReaderNode node) ,
when is the type of Node created ?
OSMReader.java the function: Collection addOSMWay(final TLongList osmNodeIds, final long flags, final long wayOsmId) , i don’t understand the purpose of internalNodeID ‘tmpNode’ in different internal (i.e : tmpNode > -TOWER_NODE), looking forward your reply , thanks sincerely !

@ karussell can you give me some advice ?

Have a look at the documentation:

Thank you very much :)