com.ibm.tivoli.maximo.oslc.provider

Class OslcJSONObjectList

  • All Implemented Interfaces:
    java.lang.Iterable, java.util.Collection, java.util.List


    public class OslcJSONObjectList
    extends ObjectList
    implements java.util.List
    • Constructor Summary

      Constructors 
      Constructor and Description
      OslcJSONObjectList()
      Default Constructor
      OslcJSONObjectList(com.ibm.json.java.JSONArray c, java.lang.String osName, java.lang.String objectPath, java.lang.String messageType, UserInfo userInfo, boolean leanJson)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void add(int index, java.lang.Object element)
      Adds object to ObjectList for specific index
      boolean add(java.lang.Object o)
      Adds object to ObjectList at the end
      boolean addAll(java.util.Collection c)
      Adds collection to ObjectList at the end
      boolean addAll(int index, java.util.Collection c)
      Adds collection to ObjectList at the index specified
      void clear()
      Clears ObjectList object
      boolean contains(java.lang.Object o)
      Checks if ObjectList have object
      boolean containsAll(java.util.Collection c)
      Checks if ObjectList have collection
      java.lang.Object get(int index)
      Return object for specified index
      java.util.List getList()
      Gets List from ObjectList
      int indexOf(java.lang.Object o)
      Returns index of the object in ObjectList
      boolean isEmpty()
      Return indicator if ObjectList empty or not
      java.util.Iterator iterator()
      Get ObjectList iterator
      int lastIndexOf(java.lang.Object o)
      Returns last index of the object in ObjectList
      java.util.ListIterator listIterator()
      Get ObjectList list iterator
      java.util.ListIterator listIterator(int index)
      Get ObjectList list iterator for specific index
      java.lang.Object remove(int index)
      Remove object from ObjectList for specified index
      boolean remove(java.lang.Object o)
      Remove object from ObjectList for specified index
      boolean removeAll(java.util.Collection c)
      Remove collection of objects from ObjectList
      boolean retainAll(java.util.Collection c)
      Checks if ObjectList have collection
      java.lang.Object set(int index, java.lang.Object element) 
      int size()
      Return size of the ObjectList
      java.util.List subList(int fromIndex, int toIndex)
      Gets Sub List from ObjectList from to index
      java.lang.Object[] toArray()
      Converts ObjectList to array
      java.lang.Object[] toArray(java.lang.Object[] a)
      Converts ObjectList to object array
      java.util.Collection toJSONCollection(java.util.Collection c)
      Converts Colleaction to Element Colleaction
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.List

        equals, hashCode, replaceAll, sort, spliterator
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream
      • Methods inherited from interface java.lang.Iterable

        forEach
    • Constructor Detail

      • OslcJSONObjectList

        public OslcJSONObjectList()
        Default Constructor
      • OslcJSONObjectList

        public OslcJSONObjectList(com.ibm.json.java.JSONArray c,
                                  java.lang.String osName,
                                  java.lang.String objectPath,
                                  java.lang.String messageType,
                                  UserInfo userInfo,
                                  boolean leanJson)
        Constructor
        Parameters:
        c - Original List.
    • Method Detail

      • size

        public int size()
        Return size of the ObjectList
        Specified by:
        size in interface java.util.Collection
        Specified by:
        size in interface java.util.List
        Overrides:
        size in class ObjectList
        Returns:
        ObjectList size
      • clear

        public void clear()
        Clears ObjectList object
        Specified by:
        clear in interface java.util.Collection
        Specified by:
        clear in interface java.util.List
        Overrides:
        clear in class ObjectList
      • isEmpty

        public boolean isEmpty()
        Return indicator if ObjectList empty or not
        Specified by:
        isEmpty in interface java.util.Collection
        Specified by:
        isEmpty in interface java.util.List
        Overrides:
        isEmpty in class ObjectList
        Returns:
        is ObjectList empty or not
      • toArray

        public java.lang.Object[] toArray()
        Converts ObjectList to array
        Specified by:
        toArray in interface java.util.Collection
        Specified by:
        toArray in interface java.util.List
        Overrides:
        toArray in class ObjectList
        Returns:
        Object array
      • get

        public java.lang.Object get(int index)
        Return object for specified index
        Specified by:
        get in interface java.util.List
        Overrides:
        get in class ObjectList
        Returns:
        Object from ObjectList
      • remove

        public java.lang.Object remove(int index)
        Remove object from ObjectList for specified index
        Specified by:
        remove in interface java.util.List
        Overrides:
        remove in class ObjectList
        Parameters:
        index - Index of object to be removed
        Returns:
        Object which as removed
      • add

        public void add(int index,
                        java.lang.Object element)
        Adds object to ObjectList for specific index
        Specified by:
        add in interface java.util.List
        Overrides:
        add in class ObjectList
        Parameters:
        index - Index of object to be added
        element - Object to be added
      • indexOf

        public int indexOf(java.lang.Object o)
        Returns index of the object in ObjectList
        Specified by:
        indexOf in interface java.util.List
        Overrides:
        indexOf in class ObjectList
        Parameters:
        o - Object to be checked
        Returns:
        index of the object in the ObjectList
      • lastIndexOf

        public int lastIndexOf(java.lang.Object o)
        Returns last index of the object in ObjectList
        Specified by:
        lastIndexOf in interface java.util.List
        Overrides:
        lastIndexOf in class ObjectList
        Parameters:
        o - Object to be checked
        Returns:
        index of the object in the ObjectList
      • add

        public boolean add(java.lang.Object o)
        Adds object to ObjectList at the end
        Specified by:
        add in interface java.util.Collection
        Specified by:
        add in interface java.util.List
        Overrides:
        add in class ObjectList
        Parameters:
        o - Object to be added
      • contains

        public boolean contains(java.lang.Object o)
        Checks if ObjectList have object
        Specified by:
        contains in interface java.util.Collection
        Specified by:
        contains in interface java.util.List
        Overrides:
        contains in class ObjectList
        Parameters:
        o - Object to be added
        Returns:
        indicator if ObjectLit contain object
      • remove

        public boolean remove(java.lang.Object o)
        Remove object from ObjectList for specified index
        Specified by:
        remove in interface java.util.Collection
        Specified by:
        remove in interface java.util.List
        Overrides:
        remove in class ObjectList
        Parameters:
        o - Object which as removed
        Returns:
        indicator if remove was succesful
      • addAll

        public boolean addAll(int index,
                              java.util.Collection c)
        Adds collection to ObjectList at the index specified
        Specified by:
        addAll in interface java.util.List
        Overrides:
        addAll in class ObjectList
        Parameters:
        index - Index of collection to be added
        c - Colleaction to be added
        Returns:
        indicator if add was succesful
      • addAll

        public boolean addAll(java.util.Collection c)
        Adds collection to ObjectList at the end
        Specified by:
        addAll in interface java.util.Collection
        Specified by:
        addAll in interface java.util.List
        Overrides:
        addAll in class ObjectList
        Parameters:
        c - Colleaction to be added
        Returns:
        indicator if add was succesful
      • containsAll

        public boolean containsAll(java.util.Collection c)
        Checks if ObjectList have collection
        Specified by:
        containsAll in interface java.util.Collection
        Specified by:
        containsAll in interface java.util.List
        Overrides:
        containsAll in class ObjectList
        Parameters:
        c - Collection to check
        Returns:
        indicator if ObjectLit contain collection
      • removeAll

        public boolean removeAll(java.util.Collection c)
        Remove collection of objects from ObjectList
        Specified by:
        removeAll in interface java.util.Collection
        Specified by:
        removeAll in interface java.util.List
        Overrides:
        removeAll in class ObjectList
        Parameters:
        c - Collection to remove
        Returns:
        indicator if ObjectLit removed collection
      • retainAll

        public boolean retainAll(java.util.Collection c)
        Checks if ObjectList have collection
        Specified by:
        retainAll in interface java.util.Collection
        Specified by:
        retainAll in interface java.util.List
        Overrides:
        retainAll in class ObjectList
        Parameters:
        c - Collection to retail
        Returns:
        indicator if ObjectLit retained collection
      • iterator

        public java.util.Iterator iterator()
        Get ObjectList iterator
        Specified by:
        iterator in interface java.lang.Iterable
        Specified by:
        iterator in interface java.util.Collection
        Specified by:
        iterator in interface java.util.List
        Overrides:
        iterator in class ObjectList
        Returns:
        ObjectList iterator
      • subList

        public java.util.List subList(int fromIndex,
                                      int toIndex)
        Gets Sub List from ObjectList from to index
        Specified by:
        subList in interface java.util.List
        Overrides:
        subList in class ObjectList
        Parameters:
        fromIndex - from index
        toIndex - to index
        Returns:
        sub list
      • listIterator

        public java.util.ListIterator listIterator()
        Get ObjectList list iterator
        Specified by:
        listIterator in interface java.util.List
        Overrides:
        listIterator in class ObjectList
        Returns:
        ObjectList list iterator
      • listIterator

        public java.util.ListIterator listIterator(int index)
        Get ObjectList list iterator for specific index
        Specified by:
        listIterator in interface java.util.List
        Overrides:
        listIterator in class ObjectList
        Parameters:
        index - to iterate
        Returns:
        ObjectList list iterator
      • set

        public java.lang.Object set(int index,
                                    java.lang.Object element)
        Specified by:
        set in interface java.util.List
        Overrides:
        set in class ObjectList
      • toArray

        public java.lang.Object[] toArray(java.lang.Object[] a)
        Converts ObjectList to object array
        Specified by:
        toArray in interface java.util.Collection
        Specified by:
        toArray in interface java.util.List
        Overrides:
        toArray in class ObjectList
        Parameters:
        a - object to convert
        Returns:
        Converted Object list
      • toJSONCollection

        public java.util.Collection toJSONCollection(java.util.Collection c)
        Converts Colleaction to Element Colleaction
        Parameters:
        c - collection to convert
        Returns:
        Converted Colleaction
      • getList

        public java.util.List getList()
        Gets List from ObjectList
        Overrides:
        getList in class ObjectList
        Returns:
        list