Class DoubleTag

java.lang.Object
com.viaversion.nbt.tag.DoubleTag
All Implemented Interfaces:
NumberTag, Tag

public final class DoubleTag extends Object implements NumberTag
A tag containing a double.
  • Field Details

  • Constructor Details

    • DoubleTag

      public DoubleTag(double value)
      Creates a tag.
      Parameters:
      value - The value of the tag.
  • Method Details

    • read

      public static DoubleTag read(DataInput in, TagLimiter tagLimiter) throws IOException
      Throws:
      IOException
    • getValue

      @Deprecated public Double getValue()
      Deprecated.
      Description copied from interface: NumberTag
      Gets the number value of this tag.
      Specified by:
      getValue in interface NumberTag
      Specified by:
      getValue in interface Tag
      Returns:
      Number value of this tag.
    • asRawString

      public String asRawString()
      Description copied from interface: Tag
      Returns the raw string representation of the value of this tag. For SNBT, use SNBT.serialize(Tag).
      Specified by:
      asRawString in interface Tag
      Returns:
      raw string representation of the value of this tag
    • write

      public void write(DataOutput out) throws IOException
      Description copied from interface: Tag
      Writes this tag to an output stream.
      Specified by:
      write in interface Tag
      Parameters:
      out - data output to write to
      Throws:
      IOException - if an I/O error occurs
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • asByte

      public byte asByte()
      Description copied from interface: NumberTag
      Gets the byte value of this tag.
      Specified by:
      asByte in interface NumberTag
      Returns:
      Byte value of this tag.
    • asShort

      public short asShort()
      Description copied from interface: NumberTag
      Gets the short value of this tag.
      Specified by:
      asShort in interface NumberTag
      Returns:
      Short value of this tag.
    • asInt

      public int asInt()
      Description copied from interface: NumberTag
      Gets the int value of this tag.
      Specified by:
      asInt in interface NumberTag
      Returns:
      Int value of this tag.
    • asLong

      public long asLong()
      Description copied from interface: NumberTag
      Gets the long value of this tag.
      Specified by:
      asLong in interface NumberTag
      Returns:
      Long value of this tag.
    • asFloat

      public float asFloat()
      Description copied from interface: NumberTag
      Gets the float value of this tag.
      Specified by:
      asFloat in interface NumberTag
      Returns:
      Float value of this tag.
    • asDouble

      public double asDouble()
      Description copied from interface: NumberTag
      Gets the double value of this tag.
      Specified by:
      asDouble in interface NumberTag
      Returns:
      Double value of this tag.
    • getTagId

      public int getTagId()
      Description copied from interface: Tag
      Returns the NBT tag id of this tag type, used in I/O.
      Specified by:
      getTagId in interface Tag
      Returns:
      ID of the tag this class represents
    • toString

      public String toString()
      Overrides:
      toString in class Object