nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ContinuousArrayData.java
equal
deleted
inserted
replaced
74 /** |
74 /** |
75 * Check if we can put one more element at the end of this continous |
75 * Check if we can put one more element at the end of this continous |
76 * array without reallocating, or if we are overwriting an already |
76 * array without reallocating, or if we are overwriting an already |
77 * allocated element |
77 * allocated element |
78 * |
78 * |
79 * @param index |
79 * @param index index to check |
80 * @return true if we don't need to do any array reallocation to fit an element at index |
80 * @return true if we don't need to do any array reallocation to fit an element at index |
81 */ |
81 */ |
82 public final boolean hasRoomFor(final int index) { |
82 public final boolean hasRoomFor(final int index) { |
83 return has(index) || (index == length() && ensure(index) == this); |
83 return has(index) || (index == length && ensure(index) == this); |
84 } |
84 } |
85 |
85 |
86 /** |
86 /** |
87 * Return element getter for a certain type at a certain program point |
87 * Return element getter for a certain type at a certain program point |
88 * @param returnType return type |
88 * @param returnType return type |