Class PYamlArray

  • All Implemented Interfaces:
    PArray

    public class PYamlArray
    extends PElement
    implements PArray
    Array wrapper for Yaml parsing.
    • Constructor Summary

      Constructors 
      Constructor Description
      PYamlArray​(PElement parent, java.util.List<java.lang.Object> array, java.lang.String contextName)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object get​(int i)
      Get the object at the given index.
      PArray getArray​(int i)
      Get the element at the index as a json array.
      boolean getBool​(int i)
      Get the element as a boolean.
      double getDouble​(int i)
      Get the element at the index as a double.
      float getFloat​(int i)
      Get the element at the index as a float.
      int getInt​(int i)
      Get the element at the index as an integer.
      long getLong​(int i)
      Get the element at the index as a long.
      PObject getObject​(int i)
      Get the element at the index as a object.
      java.lang.String getString​(int i)
      Get the element at the index as a string.
      int size()
      Return the size of the array.
      PJsonArray toJSON()
      Convert this object to a json array.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PYamlArray

        public PYamlArray​(PElement parent,
                          java.util.List<java.lang.Object> array,
                          java.lang.String contextName)
        Constructor.
        Parameters:
        parent - the parent object.
        array - the array to wrap
        contextName - the name of this object within the parent.
    • Method Detail

      • size

        public final int size()
        Description copied from interface: PArray
        Return the size of the array.
        Specified by:
        size in interface PArray
      • getObject

        public final PObject getObject​(int i)
        Description copied from interface: PArray
        Get the element at the index as a object.
        Specified by:
        getObject in interface PArray
        Parameters:
        i - the index of the object to access
      • getArray

        public final PArray getArray​(int i)
        Description copied from interface: PArray
        Get the element at the index as a json array.
        Specified by:
        getArray in interface PArray
        Parameters:
        i - the index of the element to access
      • getInt

        public final int getInt​(int i)
        Description copied from interface: PArray
        Get the element at the index as an integer.
        Specified by:
        getInt in interface PArray
        Parameters:
        i - the index of the element to access
      • getLong

        public final long getLong​(int i)
        Description copied from interface: PArray
        Get the element at the index as a long.
        Specified by:
        getLong in interface PArray
        Parameters:
        i - the index of the element to access
      • getFloat

        public final float getFloat​(int i)
        Description copied from interface: PArray
        Get the element at the index as a float.
        Specified by:
        getFloat in interface PArray
        Parameters:
        i - the index of the element to access
      • getDouble

        public final double getDouble​(int i)
        Description copied from interface: PArray
        Get the element at the index as a double.
        Specified by:
        getDouble in interface PArray
        Parameters:
        i - the index of the element to access
      • getString

        public final java.lang.String getString​(int i)
        Description copied from interface: PArray
        Get the element at the index as a string.
        Specified by:
        getString in interface PArray
        Parameters:
        i - the index of the element to access
      • getBool

        public final boolean getBool​(int i)
        Description copied from interface: PArray
        Get the element as a boolean.
        Specified by:
        getBool in interface PArray
        Parameters:
        i - the index of the element to access
      • get

        public final java.lang.Object get​(int i)
        Description copied from interface: PArray
        Get the object at the given index.
        Specified by:
        get in interface PArray
        Parameters:
        i - the index of the element to access
      • toString

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

        public final PJsonArray toJSON()
        Convert this object to a json array.