aa
|
Public Member Functions | |
AryInt () | |
AryInt (int[] es) | |
AryInt (int[] es, int len) | |
AryInt | addAll (Collection<? extends Integer > c) |
AryInt | addAll (int[] es) |
int[] | asAry () |
int | at (int i) |
int | atX (int i) |
int | binary_search (int e) |
void | clear () |
Remove all elements. More... | |
int | del (int i) |
Fast, constant-time, element removal. More... | |
boolean | equals (Object o) |
int | find (int e) |
Find the first matching element using ==, or -1 if none. More... | |
int | hashCode () |
void | insert (int i, int e) |
Slow, linear-time, element insert. More... | |
boolean | isEmpty () |
int | last () |
int | len () |
AryInt | map_update (IntUnaryOperator f) |
int | pop () |
AryInt | push (int e) |
Add element in amortized constant time. More... | |
int | remove (int i) |
Slow, linear-time, element removal. More... | |
int | set (int i, int e) |
AryInt | set_as (int e) |
AryInt | set_len (int len) |
int | setX (int i, int e) |
void | sort_update () |
Sorts in-place. More... | |
String | toString () |
Public Attributes | |
int[] | _es |
int | _len |
Private Member Functions | |
void | range_check (int i) |
Definition at line 8 of file AryInt.java.
com.cliffc.aa.util.AryInt.AryInt | ( | int[] | es | ) |
Definition at line 11 of file AryInt.java.
com.cliffc.aa.util.AryInt.AryInt | ( | int[] | es, |
int | len | ||
) |
Definition at line 12 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, com.cliffc.aa.util.AryInt._len, and com.cliffc.aa.util.AryInt.len().
com.cliffc.aa.util.AryInt.AryInt | ( | ) |
Definition at line 13 of file AryInt.java.
Referenced by com.cliffc.aa.util.AryInt.equals().
AryInt com.cliffc.aa.util.AryInt.addAll | ( | Collection<? extends Integer > | c | ) |
c | Collection to be added |
Definition at line 109 of file AryInt.java.
References com.cliffc.aa.util.AryInt.push().
AryInt com.cliffc.aa.util.AryInt.addAll | ( | int[] | es | ) |
es | Array to be added |
Definition at line 112 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, and com.cliffc.aa.util.AryInt._len.
int [] com.cliffc.aa.util.AryInt.asAry | ( | ) |
Definition at line 123 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, and com.cliffc.aa.util.AryInt._len.
int com.cliffc.aa.util.AryInt.at | ( | int | i | ) |
i | element index |
Definition at line 21 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, and com.cliffc.aa.util.AryInt.range_check().
Referenced by com.cliffc.aa.Parse.errLocMsg().
int com.cliffc.aa.util.AryInt.atX | ( | int | i | ) |
i | element index |
Definition at line 27 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, and com.cliffc.aa.util.AryInt._len.
Referenced by com.cliffc.aa.util.IBitSet._clr(), com.cliffc.aa.util.IBitSet._set(), com.cliffc.aa.util.IBitSet._tst(), com.cliffc.aa.util.IBitSet.or(), com.cliffc.aa.util.IBitSet.subtract(), and com.cliffc.aa.util.IBitSet.xd().
int com.cliffc.aa.util.AryInt.binary_search | ( | int | e | ) |
Definition at line 150 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, and com.cliffc.aa.util.AryInt._len.
Referenced by com.cliffc.aa.Parse.apply(), and com.cliffc.aa.Parse.errLocMsg().
void com.cliffc.aa.util.AryInt.clear | ( | ) |
Remove all elements.
Definition at line 84 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, and com.cliffc.aa.util.AryInt._len.
Referenced by com.cliffc.aa.util.IBitSet.clear().
int com.cliffc.aa.util.AryInt.del | ( | int | i | ) |
Fast, constant-time, element removal.
Does not preserve order
i | element to be removed |
Definition at line 66 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, com.cliffc.aa.util.AryInt._len, and com.cliffc.aa.util.AryInt.range_check().
boolean com.cliffc.aa.util.AryInt.equals | ( | Object | o | ) |
Definition at line 169 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, com.cliffc.aa.util.AryInt._len, and com.cliffc.aa.util.AryInt.AryInt().
int com.cliffc.aa.util.AryInt.find | ( | int | e | ) |
Find the first matching element using ==, or -1 if none.
Note that most del calls shuffle the list, so the first element might be random.
e | intlement to find |
Definition at line 131 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, and com.cliffc.aa.util.AryInt._len.
int com.cliffc.aa.util.AryInt.hashCode | ( | ) |
Definition at line 180 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, and com.cliffc.aa.util.AryInt._len.
void com.cliffc.aa.util.AryInt.insert | ( | int | i, |
int | e | ||
) |
Slow, linear-time, element insert.
Preserves order.
i | index to insert at, between 0 and _len inclusive. |
e | intlement to insert |
Definition at line 55 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, and com.cliffc.aa.util.AryInt._len.
boolean com.cliffc.aa.util.AryInt.isEmpty | ( | ) |
Definition at line 16 of file AryInt.java.
References com.cliffc.aa.util.AryInt._len.
Referenced by com.cliffc.aa.type.TypeMem.all_reaching_aliases().
int com.cliffc.aa.util.AryInt.last | ( | ) |
Definition at line 31 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, com.cliffc.aa.util.AryInt._len, and com.cliffc.aa.util.AryInt.range_check().
Referenced by com.cliffc.aa.util.IBitSet._clr(), com.cliffc.aa.util.IBitSet.max(), and com.cliffc.aa.Parse.skipWS().
int com.cliffc.aa.util.AryInt.len | ( | ) |
Definition at line 18 of file AryInt.java.
References com.cliffc.aa.util.AryInt._len.
Referenced by com.cliffc.aa.util.AryInt.AryInt(), and com.cliffc.aa.util.AryInt.set_len().
AryInt com.cliffc.aa.util.AryInt.map_update | ( | IntUnaryOperator | f | ) |
Definition at line 120 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, and com.cliffc.aa.util.AryInt._len.
int com.cliffc.aa.util.AryInt.pop | ( | ) |
Definition at line 37 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, com.cliffc.aa.util.AryInt._len, and com.cliffc.aa.util.AryInt.range_check().
Referenced by com.cliffc.aa.util.IBitSet._clr(), and com.cliffc.aa.type.TypeMem.all_reaching_aliases().
AryInt com.cliffc.aa.util.AryInt.push | ( | int | e | ) |
Add element in amortized constant time.
e | element to add at end of list |
Definition at line 45 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, and com.cliffc.aa.util.AryInt._len.
Referenced by com.cliffc.aa.util.AryInt.addAll(), com.cliffc.aa.type.TypeMem.all_reaching_aliases(), com.cliffc.aa.Parse.Parse(), and com.cliffc.aa.Parse.skipWS().
|
private |
Definition at line 143 of file AryInt.java.
References com.cliffc.aa.util.AryInt._len.
Referenced by com.cliffc.aa.util.AryInt.at(), com.cliffc.aa.util.AryInt.del(), com.cliffc.aa.util.AryInt.last(), com.cliffc.aa.util.AryInt.pop(), com.cliffc.aa.util.AryInt.remove(), and com.cliffc.aa.util.AryInt.set().
int com.cliffc.aa.util.AryInt.remove | ( | int | i | ) |
Slow, linear-time, element removal.
Preserves order.
i | element to be removed |
Definition at line 76 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, com.cliffc.aa.util.AryInt._len, and com.cliffc.aa.util.AryInt.range_check().
int com.cliffc.aa.util.AryInt.set | ( | int | i, |
int | e | ||
) |
Definition at line 93 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, and com.cliffc.aa.util.AryInt.range_check().
AryInt com.cliffc.aa.util.AryInt.set_as | ( | int | e | ) |
Definition at line 98 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, and com.cliffc.aa.util.AryInt._len.
AryInt com.cliffc.aa.util.AryInt.set_len | ( | int | len | ) |
Definition at line 99 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, com.cliffc.aa.util.AryInt._len, and com.cliffc.aa.util.AryInt.len().
int com.cliffc.aa.util.AryInt.setX | ( | int | i, |
int | e | ||
) |
Definition at line 87 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, and com.cliffc.aa.util.AryInt._len.
Referenced by com.cliffc.aa.util.IBitSet._clr(), com.cliffc.aa.util.IBitSet._set(), com.cliffc.aa.util.IBitSet.or(), and com.cliffc.aa.util.IBitSet.subtract().
void com.cliffc.aa.util.AryInt.sort_update | ( | ) |
Sorts in-place.
Definition at line 126 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, and com.cliffc.aa.util.AryInt._len.
String com.cliffc.aa.util.AryInt.toString | ( | ) |
Definition at line 136 of file AryInt.java.
References com.cliffc.aa.util.AryInt._es, com.cliffc.aa.util.AryInt._len, com.cliffc.aa.util.SB.p(), com.cliffc.aa.util.SB.toString(), and com.cliffc.aa.util.SB.unchar().
int [] com.cliffc.aa.util.AryInt._es |
Definition at line 9 of file AryInt.java.
Referenced by com.cliffc.aa.util.AryInt.addAll(), com.cliffc.aa.util.AryInt.AryInt(), com.cliffc.aa.util.AryInt.asAry(), com.cliffc.aa.util.AryInt.at(), com.cliffc.aa.util.AryInt.atX(), com.cliffc.aa.util.AryInt.binary_search(), com.cliffc.aa.util.IBitSet.bitCount(), com.cliffc.aa.util.AryInt.clear(), com.cliffc.aa.util.AryInt.del(), com.cliffc.aa.util.AryInt.equals(), com.cliffc.aa.util.AryInt.find(), com.cliffc.aa.util.AryInt.hashCode(), com.cliffc.aa.util.IBitSet.Iter.hasNext(), com.cliffc.aa.util.AryInt.insert(), com.cliffc.aa.util.AryInt.last(), com.cliffc.aa.util.AryInt.map_update(), com.cliffc.aa.util.AryInt.pop(), com.cliffc.aa.util.AryInt.push(), com.cliffc.aa.util.AryInt.remove(), com.cliffc.aa.util.AryInt.set(), com.cliffc.aa.util.AryInt.set_as(), com.cliffc.aa.util.AryInt.set_len(), com.cliffc.aa.util.AryInt.setX(), com.cliffc.aa.util.AryInt.sort_update(), com.cliffc.aa.util.AryInt.toString(), and com.cliffc.aa.util.IBitSet.wd().
int com.cliffc.aa.util.AryInt._len |
Definition at line 10 of file AryInt.java.
Referenced by com.cliffc.aa.util.IBitSet._clr(), com.cliffc.aa.util.AryInt.addAll(), com.cliffc.aa.util.AryInt.AryInt(), com.cliffc.aa.util.AryInt.asAry(), com.cliffc.aa.util.AryInt.atX(), com.cliffc.aa.util.AryInt.binary_search(), com.cliffc.aa.util.IBitSet.bitCount(), com.cliffc.aa.util.AryInt.clear(), com.cliffc.aa.util.AryInt.del(), com.cliffc.aa.util.IBitSet.disjoint(), com.cliffc.aa.util.AryInt.equals(), com.cliffc.aa.Parse.errLocMsg(), com.cliffc.aa.util.AryInt.find(), com.cliffc.aa.util.AryInt.hashCode(), com.cliffc.aa.util.IBitSet.Iter.hasNext(), com.cliffc.aa.util.AryInt.insert(), com.cliffc.aa.util.IBitSet.is_empty(), com.cliffc.aa.util.AryInt.isEmpty(), com.cliffc.aa.util.AryInt.last(), com.cliffc.aa.util.AryInt.len(), com.cliffc.aa.util.AryInt.map_update(), com.cliffc.aa.util.IBitSet.max(), com.cliffc.aa.util.IBitSet.Iter.next(), com.cliffc.aa.util.IBitSet.or(), com.cliffc.aa.util.AryInt.pop(), com.cliffc.aa.util.AryInt.push(), com.cliffc.aa.util.AryInt.range_check(), com.cliffc.aa.util.AryInt.remove(), com.cliffc.aa.util.AryInt.set_as(), com.cliffc.aa.util.AryInt.set_len(), com.cliffc.aa.util.AryInt.setX(), com.cliffc.aa.util.AryInt.sort_update(), com.cliffc.aa.util.IBitSet.subsetsX(), com.cliffc.aa.util.IBitSet.subtract(), com.cliffc.aa.util.IBitSet.toString(), and com.cliffc.aa.util.AryInt.toString().