Class LongArray

java.lang.Object
org.yamcs.utils.LongArray

public class LongArray extends Object
long array
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a sorted int array with a default initial capacity
    LongArray(int capacity)
    Creates an IntArray with a given initial capacity
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(int pos, long x)
     
    void
    add(long x)
    add value to the array
    long[]
    get the backing array.
    boolean
     
    long
    get(int pos)
    get element at position
    int
     
    boolean
     
    void
    set(int pos, long x)
     
    int
     
    long[]
     
     
    static LongArray
    wrap(long... array)
    Creates the IntArray with the backing array

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • DEFAULT_CAPACITY

      public static int DEFAULT_CAPACITY
  • Constructor Details

    • LongArray

      public LongArray()
      Creates a sorted int array with a default initial capacity
    • LongArray

      public LongArray(int capacity)
      Creates an IntArray with a given initial capacity
      Parameters:
      capacity -
  • Method Details

    • wrap

      public static LongArray wrap(long... array)
      Creates the IntArray with the backing array
      Parameters:
      array -
    • add

      public void add(long x)
      add value to the array
      Parameters:
      x - - value to be added
    • add

      public void add(int pos, long x)
    • get

      public long get(int pos)
      get element at position
      Parameters:
      pos -
      Returns:
    • isEmpty

      public boolean isEmpty()
    • toArray

      public long[] toArray()
    • size

      public int size()
    • set

      public void set(int pos, long x)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • array

      public long[] array()
      get the backing array. It's length will be ≥ than the size of the array.
      Returns: