Class

com.twitter.cassovary.graph

NeighborsInCSeqNode

Related Doc: package graph

Permalink

class NeighborsInCSeqNode extends Node

Constructor for a default node with neighbors stored as CSeqs.

Linear Supertypes
Node, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NeighborsInCSeqNode
  2. Node
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

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

    Permalink

    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
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  12. val id: Int

    Permalink

    The unique id of this node.

    The unique id of this node.

    Definition Classes
    NeighborsInCSeqNodeNode
  13. def inboundCount: Int

    Permalink

    returns

    the total number of inbound edges.

    Definition Classes
    Node
  14. def inboundNodes(max: Int): CSeq[Int]

    Permalink

    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
  15. val inboundNodes: CSeq[Int]

    Permalink

    Returns ids of all nodes pointing to this node.

    Returns ids of all nodes pointing to this node.

    Definition Classes
    NeighborsInCSeqNodeNode
  16. def intersect(neighbors: CSeq[Int], nodeIds: CSeq[Int]): CSeq[Int]

    Permalink
    Attributes
    protected
    Definition Classes
    Node
  17. def intersect(dir: GraphDir, nodeIds: CSeq[Int]): CSeq[Int]

    Permalink

    returns

    Intersection of dir neighbors with nodeIds.

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

    Permalink

    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
  19. final def isInstanceOf[T0]: Boolean

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

    Permalink

    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
  21. def isOutboundNode(nodeId: Int): Boolean

    Permalink

    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
  22. final def ne(arg0: AnyRef): Boolean

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

    Permalink

    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
  24. def neighborIds(dir: GraphDir, max: Int): CSeq[Int]

    Permalink

    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
  25. def neighborIds(dir: GraphDir): CSeq[Int]

    Permalink

    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
  26. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  28. def outboundCount: Int

    Permalink

    returns

    the total number of outbound edges.

    Definition Classes
    Node
  29. def outboundNodes(max: Int): CSeq[Int]

    Permalink

    max

    the maximum number of outBound nodes needed.

    returns

    up to max nodes that this node points to.

    Definition Classes
    Node
  30. val outboundNodes: CSeq[Int]

    Permalink

    returns

    all nodes this node points to.

    Definition Classes
    NeighborsInCSeqNodeNode
  31. def randomInboundNode(rnd: Random): Option[Int]

    Permalink

    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
  32. def randomInboundNode: Option[Int]

    Permalink

    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
  33. def randomInboundNodeSet(numResults: Int, rnd: Random): Seq[Int]

    Permalink

    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
  34. def randomNeighbor(dir: GraphDir, rnd: Random): Option[Int]

    Permalink

    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
  35. def randomNeighbor(dir: GraphDir): Option[Int]

    Permalink

    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
  36. def randomNeighborSet(numResults: Int, dir: GraphDir, rnd: Random): Seq[Int]

    Permalink

    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
  37. def randomNeighborSet(numResults: Int, dir: GraphDir): Seq[Int]

    Permalink

    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
  38. def randomNode(nodeIds: CSeq[Int], rnd: Random): Option[Int]

    Permalink

    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
  39. def randomNodeSet(nodeIds: CSeq[Int], numResults: Int, rnd: Random): Array[Int]

    Permalink

    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
  40. def randomOutboundNode(rnd: Random): Option[Int]

    Permalink

    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
  41. def randomOutboundNode: Option[Int]

    Permalink

    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
  42. def randomOutboundNodeSet(numResults: Int, rnd: Random): Seq[Int]

    Permalink

    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
  43. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  44. def toString(): String

    Permalink

    Override toString to make debugging easier.

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

    Definition Classes
    Node → AnyRef → Any
  45. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Node

Inherited from AnyRef

Inherited from Any

Ungrouped