Class TreeNetIdBase

java.lang.Object
alexiil.mc.lib.net.TreeNetIdBase
Direct Known Subclasses:
NetIdBase, ParentNetIdBase

public abstract class TreeNetIdBase
extends java.lang.Object
The base class for all networking ID's. Most of the time you should use one of the subclasses: either the parent node ParentNetIdBase, or the leaf node NetIdBase.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static int DYNAMIC_LENGTH  
    java.lang.String fullName
    Used for logging and display purposes only.
    int length
    The length of this ID alone.
    java.lang.String name
    The name - must be unique to the parent that uses it, so for top level mod packets this MUST include the modid.
    ParentNetIdBase parent  
    int totalLength
    Full length including all parents.
  • Constructor Summary

    Constructors 
    Constructor Description
    TreeNetIdBase​(ParentNetIdBase parent, java.lang.String name, int thisLength)  
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object obj)  
    protected java.lang.String getPrintableName()  
    protected java.lang.String getRealClassName()  
    boolean hasFixedLength()  
    int hashCode()  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • DYNAMIC_LENGTH

      public static final int DYNAMIC_LENGTH
      See Also:
      Constant Field Values
    • name

      public final java.lang.String name
      The name - must be unique to the parent that uses it, so for top level mod packets this MUST include the modid.
    • fullName

      public final java.lang.String fullName
      Used for logging and display purposes only.
    • length

      public final int length
      The length of this ID alone. Might not be a sensible number even if totalLength is.
    • totalLength

      public final int totalLength
      Full length including all parents.
    • parent

      public final ParentNetIdBase parent
  • Constructor Details

  • Method Details

    • toString

      public final java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • getPrintableName

      protected java.lang.String getPrintableName()
    • getRealClassName

      protected final java.lang.String getRealClassName()
    • equals

      public final boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • hasFixedLength

      public final boolean hasFixedLength()
      Returns:
      True if the total length of this NetId (the entire path, including it's header) is a fixed length (and so the length doesn't need to be written out each time it is sent), or false otherwise.