Module syntaxnbt

Class TagNumber<N extends Number>

java.lang.Object
at.syntaxerror.syntaxnbt.tag.Tag<N>
at.syntaxerror.syntaxnbt.tag.TagNumber<N>
Type Parameters:
N - type of the number stored in this tag
Direct Known Subclasses:
TagByte, TagDouble, TagFloat, TagInt, TagLong, TagShort

public abstract class TagNumber<N extends Number> extends Tag<N>
Parent class for TagByte, TagShort, TagInt, TagLong, TagFloat, and TagDouble
Author:
SyntaxError404
  • Constructor Details

    • TagNumber

      protected TagNumber(TagType type, N number)
      Constructs a new tag with a type and an initial value
      Parameters:
      type - type of this tag
      number - initial value
  • Method Details

    • byteValue

      public byte byteValue()
      Returns the stored value casted to a byte
      Returns:
      the byte
    • shortValue

      public short shortValue()
      Returns the stored value casted to a short
      Returns:
      the short
    • intValue

      public int intValue()
      Returns the stored value casted to a int
      Returns:
      the int
    • longValue

      public long longValue()
      Returns the stored value casted to a long
      Returns:
      the long
    • floatValue

      public float floatValue()
      Returns the stored value casted to a float
      Returns:
      the float
    • doubleValue

      public double doubleValue()
      Returns the stored value casted to a double
      Returns:
      the double