Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.whiteboard.sxe.util.NodeSet< T extends NodeRecord > Class Reference

Inherits TreeSet< T >.

List of all members.

Public Member Functions

boolean add (T e)
boolean contains (Object o)
Float nextPrimaryWeight ()
boolean addAll (Collection<?extends T > c)

Static Public Attributes

static final float STEP_TO_NEXT_PRIMARY_WEIGHT = 10f

Static Protected Member Functions

static float random2Decimals ()

Detailed Description

This extension of a TreeSet ensures that records with empty primary-weight are initialized to be added at the end.

Technically it automatically sets the primary-weight of a record if null.

Author:
jurke

Member Function Documentation

boolean de.fu_berlin.inf.dpp.whiteboard.sxe.util.NodeSet< T extends NodeRecord >.add ( e)

Adds the record to this set. If no primary weight is specified, it will be added to the end.

boolean de.fu_berlin.inf.dpp.whiteboard.sxe.util.NodeSet< T extends NodeRecord >.addAll ( Collection<?extends T >  c)
boolean de.fu_berlin.inf.dpp.whiteboard.sxe.util.NodeSet< T extends NodeRecord >.contains ( Object  o)

Note: A node without primary-weight cannot be contained

Float de.fu_berlin.inf.dpp.whiteboard.sxe.util.NodeSet< T extends NodeRecord >.nextPrimaryWeight ( )
Returns:
the next primary-weight to append a child at the end
static float de.fu_berlin.inf.dpp.whiteboard.sxe.util.NodeSet< T extends NodeRecord >.random2Decimals ( ) [static, protected]

This method is used to increase the possibility to have different primary-weight values for every peer, even on concurrent creation.

This is useful because if comparing per secondary-weight (the RIDs) only, it's more effort to insert an element in between.

Returns:
a random float with two decimal places

Member Data Documentation

final float de.fu_berlin.inf.dpp.whiteboard.sxe.util.NodeSet< T extends NodeRecord >.STEP_TO_NEXT_PRIMARY_WEIGHT = 10f [static]

Steps between default primary-weights

 All Classes Namespaces Files Functions Variables Enumerations