Class VariantArrayBuilder

java.lang.Object
com.massifmaps.core.VariantArrayBuilder

public class VariantArrayBuilder extends Object
A helper class for building variant arrays.
  • Constructor Summary

    Constructors
    Constructor
    Description
    A default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addBool(boolean val)
    Adds a new boolean to the array as the last element.
    void
    addDouble(double val)
    Adds a new double floating point value to the array as the last element.
    void
    addLong(long val)
    Adds a new long integer to the array as the last element.
    void
    Adds a new string to the array as the last element.
    void
    Adds a new variant to the array as the last element.
    Builds a new array variant from the added elements.
    void
    Clears the array.
    boolean
    Checks if this object is equal to the specified object.
    int
    Returns the hash value of this object.

    Methods inherited from class java.lang.Object

    clone, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VariantArrayBuilder

      public VariantArrayBuilder()
      A default constructor.
  • Method Details

    • equals

      public boolean equals(Object obj)
      Checks if this object is equal to the specified object.
      Overrides:
      equals in class Object
      Parameters:
      obj - The reference object.
      Returns:
      True when objects are equal, false otherwise.
    • hashCode

      public int hashCode()
      Returns the hash value of this object.
      Overrides:
      hashCode in class Object
      Returns:
      The hash value of this object.
    • clear

      public void clear()
      Clears the array.
    • addString

      public void addString(String str)
      Adds a new string to the array as the last element.
      Parameters:
      str - The string to add.
    • addBool

      public void addBool(boolean val)
      Adds a new boolean to the array as the last element.
      Parameters:
      val - The boolean to add.
    • addLong

      public void addLong(long val)
      Adds a new long integer to the array as the last element.
      Parameters:
      val - The integer to add.
    • addDouble

      public void addDouble(double val)
      Adds a new double floating point value to the array as the last element.
      Parameters:
      val - The floating point value to add.
    • addVariant

      public void addVariant(Variant var)
      Adds a new variant to the array as the last element.
      Parameters:
      var - The variant to add.
    • buildVariant

      public Variant buildVariant()
      Builds a new array variant from the added elements.
      Returns:
      The corresponding variant object.