Package org.mozilla.javascript
Class ObjArray
java.lang.Object
org.mozilla.javascript.ObjArray
- All Implemented Interfaces:
Serializable
Implementation of resizable array with focus on minimizing memory usage by storing few initial array elements in object fields. Can also be used as a stack.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
final void
final void
clear()
private void
ensureCapacity
(int minimalCapacity) final Object
get
(int index) private Object
getImpl
(int index) int
final boolean
isEmpty()
final boolean
isSealed()
int
lastIndexOf
(Object obj) private static RuntimeException
private static RuntimeException
onInvalidIndex
(int index, int upperBound) private static RuntimeException
final Object
peek()
final Object
pop()
final void
private void
final void
remove
(int index) final void
seal()
final void
private void
final void
setSize
(int newSize) final int
size()
final Object[]
toArray()
final void
final void
private void
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
size
private int size -
sealed
private boolean sealed -
FIELDS_STORE_SIZE
private static final int FIELDS_STORE_SIZE- See Also:
-
f0
-
f1
-
f2
-
f3
-
f4
-
data
-
-
Constructor Details
-
ObjArray
public ObjArray()
-
-
Method Details
-
isSealed
public final boolean isSealed() -
seal
public final void seal() -
isEmpty
public final boolean isEmpty() -
size
public final int size() -
setSize
public final void setSize(int newSize) -
get
-
set
-
getImpl
-
setImpl
-
indexOf
-
lastIndexOf
-
peek
-
pop
-
push
-
add
-
add
-
remove
public final void remove(int index) -
clear
public final void clear() -
toArray
-
toArray
-
toArray
-
ensureCapacity
private void ensureCapacity(int minimalCapacity) -
onInvalidIndex
-
onEmptyStackTopRead
-
onSeledMutation
-
writeObject
- Throws:
IOException
-
readObject
- Throws:
IOException
ClassNotFoundException
-