com.twitter.cassovary.graph.node

SynchronizedDynamicNode

class SynchronizedDynamicNode extends DynamicNode

A Node supports add and delete operation on its in/out edges. All its operations are synchronized.

Linear Supertypes
DynamicNode, Node, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SynchronizedDynamicNode
  2. DynamicNode
  3. Node
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SynchronizedDynamicNode(id: Int)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def addInBoundNode(nodeId: Int): Unit

    Add single inbound edge nodeId into the inbound list

    Add single inbound edge nodeId into the inbound list

    Definition Classes
    DynamicNode
  7. def addInBoundNodes(nodeIds: Seq[Int]): Unit

    Add multiple inbound edges nodeIds.

    Add multiple inbound edges nodeIds. It doesn't examine whether some ids is already in.

    Definition Classes
    SynchronizedDynamicNodeDynamicNode
  8. def addOutBoundNode(nodeId: Int): Unit

    Add single outbound edge nodeId into the outbound list

    Add single outbound edge nodeId into the outbound list

    Definition Classes
    DynamicNode
  9. def addOutBoundNodes(nodeIds: Seq[Int]): Unit

    Add multiple outbound edges nodeIds.

    Add multiple outbound edges nodeIds. Ignore the edges that are already in. It doesn't examine whether the some ids in nodeIds is already in.

    Definition Classes
    SynchronizedDynamicNodeDynamicNode
  10. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  11. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def containsNode(nodeIds: Seq[Int], queryNodeId: Int): Boolean

    The default implementation just walks the array but users likely want to override to provide a more optimized implementation.

    The default implementation just walks the array but users likely want to override to provide a more optimized implementation.

    returns

    a boolean indicating Whether nodeIds contains queryNodeId.

    Attributes
    protected
    Definition Classes
    Node
  13. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. def equals(other: Any): Boolean

    Definition Classes
    SynchronizedDynamicNode → AnyRef → Any
  15. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  18. val id: Int

    The unique id of this node.

    The unique id of this node.

    Definition Classes
    SynchronizedDynamicNodeNode
  19. val inEdges: ArrayBuffer[Int]

    Attributes
    protected
  20. def inboundCount: Int

    returns

    the total number of inbound edges.

    Definition Classes
    Node
  21. def inboundNodes(): WrappedArray[Int]

    Override functions of base class.

    Override functions of base class.

    Definition Classes
    SynchronizedDynamicNodeNode
  22. def inboundNodes(max: Int): Seq[Int]

    Returns up to max nodes that this node points to.

    Returns up to max nodes that this node points to.

    max

    the max number of nodes it needs

    returns

    a sequence of inboundNode ids

    Definition Classes
    Node
  23. def isInboundNode(nodeId: Int): Boolean

    Returns true if the given nodeId points to this node.

    Returns true if the given nodeId points to this node.

    nodeId

    host node id

    returns

    a set of random node id

    Definition Classes
    Node
  24. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  25. def isNeighbor(dir: GraphDir, nodeId: Int): Boolean

    whether nodeId is a neighbor in the allowing direction dir

    whether nodeId is a neighbor in the allowing direction dir

    dir

    the direction (inbound or outbound) that the method is applied to.

    nodeId

    the target node id.

    returns

    a boolean indicating whether nodeId is in the home node's neighbors.

    Definition Classes
    Node
  26. def isOutboundNode(nodeId: Int): Boolean

    Returns true if the this node point to the given node.

    Returns true if the this node point to the given node.

    nodeId

    home node id

    returns

    a boolean indicating whether outbound nodes contains nodeId.

    Definition Classes
    Node
  27. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  28. def neighborCount(dir: GraphDir): Int

    the neighbor count in the allowing direction dir

    the neighbor count in the allowing direction dir

    dir

    the direction (inbound or outbound) that the method is applied to.

    returns

    the number of neighbors in the direction of dir.

    Definition Classes
    Node
  29. def neighborIds(dir: GraphDir, max: Int): Seq[Int]

    A method that returns max nodes of either inbound or outbound allowing direction dir.

    A method that returns max nodes of either inbound or outbound allowing direction dir.

    dir

    the direction (inbound or outbound) that the method is applied to.

    max

    the maximum number of neighbors needed.

    returns

    a sequence of inbound or outbound neighbors.

    Definition Classes
    Node
  30. def neighborIds(dir: GraphDir): Seq[Int]

    A method that return either inbound or outbound allowing direction dir.

    A method that return either inbound or outbound allowing direction dir.

    dir

    the direction (inbound or outbound) that the method is applied to.

    returns

    a sequence of inbound or outbound neighbors.

    Definition Classes
    Node
  31. final def notify(): Unit

    Definition Classes
    AnyRef
  32. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  33. val outEdges: ArrayBuffer[Int]

    Attributes
    protected
  34. def outboundCount: Int

    returns

    the total number of outbound edges.

    Definition Classes
    Node
  35. def outboundNodes(): WrappedArray[Int]

    returns

    all nodes this node points to.

    Definition Classes
    SynchronizedDynamicNodeNode
  36. def outboundNodes(max: Int): Seq[Int]

    max

    the maximum number of outBound nodes needed.

    returns

    up to max nodes that this node points to.

    Definition Classes
    Node
  37. def randomInboundNode(rnd: Random): Option[Int]

    Returns a random node from the set of nodes that points to this node or else None if this node has no inbound edges, using the supplied random number generator rnd.

    Returns a random node from the set of nodes that points to this node or else None if this node has no inbound edges, using the supplied random number generator rnd.

    rnd

    user defined random number generator

    returns

    a random node id

    Definition Classes
    Node
  38. def randomInboundNode: Option[Int]

    Returns a random node from the set of nodes that points to this node or else None if this node has no inbound edges.

    Returns a random node from the set of nodes that points to this node or else None if this node has no inbound edges.

    The default implementation picks a random node from inboundNodes()* so subclasses should consider overriding this method if the Seq sequence they produce is not a IndexedSeq.

    returns

    a sequence of random node ids

    Definition Classes
    Node
  39. def randomInboundNodeSet(numResults: Int, rnd: Random): Seq[Int]

    Returns a random sample of size at most numResults from the set of nodes that point to this node using the supplied random number generator rnd.

    Returns a random sample of size at most numResults from the set of nodes that point to this node using the supplied random number generator rnd.

    numResults

    max number of random nodes needed

    rnd

    user defined random number generator

    returns

    a set of random node id

    Definition Classes
    Node
  40. def randomNeighbor(dir: GraphDir, rnd: Random): Option[Int]

    A method that returns a random node in the allowing direction dir, using the supplied random number generator rnd.

    A method that returns a random node in the allowing direction dir, using the supplied random number generator rnd.

    dir

    the direction (inbound or outbound) that the method is applied to.

    rnd

    a user defined random number generator.

    returns

    a random neighbor or None if no neighbor is in the direction dir.

    Definition Classes
    Node
  41. def randomNeighbor(dir: GraphDir): Option[Int]

    A method that returns a random node in the allowing direction dir.

    A method that returns a random node in the allowing direction dir.

    dir

    the direction (inbound or outbound) that the method is applied to.

    returns

    a random neighbor or None if no neighbor is in the direction dir.

    Definition Classes
    Node
  42. def randomNeighborSet(numResults: Int, dir: GraphDir, rnd: Random): Seq[Int]

    A method that returns a set of either inbound or outbound nodes of size numResults, in the allowing direction dir, using the supplied random number generator rnd.

    A method that returns a set of either inbound or outbound nodes of size numResults, in the allowing direction dir, using the supplied random number generator rnd.

    numResults

    maximum number of neighbors needed.

    dir

    the direction (inbound or outbound) that the method is applied to.

    rnd

    a user defined random number generator.

    returns

    a set of random neighbors.

    Definition Classes
    Node
  43. def randomNeighborSet(numResults: Int, dir: GraphDir): Seq[Int]

    A method that returns a random node of size numResults in the allowing direction dir, using the supplied random number generator rnd.

    A method that returns a random node of size numResults in the allowing direction dir, using the supplied random number generator rnd.

    numResults

    maximum number of neighbors needed.

    dir

    the direction (inbound or outbound) that the method is applied to.

    returns

    a set of random neighbors.

    Definition Classes
    Node
  44. def randomNode(nodeIds: Seq[Int], rnd: Random): Option[Int]

    rnd

    a user defined random number generator.

    returns

    a random node from nodeIds using a supplied random number generator rnd.

    Attributes
    protected
    Definition Classes
    Node
  45. def randomNodeSet(nodeIds: Seq[Int], numResults: Int, rnd: Random): Array[Int]

    Random sampling with replacement.

    Random sampling with replacement. Choose a set of random nodes of size numResults from nodeIds using a supplied random number generator rnd.

    numResults

    maximum number of nodes needed.

    rnd

    a user defined random number generator.

    returns

    a random node from nodeIds using a supplied random number generator rnd.

    Attributes
    protected
    Definition Classes
    Node
  46. def randomOutboundNode(rnd: Random): Option[Int]

    Returns a random node from the set of nodes that this node points to or else None if this node has no outbound edges, using the supplied random number generator rnd.

    Returns a random node from the set of nodes that this node points to or else None if this node has no outbound edges, using the supplied random number generator rnd.

    rnd

    a user defined random number generator.

    returns

    a random node that this node points to.

    Definition Classes
    Node
  47. def randomOutboundNode: Option[Int]

    Returns a random node from the set of nodes that this node points to or else None if this node has no outbound edges.

    Returns a random node from the set of nodes that this node points to or else None if this node has no outbound edges.

    The default implementation picks a random node from outboundNodes()* so subclasses should consider overriding this method if the Seq sequence they produce is not a lazy IndexedSeq.

    returns

    a random node that this node points to.

    Definition Classes
    Node
  48. def randomOutboundNodeSet(numResults: Int, rnd: Random): Seq[Int]

    Returns a random sample of size at most numResults from the set of nodes that this node points to using the supplied random number generator rnd.

    Returns a random sample of size at most numResults from the set of nodes that this node points to using the supplied random number generator rnd.

    rnd

    a user defined random number generator.

    returns

    a set of random nodes that this node points to.

    Definition Classes
    Node
  49. def removeInBoundNode(nodeId: Int): Unit

    Remove an inbound edge nodeId.

    Remove an inbound edge nodeId.

    Definition Classes
    SynchronizedDynamicNodeDynamicNode
  50. def removeOutBoundNode(nodeId: Int): Unit

    Remove an outbound edge nodeId.

    Remove an outbound edge nodeId.

    Definition Classes
    SynchronizedDynamicNodeDynamicNode
  51. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  52. def toString(): String

    Override toString to make debugging easier.

    Override toString to make debugging easier. It prints max of 10 neighbors in each direction.

    Definition Classes
    SynchronizedDynamicNodeNode → AnyRef → Any
  53. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  55. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from DynamicNode

Inherited from Node

Inherited from AnyRef

Inherited from Any

Ungrouped