NodeItem (SelekTOR Java Documentation)
Date: 2017-04-14

client

## Class NodeItem

- java.lang.Object
- - client.NodeItem

- All Implemented Interfaces:
    java.lang.Cloneable

      public class NodeItem
      extends java.lang.Object
      implements java.lang.Cloneable

  Author:
    Alistair Neil

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `TESTSTATUS_FAILED`
    `static int` | `TESTSTATUS_PASSED`
    `static int` | `TESTSTATUS_UNKNOWN`
    `static int` | `TYPE_EXIT`
    `static int` | `TYPE_GUARD`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NodeItem()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clearType()` Clear node type
    `NodeItem` | `clone()`
    `float` | `getBandwidth()` Get nodeitem bandwith
    `java.lang.String` | `getCircuitHops()` Get circuit hops
    `java.lang.String` | `getCountryCode()` Get nodeitem two letter country code abbreviation
    `java.lang.String` | `getCountryName()` Get nodeitem full country name
    `java.lang.String` | `getFingerprint()` Get nodeitems fingerprint
    `java.lang.String` | `getIPAddress()` Get nodeitem ip address
    `long` | `getLatency()` Get Nodeitem latency in ms
    `java.lang.String` | `getNickName()` Get nodeitem unique name
    `java.lang.String` | `getStability()` Get Nodeitem stability
    `int` | `getStreams()` Get nodeitems active streams
    `java.lang.String` | `getTestingMessage()` Get Node item status
    `long` | `getTestLatency()` Get Nodeitem test latency in ms
    `int` | `getTestStatus()` Get testing status flag
    `boolean` | `isExit()` Is exit node
    `boolean` | `isFavourite()` Get exit enabled status of Nodeitem
    `boolean` | `isGuard()` Is Guard node
    `boolean` | `isGuardEnabled()` Get guard enabled status of Nodeitem
    `boolean` | `isHttpSupported()`
    `boolean` | `isNonUnique()`
    `void` | `setBandwidth(float bw)` Set node item bandwidth
    `void` | `setCircuitHops(java.lang.String hops)` Set circuit hops
    `void` | `setCountryCode(java.lang.String abrv)` Set Nodeitem with its two letter country code abbreviation
    `void` | `setCountryName(java.lang.String name)` Set Nodeitem with its full country name
    `void` | `setFavouriteEnabled(boolean enabled)` Set exit enabled status of Nodeitem
    `void` | `setFingerprint(java.lang.String fp)` Set nodeitem fingerprint
    `void` | `setGuardEnabled(boolean enabled)` Set guard enabled status of Nodeitem
    `void` | `setHttpSupported(boolean supported)`
    `void` | `setIPAddress(java.lang.String ip)` Set nodeitem ip address
    `void` | `setLatency(long latency)` Set Nodeitem latency value in ms
    `void` | `setNickName(java.lang.String name)` Set nodeitem name
    `void` | `setStable(java.lang.String stability)` Set Nodeitem stability yes/no/unknown
    `void` | `setStreams(int streams)` Set nodeitem number of streams
    `void` | `setTestingMessage(java.lang.String text)` Set Nodeitem testing status message
    `void` | `setTestLatency(long latency)` Set Nodeitem test latency value in ms
    `void` | `setTestStatus(int status)` Set testing status flag
    `void` | `setType(int mask)` Set Node type

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### TYPE_EXIT

          public static final int TYPE_EXIT

      See Also:
        Constant Field Values

    - #### TYPE_GUARD

          public static final int TYPE_GUARD

      See Also:
        Constant Field Values

    - #### TESTSTATUS_UNKNOWN

          public static final int TESTSTATUS_UNKNOWN

      See Also:
        Constant Field Values

    - #### TESTSTATUS_PASSED

          public static final int TESTSTATUS_PASSED

      See Also:
        Constant Field Values

    - #### TESTSTATUS_FAILED

          public static final int TESTSTATUS_FAILED

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### NodeItem

          public NodeItem()

  - ### Method Detail

    - #### setType

          public final void setType(int mask)

      Set Node type
      Parameters:
        `mask` -

    - #### clearType

          public final void clearType()

      Clear node type

    - #### isNonUnique

          public boolean isNonUnique()

    - #### isExit

          public final boolean isExit()

      Is exit node
      Returns:
        true if an exit node

    - #### isHttpSupported

          public boolean isHttpSupported()

    - #### setHttpSupported

          public void setHttpSupported(boolean supported)

    - #### isGuard

          public final boolean isGuard()

      Is Guard node
      Returns:
        true if guard node

    - #### setCircuitHops

          public final void setCircuitHops(java.lang.String hops)

      Set circuit hops
      Parameters:
        `hops` -

    - #### getCircuitHops

          public final java.lang.String getCircuitHops()

      Get circuit hops
      Returns:
        Circuit hops as String

    - #### setTestingMessage

          public final void setTestingMessage(java.lang.String text)

      Set Nodeitem testing status message
      Parameters:
        `text` -

    - #### setTestStatus

          public final void setTestStatus(int status)

      Set testing status flag
      Parameters:
        `status` -

    - #### getTestStatus

          public final int getTestStatus()

      Get testing status flag
      Returns:
        test status

    - #### getTestingMessage

          public final java.lang.String getTestingMessage()

      Get Node item status
      Returns:
        Nodeitem testing status message as string

    - #### setLatency

          public final void setLatency(long latency)

      Set Nodeitem latency value in ms
      Parameters:
        `latency` -

    - #### getLatency

          public final long getLatency()

      Get Nodeitem latency in ms
      Returns:
        Latency value in ms

    - #### setTestLatency

          public final void setTestLatency(long latency)

      Set Nodeitem test latency value in ms
      Parameters:
        `latency` -

    - #### getTestLatency

          public final long getTestLatency()

      Get Nodeitem test latency in ms
      Returns:
        Latency value in ms

    - #### setFavouriteEnabled

          public final void setFavouriteEnabled(boolean enabled)

      Set exit enabled status of Nodeitem
      Parameters:
        `enabled` -

    - #### isFavourite

          public final boolean isFavourite()

      Get exit enabled status of Nodeitem
      Returns:
        true if enabled

    - #### setGuardEnabled

          public final void setGuardEnabled(boolean enabled)

      Set guard enabled status of Nodeitem
      Parameters:
        `enabled` -

    - #### isGuardEnabled

          public final boolean isGuardEnabled()

      Get guard enabled status of Nodeitem
      Returns:
        true if enabled

    - #### setStable

          public final void setStable(java.lang.String stability)

      Set Nodeitem stability yes/no/unknown
      Parameters:
        `stability` -

    - #### getStability

          public final java.lang.String getStability()

      Get Nodeitem stability
      Returns:
        Stability

    - #### setCountryCode

          public final void setCountryCode(java.lang.String abrv)

      Set Nodeitem with its two letter country code abbreviation
      Parameters:
        `abrv` -

    - #### getCountryCode

          public final java.lang.String getCountryCode()

      Get nodeitem two letter country code abbreviation
      Returns:
        Country code as string

    - #### setCountryName

          public final void setCountryName(java.lang.String name)

      Set Nodeitem with its full country name
      Parameters:
        `name` -

    - #### getCountryName

          public final java.lang.String getCountryName()

      Get nodeitem full country name
      Returns:
        Country name as string

    - #### setNickName

          public final void setNickName(java.lang.String name)

      Set nodeitem name
      Parameters:
        `name` -

    - #### getNickName

          public final java.lang.String getNickName()

      Get nodeitem unique name
      Returns:
        Node name as string

    - #### setBandwidth

          public final void setBandwidth(float bw)

      Set node item bandwidth
      Parameters:
        `bw` -

    - #### getBandwidth

          public final float getBandwidth()

      Get nodeitem bandwith
      Returns:
        Bandwidth as long, in kb/s

    - #### setStreams

          public final void setStreams(int streams)

      Set nodeitem number of streams
      Parameters:
        `streams` -

    - #### getStreams

          public final int getStreams()

      Get nodeitems active streams
      Returns:
        Number of active streams as int

    - #### setFingerprint

          public final void setFingerprint(java.lang.String fp)

      Set nodeitem fingerprint
      Parameters:
        `fp` -

    - #### getFingerprint

          public final java.lang.String getFingerprint()

      Get nodeitems fingerprint
      Returns:
        Tor node fingerprint as string

    - #### setIPAddress

          public final void setIPAddress(java.lang.String ip)

      Set nodeitem ip address
      Parameters:
        `ip` -

    - #### getIPAddress

          public final java.lang.String getIPAddress()

      Get nodeitem ip address
      Returns:
        IP address as a string

    - #### clone

          public NodeItem clone()

      Overrides:
        `clone` in class `java.lang.Object`