Package org.antlr.v4.runtime.misc
Class IntegerList
- java.lang.Object
- 
- org.antlr.v4.runtime.misc.IntegerList
 
- 
- Direct Known Subclasses:
- IntegerStack
 
 public class IntegerList extends Object - Author:
- Sam Harwell
 
- 
- 
Constructor SummaryConstructors Constructor Description IntegerList()IntegerList(int capacity)IntegerList(Collection<Integer> list)IntegerList(IntegerList list)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int value)voidaddAll(int[] array)voidaddAll(Collection<Integer> list)voidaddAll(IntegerList list)intbinarySearch(int key)intbinarySearch(int fromIndex, int toIndex, int key)voidclear()booleancontains(int value)booleanequals(Object o)Compares the specified object with this list for equality.intget(int index)inthashCode()Returns the hash code value for this list.booleanisEmpty()intremoveAt(int index)voidremoveRange(int fromIndex, int toIndex)intset(int index, int value)intsize()voidsort()int[]toArray()char[]toCharArray()Convert the int list to a char array where values > 0x7FFFF take 2 bytes.StringtoString()Returns a string representation of this list.voidtrimToSize()
 
- 
- 
- 
Constructor Detail- 
IntegerListpublic IntegerList() 
 - 
IntegerListpublic IntegerList(int capacity) 
 - 
IntegerListpublic IntegerList(IntegerList list) 
 - 
IntegerListpublic IntegerList(Collection<Integer> list) 
 
- 
 - 
Method Detail- 
addpublic final void add(int value) 
 - 
addAllpublic final void addAll(int[] array) 
 - 
addAllpublic final void addAll(IntegerList list) 
 - 
addAllpublic final void addAll(Collection<Integer> list) 
 - 
getpublic final int get(int index) 
 - 
containspublic final boolean contains(int value) 
 - 
setpublic final int set(int index, int value)
 - 
removeAtpublic final int removeAt(int index) 
 - 
removeRangepublic final void removeRange(int fromIndex, int toIndex)
 - 
isEmptypublic final boolean isEmpty() 
 - 
sizepublic final int size() 
 - 
trimToSizepublic final void trimToSize() 
 - 
clearpublic final void clear() 
 - 
toArraypublic final int[] toArray() 
 - 
sortpublic final void sort() 
 - 
equalspublic boolean equals(Object o) Compares the specified object with this list for equality. Returnstrueif and only if the specified object is also anIntegerList, both lists have the same size, and all corresponding pairs of elements in the two lists are equal. In other words, two lists are defined to be equal if they contain the same elements in the same order.This implementation first checks if the specified object is this list. If so, it returns true; if not, it checks if the specified object is anIntegerList. If not, it returnsfalse; if so, it checks the size of both lists. If the lists are not the same size, it returnsfalse; otherwise it iterates over both lists, comparing corresponding pairs of elements. If any comparison returnsfalse, this method returnsfalse.
 - 
hashCodepublic int hashCode() Returns the hash code value for this list.This implementation uses exactly the code that is used to define the list hash function in the documentation for the List.hashCode()method.
 - 
toStringpublic String toString() Returns a string representation of this list.
 - 
binarySearchpublic final int binarySearch(int key) 
 - 
binarySearchpublic final int binarySearch(int fromIndex, int toIndex, int key)
 - 
toCharArraypublic final char[] toCharArray() Convert the int list to a char array where values > 0x7FFFF take 2 bytes. TODO????? If all values are less than the 0x7FFF 16-bit code point limit (1 bit taken to indicatethen this is just a char array of 16-bit char as usual. For values in the supplementary range, encode them as two UTF-16 code units.
 
- 
 
-