code
stringlengths 11
173k
| docstring
stringlengths 2
593k
| func_name
stringlengths 2
189
| language
stringclasses 1
value | repo
stringclasses 844
values | path
stringlengths 11
294
| url
stringlengths 60
339
| license
stringclasses 4
values |
---|---|---|---|---|---|---|---|
private static Animator animateScaleX(View v, float target) {
return ObjectAnimator.ofFloat(v, View.SCALE_X, target);
} |
Returns an animator for the view's scaleX value.
| FastScroller::animateScaleX | java | Reginer/aosp-android-jar | android-34/src/android/widget/FastScroller.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java | MIT |
private static Animator animateAlpha(View v, float alpha) {
return ObjectAnimator.ofFloat(v, View.ALPHA, alpha);
} |
Returns an animator for the view's alpha value.
| FastScroller::animateAlpha | java | Reginer/aosp-android-jar | android-34/src/android/widget/FastScroller.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java | MIT |
private static Property<View, Integer> LEFT = new IntProperty<View>("left") {
@Override
public void setValue(View object, int value) {
object.setLeft(value);
}
@Override
public Integer get(View object) {
return object.getLeft();
}
}; |
A Property wrapper around the <code>left</code> functionality handled by the
{@link View#setLeft(int)} and {@link View#getLeft()} methods.
| FastScroller::IntProperty<View> | java | Reginer/aosp-android-jar | android-34/src/android/widget/FastScroller.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java | MIT |
private static Property<View, Integer> TOP = new IntProperty<View>("top") {
@Override
public void setValue(View object, int value) {
object.setTop(value);
}
@Override
public Integer get(View object) {
return object.getTop();
}
}; |
A Property wrapper around the <code>top</code> functionality handled by the
{@link View#setTop(int)} and {@link View#getTop()} methods.
| FastScroller::IntProperty<View> | java | Reginer/aosp-android-jar | android-34/src/android/widget/FastScroller.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java | MIT |
private static Property<View, Integer> RIGHT = new IntProperty<View>("right") {
@Override
public void setValue(View object, int value) {
object.setRight(value);
}
@Override
public Integer get(View object) {
return object.getRight();
}
}; |
A Property wrapper around the <code>right</code> functionality handled by the
{@link View#setRight(int)} and {@link View#getRight()} methods.
| FastScroller::IntProperty<View> | java | Reginer/aosp-android-jar | android-34/src/android/widget/FastScroller.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java | MIT |
private static Property<View, Integer> BOTTOM = new IntProperty<View>("bottom") {
@Override
public void setValue(View object, int value) {
object.setBottom(value);
}
@Override
public Integer get(View object) {
return object.getBottom();
}
}; |
A Property wrapper around the <code>bottom</code> functionality handled by the
{@link View#setBottom(int)} and {@link View#getBottom()} methods.
| FastScroller::IntProperty<View> | java | Reginer/aosp-android-jar | android-34/src/android/widget/FastScroller.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java | MIT |
private static Animator animateBounds(View v, Rect bounds) {
final PropertyValuesHolder left = PropertyValuesHolder.ofInt(LEFT, bounds.left);
final PropertyValuesHolder top = PropertyValuesHolder.ofInt(TOP, bounds.top);
final PropertyValuesHolder right = PropertyValuesHolder.ofInt(RIGHT, bounds.right);
final PropertyValuesHolder bottom = PropertyValuesHolder.ofInt(BOTTOM, bounds.bottom);
return ObjectAnimator.ofPropertyValuesHolder(v, left, top, right, bottom);
} |
Returns an animator for the view's bounds.
| FastScroller::animateBounds | java | Reginer/aosp-android-jar | android-34/src/android/widget/FastScroller.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java | MIT |
public final void addListener(ScreenInteractiveChangedListener listener) {
mListeners.add(listener);
} |
Add a listener for changes to screen interactive state. Callbacks occur on an unspecified
thread.
| ScreenInteractiveHelper::addListener | java | Reginer/aosp-android-jar | android-33/src/com/android/server/location/injector/ScreenInteractiveHelper.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/server/location/injector/ScreenInteractiveHelper.java | MIT |
public final void removeListener(ScreenInteractiveChangedListener listener) {
mListeners.remove(listener);
} |
Removes a listener for changes to screen interactive state.
| ScreenInteractiveHelper::removeListener | java | Reginer/aosp-android-jar | android-33/src/com/android/server/location/injector/ScreenInteractiveHelper.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/server/location/injector/ScreenInteractiveHelper.java | MIT |
public NativeCronetEngineBuilderImpl(Context context) {
super(context);
} |
Builder for Native Cronet Engine.
Default config enables SPDY, disables QUIC and HTTP cache.
@param context Android {@link Context} for engine to use.
| NativeCronetEngineBuilderImpl::NativeCronetEngineBuilderImpl | java | Reginer/aosp-android-jar | android-34/src/org/chromium/net/impl/NativeCronetEngineBuilderImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/chromium/net/impl/NativeCronetEngineBuilderImpl.java | MIT |
public boolean needsClippingToShelf() {
return true;
} |
@return if this view needs to be clipped to the shelf
| ExpandableView::needsClippingToShelf | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public void setActualHeight(int actualHeight, boolean notifyListeners) {
mActualHeight = actualHeight;
updateClipping();
if (notifyListeners) {
notifyHeightChanged(false /* needsAnimation */);
}
} |
Sets the actual height of this notification. This is different than the laid out
{@link View#getHeight()}, as we want to avoid layouting during scrolling and expanding.
@param actualHeight The height of this notification.
@param notifyListeners Whether the listener should be informed about the change.
| ExpandableView::setActualHeight | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public int getActualHeight() {
return mActualHeight;
} |
See {@link #setActualHeight}.
@return The current actual height of this notification.
| ExpandableView::getActualHeight | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public int getMaxContentHeight() {
return getHeight();
} |
@return The maximum height of this notification.
| ExpandableView::getMaxContentHeight | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public int getMinHeight() {
return getMinHeight(false /* ignoreTemporaryStates */);
} |
@return The minimum content height of this notification. This also respects the temporary
states of the view.
| ExpandableView::getMinHeight | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public int getMinHeight(boolean ignoreTemporaryStates) {
return getHeight();
} |
Get the minimum height of this view.
@param ignoreTemporaryStates should temporary states be ignored like the guts or heads-up.
@return The minimum height that this view needs.
| ExpandableView::getMinHeight | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public int getCollapsedHeight() {
return getHeight();
} |
@return The collapsed height of this view. Note that this might be different
than {@link #getMinHeight()} because some elements like groups may have different sizes when
they are system expanded.
| ExpandableView::getCollapsedHeight | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public void setDimmed(boolean dimmed, boolean fade) {
} |
Sets the notification as dimmed. The default implementation does nothing.
@param dimmed Whether the notification should be dimmed.
@param fade Whether an animation should be played to change the state.
| ExpandableView::setDimmed | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public void setHideSensitiveForIntrinsicHeight(boolean hideSensitive) {
} |
See {@link #setHideSensitive}. This is a variant which notifies this view in advance about
the upcoming state of hiding sensitive notifications. It gets called at the very beginning
of a stack scroller update such that the updated intrinsic height (which is dependent on
whether private or public layout is showing) gets taken into account into all layout
calculations.
| ExpandableView::setHideSensitiveForIntrinsicHeight | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public void setHideSensitive(boolean hideSensitive, boolean animated, long delay,
long duration) {
} |
Sets whether the notification should hide its private contents if it is sensitive.
| ExpandableView::setHideSensitive | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public int getIntrinsicHeight() {
return getHeight();
} |
@return The desired notification height.
| ExpandableView::getIntrinsicHeight | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public void setClipTopAmount(int clipTopAmount) {
mClipTopAmount = clipTopAmount;
updateClipping();
} |
Sets the amount this view should be clipped from the top. This is used when an expanded
notification is scrolling in the top or bottom stack.
@param clipTopAmount The amount of pixels this view should be clipped from top.
| ExpandableView::setClipTopAmount | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public void setClipBottomAmount(int clipBottomAmount) {
mClipBottomAmount = clipBottomAmount;
updateClipping();
} |
Set the amount the the notification is clipped on the bottom in addition to the regular
clipping. This is mainly used to clip something in a non-animated way without changing the
actual height of the notification and is purely visual.
@param clipBottomAmount the amount to clip.
| ExpandableView::setClipBottomAmount | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public boolean isContentExpandable() {
return false;
} |
@return Whether we can expand this views content.
| ExpandableView::isContentExpandable | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public void setBelowSpeedBump(boolean below) {
} |
Set the notification appearance to be below the speed bump.
@param below true if it is below.
| ExpandableView::setBelowSpeedBump | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public void setTranslation(float translation) {
setTranslationX(translation);
} |
Sets the translation of the view.
| ExpandableView::setTranslation | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public float getTranslation() {
return getTranslationX();
} |
Gets the translation of the view.
| ExpandableView::getTranslation | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public void removeFromTransientContainer() {
final ViewGroup transientContainer = getTransientContainer();
if (transientContainer == null) {
return;
}
final ViewParent parent = getParent();
if (parent != transientContainer) {
Log.w(TAG, "Expandable view " + this
+ " has transient container " + transientContainer
+ " but different parent " + parent);
setTransientContainer(null);
return;
}
transientContainer.removeTransientView(this);
setTransientContainer(null);
} |
Called when removing a view from its transient container, such as at the end of an animation.
Generally, when operating on ExpandableView instances, this should be used rather than
{@link ExpandableView#removeTransientView(View)} to ensure that the
{@link #getTransientContainer() transient container} is correctly reset.
| ExpandableView::removeFromTransientContainer | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public void removeFromTransientContainerForAdditionTo(ViewGroup newParent) {
final ViewParent parent = getParent();
final ViewGroup transientContainer = getTransientContainer();
if (parent == null || parent == newParent) {
// If this view's current parent is null or the same as the new parent, the add will
// succeed as long as it's a true child, so just make sure the view isn't transient.
removeFromTransientContainer();
return;
}
if (transientContainer == null) {
throw new IllegalStateException("Can't add view " + this + " to container " + newParent
+ "; current parent " + parent + " is not a transient container");
}
if (transientContainer != parent) {
// Crash with details before addView() crashes without any; the view is being added
// to a different parent, and the transient container isn't the parent, so we can't
// even (safely) clean that up.
throw new IllegalStateException("Expandable view " + this
+ " has transient container " + transientContainer
+ " but different parent " + parent);
}
Log.w(TAG, "Removing view " + this + " from transient container "
+ transientContainer + " in preparation for moving to parent " + newParent);
transientContainer.removeTransientView(this);
setTransientContainer(null);
} |
Called before adding this view to a group, which would always throw an exception if this view
has a different parent, so clean up the transient container and throw an exception if the
parent isn't a transient container. Provide as much detail as possible in the crash.
| ExpandableView::removeFromTransientContainerForAdditionTo | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public int getExtraBottomPadding() {
return 0;
} |
@return padding used to alter how much of the view is clipped.
| ExpandableView::getExtraBottomPadding | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public boolean isGroupExpansionChanging() {
return false;
} |
@return true if the group's expansion state is changing, false otherwise.
| ExpandableView::isGroupExpansionChanging | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public ExpandableViewState resetViewState() {
// initialize with the default values of the view
mViewState.height = getIntrinsicHeight();
mViewState.gone = getVisibility() == View.GONE;
mViewState.alpha = 1f;
mViewState.notGoneIndex = -1;
mViewState.xTranslation = getTranslationX();
mViewState.hidden = false;
mViewState.scaleX = getScaleX();
mViewState.scaleY = getScaleY();
mViewState.inShelf = false;
mViewState.headsUpIsVisible = false;
// handling reset for child notifications
if (this instanceof ExpandableNotificationRow) {
ExpandableNotificationRow row = (ExpandableNotificationRow) this;
List<ExpandableNotificationRow> children = row.getAttachedChildren();
if (row.isSummaryWithChildren() && children != null) {
for (ExpandableNotificationRow childRow : children) {
childRow.resetViewState();
}
}
}
return mViewState;
} |
@return true if the group's expansion state is changing, false otherwise.
public boolean isGroupExpansionChanging() {
return false;
}
public boolean isGroupExpanded() {
return false;
}
public void setHeadsUpIsVisible() {
}
public boolean showingPulsing() {
return false;
}
public boolean isChildInGroup() {
return false;
}
public void setActualHeightAnimating(boolean animating) {}
protected ExpandableViewState createExpandableViewState() {
return new ExpandableViewState();
}
/** Sets {@link ExpandableViewState} to default state. | ExpandableView::resetViewState | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public void applyViewState() {
if (!mViewState.gone) {
mViewState.applyToView(this);
}
} |
@return true if the group's expansion state is changing, false otherwise.
public boolean isGroupExpansionChanging() {
return false;
}
public boolean isGroupExpanded() {
return false;
}
public void setHeadsUpIsVisible() {
}
public boolean showingPulsing() {
return false;
}
public boolean isChildInGroup() {
return false;
}
public void setActualHeightAnimating(boolean animating) {}
protected ExpandableViewState createExpandableViewState() {
return new ExpandableViewState();
}
/** Sets {@link ExpandableViewState} to default state.
public ExpandableViewState resetViewState() {
// initialize with the default values of the view
mViewState.height = getIntrinsicHeight();
mViewState.gone = getVisibility() == View.GONE;
mViewState.alpha = 1f;
mViewState.notGoneIndex = -1;
mViewState.xTranslation = getTranslationX();
mViewState.hidden = false;
mViewState.scaleX = getScaleX();
mViewState.scaleY = getScaleY();
mViewState.inShelf = false;
mViewState.headsUpIsVisible = false;
// handling reset for child notifications
if (this instanceof ExpandableNotificationRow) {
ExpandableNotificationRow row = (ExpandableNotificationRow) this;
List<ExpandableNotificationRow> children = row.getAttachedChildren();
if (row.isSummaryWithChildren() && children != null) {
for (ExpandableNotificationRow childRow : children) {
childRow.resetViewState();
}
}
}
return mViewState;
}
@Nullable public ExpandableViewState getViewState() {
return mViewState;
}
/** Applies internal {@link ExpandableViewState} to this view. | ExpandableView::applyViewState | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public boolean hasNoContentHeight() {
return false;
} |
@return whether the current view doesn't add height to the overall content. This means that
if it is added to a list of items, its content will still have the same height.
An example is the notification shelf, that is always placed on top of another view.
| ExpandableView::hasNoContentHeight | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public void setInShelf(boolean inShelf) {
mInShelf = inShelf;
} |
@param inShelf whether the view is currently fully in the notification shelf.
| ExpandableView::setInShelf | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public View getShelfTransformationTarget() {
return null;
} |
@return get the transformation target of the shelf, which usually is the icon
| ExpandableView::getShelfTransformationTarget | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public int getRelativeTopPadding(View view) {
int topPadding = 0;
while (view.getParent() instanceof ViewGroup) {
topPadding += view.getTop();
view = (View) view.getParent();
if (view == this) {
return topPadding;
}
}
return topPadding;
} |
Get the relative top padding of a view relative to this view. This recursively walks up the
hierarchy and does the corresponding measuring.
@param view the view to get the padding for. The requested view has to be a child of this
notification.
@return the toppadding
| ExpandableView::getRelativeTopPadding | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public int getRelativeStartPadding(View view) {
boolean isRtl = isLayoutRtl();
int startPadding = 0;
while (view.getParent() instanceof ViewGroup) {
View parent = (View) view.getParent();
startPadding += isRtl ? parent.getWidth() - view.getRight() : view.getLeft();
view = parent;
if (view == this) {
return startPadding;
}
}
return startPadding;
} |
Get the relative start padding of a view relative to this view. This recursively walks up the
hierarchy and does the corresponding measuring.
@param view the view to get the padding for. The requested view has to be a child of this
notification.
@return the start padding
| ExpandableView::getRelativeStartPadding | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public void setContentTransformationAmount(float contentTransformationAmount,
boolean isLastChild) {
boolean changeTransformation = isLastChild != mIsLastChild;
changeTransformation |= mContentTransformationAmount != contentTransformationAmount;
mIsLastChild = isLastChild;
mContentTransformationAmount = contentTransformationAmount;
if (changeTransformation) {
updateContentTransformation();
}
} |
Set how much this notification is transformed into the shelf.
@param contentTransformationAmount A value from 0 to 1 indicating how much we are transformed
to the content away
@param isLastChild is this the last child in the list. If true, then the transformation is
different since its content fades out.
| ExpandableView::setContentTransformationAmount | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
protected void updateContentTransformation() {
float translationY = -mContentTransformationAmount * getContentTransformationShift();
float contentAlpha = 1.0f - mContentTransformationAmount;
contentAlpha = Math.min(contentAlpha / 0.5f, 1.0f);
contentAlpha = Interpolators.ALPHA_OUT.getInterpolation(contentAlpha);
if (mIsLastChild) {
translationY *= 0.4f;
}
mContentTranslation = translationY;
applyContentTransformation(contentAlpha, translationY);
} |
Update the content representation based on the amount we are transformed into the shelf.
| ExpandableView::updateContentTransformation | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
protected float getContentTransformationShift() {
return mContentShift;
} |
@return how much the content shifts up when going into the shelf
| ExpandableView::getContentTransformationShift | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
protected void applyContentTransformation(float contentAlpha, float translationY) {
} |
Apply the contentTransformation when going into the shelf.
@param contentAlpha The alpha that should be applied
@param translationY the translationY that should be applied
| ExpandableView::applyContentTransformation | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public void setTransformingInShelf(boolean transformingInShelf) {
mTransformingInShelf = transformingInShelf;
} |
@param transformingInShelf whether the view is currently transforming into the shelf in an
animated way
| ExpandableView::setTransformingInShelf | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public float getContentTranslation() {
return mContentTranslation;
} |
return the amount that the content is translated
| ExpandableView::getContentTranslation | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public void setFirstInSection(boolean firstInSection) {
mFirstInSection = firstInSection;
} |
return the amount that the content is translated
public float getContentTranslation() {
return mContentTranslation;
}
/** Sets whether this view is the first notification in a section. | ExpandableView::setFirstInSection | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public void setLastInSection(boolean lastInSection) {
mLastInSection = lastInSection;
} |
return the amount that the content is translated
public float getContentTranslation() {
return mContentTranslation;
}
/** Sets whether this view is the first notification in a section.
public void setFirstInSection(boolean firstInSection) {
mFirstInSection = firstInSection;
}
/** Sets whether this view is the last notification in a section. | ExpandableView::setLastInSection | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public boolean setTopRoundness(float topRoundness, boolean animate) {
return false;
} |
Set the topRoundness of this view.
@return Whether the roundness was changed.
| ExpandableView::setTopRoundness | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public boolean setBottomRoundness(float bottomRoundness, boolean animate) {
return false;
} |
Set the bottom roundness of this view.
@return Whether the roundness was changed.
| ExpandableView::setBottomRoundness | java | Reginer/aosp-android-jar | android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/ExpandableView.java | MIT |
public Builder(@NonNull String namespace) {
mNamespace = Objects.requireNonNull(namespace);
} |
Returns a map from schema type to property paths to be used for projection.
<p>If the map is empty, then all properties will be retrieved for all results.
<p>A more efficient version of {@link #getProjections}, but it returns a modifiable map. This
is not meant to be unhidden and should only be used by internal classes.
@hide
@NonNull
public Map<String, List<String>> getProjectionsInternal() {
return mTypePropertyPathsMap;
}
/** Builder for {@link GetByDocumentIdRequest} objects.
public static final class Builder {
private final String mNamespace;
private ArraySet<String> mIds = new ArraySet<>();
private ArrayMap<String, List<String>> mProjectionTypePropertyPaths = new ArrayMap<>();
private boolean mBuilt = false;
/** Creates a {@link GetByDocumentIdRequest.Builder} instance. | Builder::Builder | java | Reginer/aosp-android-jar | android-31/src/android/app/appsearch/GetByDocumentIdRequest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/app/appsearch/GetByDocumentIdRequest.java | MIT |
public IllegalFormatCodePointException(int c) {
this.c = c;
} |
Constructs an instance of this class with the specified illegal code
point as defined by {@link Character#isValidCodePoint}.
@param c
The illegal Unicode code point
| IllegalFormatCodePointException::IllegalFormatCodePointException | java | Reginer/aosp-android-jar | android-31/src/java/util/IllegalFormatCodePointException.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/util/IllegalFormatCodePointException.java | MIT |
public int getCodePoint() {
return c;
} |
Returns the illegal code point as defined by {@link
Character#isValidCodePoint}.
@return The illegal Unicode code point
| IllegalFormatCodePointException::getCodePoint | java | Reginer/aosp-android-jar | android-31/src/java/util/IllegalFormatCodePointException.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/util/IllegalFormatCodePointException.java | MIT |
void saveToDisk() {
mConversationStore.saveConversationsToDisk();
mEventStore.saveToDisk();
} |
Returns a map of package directory names as keys and their associated {@link PackageData}.
This should be called when device is powered on and unlocked.
@WorkerThread
@NonNull
static Map<String, PackageData> packagesDataFromDisk(@UserIdInt int userId,
@NonNull Predicate<String> isDefaultDialerPredicate,
@NonNull Predicate<String> isDefaultSmsAppPredicate,
@NonNull ScheduledExecutorService scheduledExecutorService,
@NonNull File perUserPeopleDataDir) {
Map<String, PackageData> results = new ArrayMap<>();
File[] packageDirs = perUserPeopleDataDir.listFiles(File::isDirectory);
if (packageDirs == null) {
return results;
}
for (File packageDir : packageDirs) {
PackageData packageData = new PackageData(packageDir.getName(), userId,
isDefaultDialerPredicate, isDefaultSmsAppPredicate, scheduledExecutorService,
perUserPeopleDataDir);
packageData.loadFromDisk();
results.put(packageDir.getName(), packageData);
}
return results;
}
private void loadFromDisk() {
mConversationStore.loadConversationsFromDisk();
mEventStore.loadFromDisk();
}
/** Called when device is shutting down. | PackageData::saveToDisk | java | Reginer/aosp-android-jar | android-31/src/com/android/server/people/data/PackageData.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/people/data/PackageData.java | MIT |
public void forAllConversations(@NonNull Consumer<ConversationInfo> consumer) {
mConversationStore.forAllConversations(consumer);
} |
Returns a map of package directory names as keys and their associated {@link PackageData}.
This should be called when device is powered on and unlocked.
@WorkerThread
@NonNull
static Map<String, PackageData> packagesDataFromDisk(@UserIdInt int userId,
@NonNull Predicate<String> isDefaultDialerPredicate,
@NonNull Predicate<String> isDefaultSmsAppPredicate,
@NonNull ScheduledExecutorService scheduledExecutorService,
@NonNull File perUserPeopleDataDir) {
Map<String, PackageData> results = new ArrayMap<>();
File[] packageDirs = perUserPeopleDataDir.listFiles(File::isDirectory);
if (packageDirs == null) {
return results;
}
for (File packageDir : packageDirs) {
PackageData packageData = new PackageData(packageDir.getName(), userId,
isDefaultDialerPredicate, isDefaultSmsAppPredicate, scheduledExecutorService,
perUserPeopleDataDir);
packageData.loadFromDisk();
results.put(packageDir.getName(), packageData);
}
return results;
}
private void loadFromDisk() {
mConversationStore.loadConversationsFromDisk();
mEventStore.loadFromDisk();
}
/** Called when device is shutting down.
void saveToDisk() {
mConversationStore.saveConversationsToDisk();
mEventStore.saveToDisk();
}
@NonNull
public String getPackageName() {
return mPackageName;
}
public @UserIdInt int getUserId() {
return mUserId;
}
/** Iterates over all the conversations in this package. | PackageData::forAllConversations | java | Reginer/aosp-android-jar | android-31/src/com/android/server/people/data/PackageData.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/people/data/PackageData.java | MIT |
void deleteDataForConversation(String shortcutId) {
ConversationInfo conversationInfo = mConversationStore.deleteConversation(shortcutId);
if (conversationInfo == null) {
return;
}
mEventStore.deleteEventHistory(CATEGORY_SHORTCUT_BASED, shortcutId);
if (conversationInfo.getLocusId() != null) {
mEventStore.deleteEventHistory(
CATEGORY_LOCUS_ID_BASED, conversationInfo.getLocusId().getId());
}
String phoneNumber = conversationInfo.getContactPhoneNumber();
if (!TextUtils.isEmpty(phoneNumber)) {
if (isDefaultDialer()) {
mEventStore.deleteEventHistory(CATEGORY_CALL, phoneNumber);
}
if (isDefaultSmsApp()) {
mEventStore.deleteEventHistory(CATEGORY_SMS, phoneNumber);
}
}
} |
Deletes all the data (including conversation, events and index) for the specified
conversation shortcut ID.
| PackageData::deleteDataForConversation | java | Reginer/aosp-android-jar | android-31/src/com/android/server/people/data/PackageData.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/people/data/PackageData.java | MIT |
void pruneOrphanEvents() {
mEventStore.pruneOrphanEventHistories(CATEGORY_SHORTCUT_BASED,
key -> mConversationStore.getConversation(key) != null);
mEventStore.pruneOrphanEventHistories(CATEGORY_LOCUS_ID_BASED,
key -> mConversationStore.getConversationByLocusId(new LocusId(key)) != null);
if (isDefaultDialer()) {
mEventStore.pruneOrphanEventHistories(CATEGORY_CALL,
key -> mConversationStore.getConversationByPhoneNumber(key) != null);
}
if (isDefaultSmsApp()) {
mEventStore.pruneOrphanEventHistories(CATEGORY_SMS,
key -> mConversationStore.getConversationByPhoneNumber(key) != null);
}
} |
Deletes all the data (including conversation, events and index) for the specified
conversation shortcut ID.
void deleteDataForConversation(String shortcutId) {
ConversationInfo conversationInfo = mConversationStore.deleteConversation(shortcutId);
if (conversationInfo == null) {
return;
}
mEventStore.deleteEventHistory(CATEGORY_SHORTCUT_BASED, shortcutId);
if (conversationInfo.getLocusId() != null) {
mEventStore.deleteEventHistory(
CATEGORY_LOCUS_ID_BASED, conversationInfo.getLocusId().getId());
}
String phoneNumber = conversationInfo.getContactPhoneNumber();
if (!TextUtils.isEmpty(phoneNumber)) {
if (isDefaultDialer()) {
mEventStore.deleteEventHistory(CATEGORY_CALL, phoneNumber);
}
if (isDefaultSmsApp()) {
mEventStore.deleteEventHistory(CATEGORY_SMS, phoneNumber);
}
}
}
/** Prunes the events and index data that don't have a associated conversation. | PackageData::pruneOrphanEvents | java | Reginer/aosp-android-jar | android-31/src/com/android/server/people/data/PackageData.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/people/data/PackageData.java | MIT |
public LightingColorFilter(@ColorInt int mul, @ColorInt int add) {
mMul = mul;
mAdd = add;
} |
Create a colorfilter that multiplies the RGB channels by one color,
and then adds a second color. The alpha components of the mul and add
arguments are ignored.
| LightingColorFilter::LightingColorFilter | java | Reginer/aosp-android-jar | android-32/src/android/graphics/LightingColorFilter.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/graphics/LightingColorFilter.java | MIT |
static String calculateResponse(String algorithm, String username_value, String realm_value,
String passwd, String nonce_value, String nc_value, String cnonce_value,
String method, String digest_uri_value, String entity_body, String qop_value,
StackLogger stackLogger) {
if (stackLogger.isLoggingEnabled()) {
stackLogger.logDebug("trying to authenticate using : " + algorithm + ", "
+ username_value + ", " + realm_value + ", "
+ (passwd != null && passwd.trim().length() > 0) + ", " + nonce_value + ", "
+ nc_value + ", " + cnonce_value + ", " + method + ", " + digest_uri_value
+ ", " + entity_body + ", " + qop_value);
}
if (username_value == null || realm_value == null || passwd == null || method == null
|| digest_uri_value == null || nonce_value == null)
throw new NullPointerException(
"Null parameter to MessageDigestAlgorithm.calculateResponse()");
// The following follows closely the algorithm for generating a response
// digest as specified by rfc2617
String A1 = null;
if (algorithm == null || algorithm.trim().length() == 0
|| algorithm.trim().equalsIgnoreCase("MD5")) {
A1 = username_value + ":" + realm_value + ":" + passwd;
} else {
if (cnonce_value == null || cnonce_value.length() == 0)
throw new NullPointerException(
"cnonce_value may not be absent for MD5-Sess algorithm.");
A1 = H(username_value + ":" + realm_value + ":" + passwd) + ":" + nonce_value + ":"
+ cnonce_value;
}
String A2 = null;
if (qop_value == null || qop_value.trim().length() == 0
|| qop_value.trim().equalsIgnoreCase("auth")) {
A2 = method + ":" + digest_uri_value;
} else {
if (entity_body == null)
entity_body = "";
A2 = method + ":" + digest_uri_value + ":" + H(entity_body);
}
String request_digest = null;
if (cnonce_value != null && qop_value != null && nc_value != null
&& (qop_value.equalsIgnoreCase("auth") || qop_value.equalsIgnoreCase("auth-int")))
{
request_digest = KD(H(A1), nonce_value + ":" + nc_value + ":" + cnonce_value + ":"
+ qop_value + ":" + H(A2));
} else {
request_digest = KD(H(A1), nonce_value + ":" + H(A2));
}
return request_digest;
} |
Calculates an http authentication response in accordance with rfc2617.
<p>
@param algorithm a string indicating a pair of algorithms (MD5 (default), or MD5-sess) used
to produce the digest and a checksum.
@param username_value username_value (see rfc2617)
@param realm_value A string that has been displayed to the user in order to determine the
context of the username and password to use.
@param passwd the password to encode in the challenge response.
@param nonce_value A server-specified data string provided in the challenge.
@param cnonce_value an optional client-chosen value whose purpose is to foil chosen
plaintext attacks.
@param method the SIP method of the request being challenged.
@param digest_uri_value the value of the "uri" directive on the Authorization header in the
request.
@param entity_body the entity-body
@param qop_value Indicates what "quality of protection" the client has applied to the
message.
@param nc_value the hexadecimal count of the number of requests (including the current
request) that the client has sent with the nonce value in this request.
@return a digest response as defined in rfc2617
@throws NullPointerException in case of incorrectly null parameters.
| MessageDigestAlgorithm::calculateResponse | java | Reginer/aosp-android-jar | android-35/src/gov/nist/javax/sip/clientauthutils/MessageDigestAlgorithm.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/gov/nist/javax/sip/clientauthutils/MessageDigestAlgorithm.java | MIT |
private static String H(String data) {
try {
MessageDigest digest = MessageDigest.getInstance("MD5");
return toHexString(digest.digest(data.getBytes()));
} catch (NoSuchAlgorithmException ex) {
// shouldn't happen
throw new RuntimeException("Failed to instantiate an MD5 algorithm", ex);
}
} |
Defined in rfc 2617 as H(data) = MD5(data);
@param data data
@return MD5(data)
| MessageDigestAlgorithm::H | java | Reginer/aosp-android-jar | android-35/src/gov/nist/javax/sip/clientauthutils/MessageDigestAlgorithm.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/gov/nist/javax/sip/clientauthutils/MessageDigestAlgorithm.java | MIT |
private static String KD(String secret, String data) {
return H(secret + ":" + data);
} |
Defined in rfc 2617 as KD(secret, data) = H(concat(secret, ":", data))
@param data data
@param secret secret
@return H(concat(secret, ":", data));
| MessageDigestAlgorithm::KD | java | Reginer/aosp-android-jar | android-35/src/gov/nist/javax/sip/clientauthutils/MessageDigestAlgorithm.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/gov/nist/javax/sip/clientauthutils/MessageDigestAlgorithm.java | MIT |
private static String toHexString(byte b[]) {
int pos = 0;
char[] c = new char[b.length * 2];
for (int i = 0; i < b.length; i++) {
c[pos++] = toHex[(b[i] >> 4) & 0x0F];
c[pos++] = toHex[b[i] & 0x0f];
}
return new String(c);
} |
Converts b[] to hex string.
@param b the bte array to convert
@return a Hex representation of b.
| MessageDigestAlgorithm::toHexString | java | Reginer/aosp-android-jar | android-35/src/gov/nist/javax/sip/clientauthutils/MessageDigestAlgorithm.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/gov/nist/javax/sip/clientauthutils/MessageDigestAlgorithm.java | MIT |
public Builder(
@NonNull Metadata metadata,
@NonNull Instant startTime,
@NonNull Instant endTime,
@NonNull Length distance) {
Objects.requireNonNull(metadata);
Objects.requireNonNull(startTime);
Objects.requireNonNull(endTime);
Objects.requireNonNull(distance);
mMetadata = metadata;
mStartTime = startTime;
mEndTime = endTime;
mDistance = distance;
mStartZoneOffset = ZoneOffset.systemDefault().getRules().getOffset(startTime);
mEndZoneOffset = ZoneOffset.systemDefault().getRules().getOffset(endTime);
} |
@param metadata Metadata to be associated with the record. See {@link Metadata}.
@param startTime Start time of this activity
@param endTime End time of this activity
@param distance Distance in {@link Length} unit. Required field. Valid range: 0-1000000
meters.
| Builder::Builder | java | Reginer/aosp-android-jar | android-35/src/android/health/connect/datatypes/DistanceRecord.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/health/connect/datatypes/DistanceRecord.java | MIT |
private DistanceRecord(
@NonNull Metadata metadata,
@NonNull Instant startTime,
@NonNull ZoneOffset startZoneOffset,
@NonNull Instant endTime,
@NonNull ZoneOffset endZoneOffset,
@NonNull Length distance,
boolean skipValidation) {
super(
metadata,
startTime,
startZoneOffset,
endTime,
endZoneOffset,
skipValidation,
/* enforceFutureTimeRestrictions= */ true);
Objects.requireNonNull(distance);
if (!skipValidation) {
ValidationUtils.requireInRange(
distance.getInMeters(), 0.0, 1000000.0, "revolutionsPerMinute");
}
mDistance = distance;
} |
@param metadata Metadata to be associated with the record. See {@link Metadata}.
@param startTime Start time of this activity
@param startZoneOffset Zone offset of the user when the activity started
@param endTime End time of this activity
@param endZoneOffset Zone offset of the user when the activity finished
@param distance Distance of this activity
@param skipValidation Boolean flag to skip validation of record values.
| Builder::DistanceRecord | java | Reginer/aosp-android-jar | android-35/src/android/health/connect/datatypes/DistanceRecord.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/health/connect/datatypes/DistanceRecord.java | MIT |
AbstractStringBuilder() {
} |
This no-arg constructor is necessary for serialization of subclasses.
| AbstractStringBuilder::AbstractStringBuilder | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
AbstractStringBuilder(int capacity) {
value = new char[capacity];
} |
Creates an AbstractStringBuilder of the specified capacity.
| AbstractStringBuilder::AbstractStringBuilder | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public int capacity() {
return value.length;
} |
Returns the current capacity. The capacity is the amount of storage
available for newly inserted characters, beyond which an allocation
will occur.
@return the current capacity
| AbstractStringBuilder::capacity | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public void ensureCapacity(int minimumCapacity) {
if (minimumCapacity > 0)
ensureCapacityInternal(minimumCapacity);
} |
Ensures that the capacity is at least equal to the specified minimum.
If the current capacity is less than the argument, then a new internal
array is allocated with greater capacity. The new capacity is the
larger of:
<ul>
<li>The {@code minimumCapacity} argument.
<li>Twice the old capacity, plus {@code 2}.
</ul>
If the {@code minimumCapacity} argument is nonpositive, this
method takes no action and simply returns.
Note that subsequent operations on this object can reduce the
actual capacity below that requested here.
@param minimumCapacity the minimum desired capacity.
| AbstractStringBuilder::ensureCapacity | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
private void ensureCapacityInternal(int minimumCapacity) {
// overflow-conscious code
if (minimumCapacity - value.length > 0) {
value = Arrays.copyOf(value,
newCapacity(minimumCapacity));
}
} |
For positive values of {@code minimumCapacity}, this method
behaves like {@code ensureCapacity}, however it is never
synchronized.
If {@code minimumCapacity} is non positive due to numeric
overflow, this method throws {@code OutOfMemoryError}.
| AbstractStringBuilder::ensureCapacityInternal | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
private int newCapacity(int minCapacity) {
// overflow-conscious code
int newCapacity = (value.length << 1) + 2;
if (newCapacity - minCapacity < 0) {
newCapacity = minCapacity;
}
return (newCapacity <= 0 || MAX_ARRAY_SIZE - newCapacity < 0)
? hugeCapacity(minCapacity)
: newCapacity;
} |
Returns a capacity at least as large as the given minimum capacity.
Returns the current capacity increased by the same amount + 2 if
that suffices.
Will not return a capacity greater than {@code MAX_ARRAY_SIZE}
unless the given minimum capacity is greater than that.
@param minCapacity the desired minimum capacity
@throws OutOfMemoryError if minCapacity is less than zero or
greater than Integer.MAX_VALUE
| AbstractStringBuilder::newCapacity | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public void trimToSize() {
if (count < value.length) {
value = Arrays.copyOf(value, count);
}
} |
Attempts to reduce storage used for the character sequence.
If the buffer is larger than necessary to hold its current sequence of
characters, then it may be resized to become more space efficient.
Calling this method may, but is not required to, affect the value
returned by a subsequent call to the {@link #capacity()} method.
| AbstractStringBuilder::trimToSize | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public void setLength(int newLength) {
if (newLength < 0)
throw new StringIndexOutOfBoundsException(newLength);
ensureCapacityInternal(newLength);
if (count < newLength) {
Arrays.fill(value, count, newLength, '\0');
}
count = newLength;
} |
Sets the length of the character sequence.
The sequence is changed to a new character sequence
whose length is specified by the argument. For every nonnegative
index <i>k</i> less than {@code newLength}, the character at
index <i>k</i> in the new character sequence is the same as the
character at index <i>k</i> in the old sequence if <i>k</i> is less
than the length of the old character sequence; otherwise, it is the
null character {@code '\u005Cu0000'}.
In other words, if the {@code newLength} argument is less than
the current length, the length is changed to the specified length.
<p>
If the {@code newLength} argument is greater than or equal
to the current length, sufficient null characters
({@code '\u005Cu0000'}) are appended so that
length becomes the {@code newLength} argument.
<p>
The {@code newLength} argument must be greater than or equal
to {@code 0}.
@param newLength the new length
@throws IndexOutOfBoundsException if the
{@code newLength} argument is negative.
| AbstractStringBuilder::setLength | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public int codePointAt(int index) {
if ((index < 0) || (index >= count)) {
throw new StringIndexOutOfBoundsException(index);
}
return Character.codePointAtImpl(value, index, count);
} |
Returns the character (Unicode code point) at the specified
index. The index refers to {@code char} values
(Unicode code units) and ranges from {@code 0} to
{@link #length()}{@code - 1}.
<p> If the {@code char} value specified at the given index
is in the high-surrogate range, the following index is less
than the length of this sequence, and the
{@code char} value at the following index is in the
low-surrogate range, then the supplementary code point
corresponding to this surrogate pair is returned. Otherwise,
the {@code char} value at the given index is returned.
@param index the index to the {@code char} values
@return the code point value of the character at the
{@code index}
@exception IndexOutOfBoundsException if the {@code index}
argument is negative or not less than the length of this
sequence.
| AbstractStringBuilder::codePointAt | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public int codePointBefore(int index) {
int i = index - 1;
if ((i < 0) || (i >= count)) {
throw new StringIndexOutOfBoundsException(index);
}
return Character.codePointBeforeImpl(value, index, 0);
} |
Returns the character (Unicode code point) before the specified
index. The index refers to {@code char} values
(Unicode code units) and ranges from {@code 1} to {@link
#length()}.
<p> If the {@code char} value at {@code (index - 1)}
is in the low-surrogate range, {@code (index - 2)} is not
negative, and the {@code char} value at {@code (index -
2)} is in the high-surrogate range, then the
supplementary code point value of the surrogate pair is
returned. If the {@code char} value at {@code index -
1} is an unpaired low-surrogate or a high-surrogate, the
surrogate value is returned.
@param index the index following the code point that should be returned
@return the Unicode code point value before the given index.
@exception IndexOutOfBoundsException if the {@code index}
argument is less than 1 or greater than the length
of this sequence.
| AbstractStringBuilder::codePointBefore | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public int codePointCount(int beginIndex, int endIndex) {
if (beginIndex < 0 || endIndex > count || beginIndex > endIndex) {
throw new IndexOutOfBoundsException();
}
return Character.codePointCountImpl(value, beginIndex, endIndex-beginIndex);
} |
Returns the number of Unicode code points in the specified text
range of this sequence. The text range begins at the specified
{@code beginIndex} and extends to the {@code char} at
index {@code endIndex - 1}. Thus the length (in
{@code char}s) of the text range is
{@code endIndex-beginIndex}. Unpaired surrogates within
this sequence count as one code point each.
@param beginIndex the index to the first {@code char} of
the text range.
@param endIndex the index after the last {@code char} of
the text range.
@return the number of Unicode code points in the specified text
range
@exception IndexOutOfBoundsException if the
{@code beginIndex} is negative, or {@code endIndex}
is larger than the length of this sequence, or
{@code beginIndex} is larger than {@code endIndex}.
| AbstractStringBuilder::codePointCount | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public int offsetByCodePoints(int index, int codePointOffset) {
if (index < 0 || index > count) {
throw new IndexOutOfBoundsException();
}
return Character.offsetByCodePointsImpl(value, 0, count,
index, codePointOffset);
} |
Returns the index within this sequence that is offset from the
given {@code index} by {@code codePointOffset} code
points. Unpaired surrogates within the text range given by
{@code index} and {@code codePointOffset} count as
one code point each.
@param index the index to be offset
@param codePointOffset the offset in code points
@return the index within this sequence
@exception IndexOutOfBoundsException if {@code index}
is negative or larger then the length of this sequence,
or if {@code codePointOffset} is positive and the subsequence
starting with {@code index} has fewer than
{@code codePointOffset} code points,
or if {@code codePointOffset} is negative and the subsequence
before {@code index} has fewer than the absolute value of
{@code codePointOffset} code points.
| AbstractStringBuilder::offsetByCodePoints | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
{
if (srcBegin < 0)
throw new StringIndexOutOfBoundsException(srcBegin);
if ((srcEnd < 0) || (srcEnd > count))
throw new StringIndexOutOfBoundsException(srcEnd);
if (srcBegin > srcEnd)
throw new StringIndexOutOfBoundsException("srcBegin > srcEnd");
System.arraycopy(value, srcBegin, dst, dstBegin, srcEnd - srcBegin);
} |
Characters are copied from this sequence into the
destination character array {@code dst}. The first character to
be copied is at index {@code srcBegin}; the last character to
be copied is at index {@code srcEnd-1}. The total number of
characters to be copied is {@code srcEnd-srcBegin}. The
characters are copied into the subarray of {@code dst} starting
at index {@code dstBegin} and ending at index:
<pre>{@code
dstbegin + (srcEnd-srcBegin) - 1
}</pre>
@param srcBegin start copying at this offset.
@param srcEnd stop copying at this offset.
@param dst the array to copy the data into.
@param dstBegin offset into {@code dst}.
@throws IndexOutOfBoundsException if any of the following is true:
<ul>
<li>{@code srcBegin} is negative
<li>{@code dstBegin} is negative
<li>the {@code srcBegin} argument is greater than
the {@code srcEnd} argument.
<li>{@code srcEnd} is greater than
{@code this.length()}.
<li>{@code dstBegin+srcEnd-srcBegin} is greater than
{@code dst.length}
</ul>
| AbstractStringBuilder::getChars | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public void setCharAt(int index, char ch) {
if ((index < 0) || (index >= count))
throw new StringIndexOutOfBoundsException(index);
value[index] = ch;
} |
The character at the specified index is set to {@code ch}. This
sequence is altered to represent a new character sequence that is
identical to the old character sequence, except that it contains the
character {@code ch} at position {@code index}.
<p>
The index argument must be greater than or equal to
{@code 0}, and less than the length of this sequence.
@param index the index of the character to modify.
@param ch the new character.
@throws IndexOutOfBoundsException if {@code index} is
negative or greater than or equal to {@code length()}.
| AbstractStringBuilder::setCharAt | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder append(Object obj) {
return append(String.valueOf(obj));
} |
Appends the string representation of the {@code Object} argument.
<p>
The overall effect is exactly as if the argument were converted
to a string by the method {@link String#valueOf(Object)},
and the characters of that string were then
{@link #append(String) appended} to this character sequence.
@param obj an {@code Object}.
@return a reference to this object.
| AbstractStringBuilder::append | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder append(String str) {
if (str == null)
return appendNull();
int len = str.length();
ensureCapacityInternal(count + len);
str.getChars(0, len, value, count);
count += len;
return this;
} |
Appends the specified string to this character sequence.
<p>
The characters of the {@code String} argument are appended, in
order, increasing the length of this sequence by the length of the
argument. If {@code str} is {@code null}, then the four
characters {@code "null"} are appended.
<p>
Let <i>n</i> be the length of this character sequence just prior to
execution of the {@code append} method. Then the character at
index <i>k</i> in the new character sequence is equal to the character
at index <i>k</i> in the old character sequence, if <i>k</i> is less
than <i>n</i>; otherwise, it is equal to the character at index
<i>k-n</i> in the argument {@code str}.
@param str a string.
@return a reference to this object.
| AbstractStringBuilder::append | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
AbstractStringBuilder append(AbstractStringBuilder asb) {
if (asb == null)
return appendNull();
int len = asb.length();
ensureCapacityInternal(count + len);
asb.getChars(0, len, value, count);
count += len;
return this;
} |
@since 1.8
| AbstractStringBuilder::append | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder append(char[] str) {
int len = str.length;
ensureCapacityInternal(count + len);
System.arraycopy(str, 0, value, count, len);
count += len;
return this;
} |
Appends the string representation of the {@code char} array
argument to this sequence.
<p>
The characters of the array argument are appended, in order, to
the contents of this sequence. The length of this sequence
increases by the length of the argument.
<p>
The overall effect is exactly as if the argument were converted
to a string by the method {@link String#valueOf(char[])},
and the characters of that string were then
{@link #append(String) appended} to this character sequence.
@param str the characters to be appended.
@return a reference to this object.
| AbstractStringBuilder::append | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder append(char str[], int offset, int len) {
if (len > 0) // let arraycopy report AIOOBE for len < 0
ensureCapacityInternal(count + len);
System.arraycopy(str, offset, value, count, len);
count += len;
return this;
} |
Appends the string representation of a subarray of the
{@code char} array argument to this sequence.
<p>
Characters of the {@code char} array {@code str}, starting at
index {@code offset}, are appended, in order, to the contents
of this sequence. The length of this sequence increases
by the value of {@code len}.
<p>
The overall effect is exactly as if the arguments were converted
to a string by the method {@link String#valueOf(char[],int,int)},
and the characters of that string were then
{@link #append(String) appended} to this character sequence.
@param str the characters to be appended.
@param offset the index of the first {@code char} to append.
@param len the number of {@code char}s to append.
@return a reference to this object.
@throws IndexOutOfBoundsException
if {@code offset < 0} or {@code len < 0}
or {@code offset+len > str.length}
| AbstractStringBuilder::append | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder append(boolean b) {
if (b) {
ensureCapacityInternal(count + 4);
value[count++] = 't';
value[count++] = 'r';
value[count++] = 'u';
value[count++] = 'e';
} else {
ensureCapacityInternal(count + 5);
value[count++] = 'f';
value[count++] = 'a';
value[count++] = 'l';
value[count++] = 's';
value[count++] = 'e';
}
return this;
} |
Appends the string representation of the {@code boolean}
argument to the sequence.
<p>
The overall effect is exactly as if the argument were converted
to a string by the method {@link String#valueOf(boolean)},
and the characters of that string were then
{@link #append(String) appended} to this character sequence.
@param b a {@code boolean}.
@return a reference to this object.
| AbstractStringBuilder::append | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder append(int i) {
if (i == Integer.MIN_VALUE) {
append("-2147483648");
return this;
}
int appendedLength = (i < 0) ? Integer.stringSize(-i) + 1
: Integer.stringSize(i);
int spaceNeeded = count + appendedLength;
ensureCapacityInternal(spaceNeeded);
Integer.getChars(i, spaceNeeded, value);
count = spaceNeeded;
return this;
} |
Appends the string representation of the {@code int}
argument to this sequence.
<p>
The overall effect is exactly as if the argument were converted
to a string by the method {@link String#valueOf(int)},
and the characters of that string were then
{@link #append(String) appended} to this character sequence.
@param i an {@code int}.
@return a reference to this object.
| AbstractStringBuilder::append | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder append(long l) {
if (l == Long.MIN_VALUE) {
append("-9223372036854775808");
return this;
}
int appendedLength = (l < 0) ? Long.stringSize(-l) + 1
: Long.stringSize(l);
int spaceNeeded = count + appendedLength;
ensureCapacityInternal(spaceNeeded);
Long.getChars(l, spaceNeeded, value);
count = spaceNeeded;
return this;
} |
Appends the string representation of the {@code long}
argument to this sequence.
<p>
The overall effect is exactly as if the argument were converted
to a string by the method {@link String#valueOf(long)},
and the characters of that string were then
{@link #append(String) appended} to this character sequence.
@param l a {@code long}.
@return a reference to this object.
| AbstractStringBuilder::append | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder append(float f) {
FloatingDecimal.appendTo(f,this);
return this;
} |
Appends the string representation of the {@code float}
argument to this sequence.
<p>
The overall effect is exactly as if the argument were converted
to a string by the method {@link String#valueOf(float)},
and the characters of that string were then
{@link #append(String) appended} to this character sequence.
@param f a {@code float}.
@return a reference to this object.
| AbstractStringBuilder::append | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder append(double d) {
FloatingDecimal.appendTo(d,this);
return this;
} |
Appends the string representation of the {@code double}
argument to this sequence.
<p>
The overall effect is exactly as if the argument were converted
to a string by the method {@link String#valueOf(double)},
and the characters of that string were then
{@link #append(String) appended} to this character sequence.
@param d a {@code double}.
@return a reference to this object.
| AbstractStringBuilder::append | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder delete(int start, int end) {
if (start < 0)
throw new StringIndexOutOfBoundsException(start);
if (end > count)
end = count;
if (start > end)
throw new StringIndexOutOfBoundsException();
int len = end - start;
if (len > 0) {
System.arraycopy(value, start+len, value, start, count-end);
count -= len;
}
return this;
} |
Removes the characters in a substring of this sequence.
The substring begins at the specified {@code start} and extends to
the character at index {@code end - 1} or to the end of the
sequence if no such character exists. If
{@code start} is equal to {@code end}, no changes are made.
@param start The beginning index, inclusive.
@param end The ending index, exclusive.
@return This object.
@throws StringIndexOutOfBoundsException if {@code start}
is negative, greater than {@code length()}, or
greater than {@code end}.
| AbstractStringBuilder::delete | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder appendCodePoint(int codePoint) {
final int count = this.count;
if (Character.isBmpCodePoint(codePoint)) {
ensureCapacityInternal(count + 1);
value[count] = (char) codePoint;
this.count = count + 1;
} else if (Character.isValidCodePoint(codePoint)) {
ensureCapacityInternal(count + 2);
Character.toSurrogates(codePoint, value, count);
this.count = count + 2;
} else {
throw new IllegalArgumentException();
}
return this;
} |
Appends the string representation of the {@code codePoint}
argument to this sequence.
<p> The argument is appended to the contents of this sequence.
The length of this sequence increases by
{@link Character#charCount(int) Character.charCount(codePoint)}.
<p> The overall effect is exactly as if the argument were
converted to a {@code char} array by the method
{@link Character#toChars(int)} and the character in that array
were then {@link #append(char[]) appended} to this character
sequence.
@param codePoint a Unicode code point
@return a reference to this object.
@exception IllegalArgumentException if the specified
{@code codePoint} isn't a valid Unicode code point
| AbstractStringBuilder::appendCodePoint | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder deleteCharAt(int index) {
if ((index < 0) || (index >= count))
throw new StringIndexOutOfBoundsException(index);
System.arraycopy(value, index+1, value, index, count-index-1);
count--;
return this;
} |
Removes the {@code char} at the specified position in this
sequence. This sequence is shortened by one {@code char}.
<p>Note: If the character at the given index is a supplementary
character, this method does not remove the entire character. If
correct handling of supplementary characters is required,
determine the number of {@code char}s to remove by calling
{@code Character.charCount(thisSequence.codePointAt(index))},
where {@code thisSequence} is this sequence.
@param index Index of {@code char} to remove
@return This object.
@throws StringIndexOutOfBoundsException if the {@code index}
is negative or greater than or equal to
{@code length()}.
| AbstractStringBuilder::deleteCharAt | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder replace(int start, int end, String str) {
if (start < 0)
throw new StringIndexOutOfBoundsException(start);
if (start > count)
throw new StringIndexOutOfBoundsException("start > length()");
if (start > end)
throw new StringIndexOutOfBoundsException("start > end");
if (end > count)
end = count;
int len = str.length();
int newCount = count + len - (end - start);
ensureCapacityInternal(newCount);
System.arraycopy(value, end, value, start + len, count - end);
str.getChars(value, start);
count = newCount;
return this;
} |
Replaces the characters in a substring of this sequence
with characters in the specified {@code String}. The substring
begins at the specified {@code start} and extends to the character
at index {@code end - 1} or to the end of the
sequence if no such character exists. First the
characters in the substring are removed and then the specified
{@code String} is inserted at {@code start}. (This
sequence will be lengthened to accommodate the
specified String if necessary.)
@param start The beginning index, inclusive.
@param end The ending index, exclusive.
@param str String that will replace previous contents.
@return This object.
@throws StringIndexOutOfBoundsException if {@code start}
is negative, greater than {@code length()}, or
greater than {@code end}.
| AbstractStringBuilder::replace | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public String substring(int start) {
return substring(start, count);
} |
Returns a new {@code String} that contains a subsequence of
characters currently contained in this character sequence. The
substring begins at the specified index and extends to the end of
this sequence.
@param start The beginning index, inclusive.
@return The new string.
@throws StringIndexOutOfBoundsException if {@code start} is
less than zero, or greater than the length of this object.
| AbstractStringBuilder::substring | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public String substring(int start, int end) {
if (start < 0)
throw new StringIndexOutOfBoundsException(start);
if (end > count)
throw new StringIndexOutOfBoundsException(end);
if (start > end)
throw new StringIndexOutOfBoundsException(end - start);
return new String(value, start, end - start);
} |
Returns a new {@code String} that contains a subsequence of
characters currently contained in this sequence. The
substring begins at the specified {@code start} and
extends to the character at index {@code end - 1}.
@param start The beginning index, inclusive.
@param end The ending index, exclusive.
@return The new string.
@throws StringIndexOutOfBoundsException if {@code start}
or {@code end} are negative or greater than
{@code length()}, or {@code start} is
greater than {@code end}.
| AbstractStringBuilder::substring | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder insert(int index, char[] str, int offset,
int len)
{
if ((index < 0) || (index > length()))
throw new StringIndexOutOfBoundsException(index);
if ((offset < 0) || (len < 0) || (offset > str.length - len))
throw new StringIndexOutOfBoundsException(
"offset " + offset + ", len " + len + ", str.length "
+ str.length);
ensureCapacityInternal(count + len);
System.arraycopy(value, index, value, index + len, count - index);
System.arraycopy(str, offset, value, index, len);
count += len;
return this;
} |
Inserts the string representation of a subarray of the {@code str}
array argument into this sequence. The subarray begins at the
specified {@code offset} and extends {@code len} {@code char}s.
The characters of the subarray are inserted into this sequence at
the position indicated by {@code index}. The length of this
sequence increases by {@code len} {@code char}s.
@param index position at which to insert subarray.
@param str A {@code char} array.
@param offset the index of the first {@code char} in subarray to
be inserted.
@param len the number of {@code char}s in the subarray to
be inserted.
@return This object
@throws StringIndexOutOfBoundsException if {@code index}
is negative or greater than {@code length()}, or
{@code offset} or {@code len} are negative, or
{@code (offset+len)} is greater than
{@code str.length}.
| AbstractStringBuilder::insert | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder insert(int offset, Object obj) {
return insert(offset, String.valueOf(obj));
} |
Inserts the string representation of the {@code Object}
argument into this character sequence.
<p>
The overall effect is exactly as if the second argument were
converted to a string by the method {@link String#valueOf(Object)},
and the characters of that string were then
{@link #insert(int,String) inserted} into this character
sequence at the indicated offset.
<p>
The {@code offset} argument must be greater than or equal to
{@code 0}, and less than or equal to the {@linkplain #length() length}
of this sequence.
@param offset the offset.
@param obj an {@code Object}.
@return a reference to this object.
@throws StringIndexOutOfBoundsException if the offset is invalid.
| AbstractStringBuilder::insert | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder insert(int offset, String str) {
if ((offset < 0) || (offset > length()))
throw new StringIndexOutOfBoundsException(offset);
if (str == null)
str = "null";
int len = str.length();
ensureCapacityInternal(count + len);
System.arraycopy(value, offset, value, offset + len, count - offset);
str.getChars(value, offset);
count += len;
return this;
} |
Inserts the string into this character sequence.
<p>
The characters of the {@code String} argument are inserted, in
order, into this sequence at the indicated offset, moving up any
characters originally above that position and increasing the length
of this sequence by the length of the argument. If
{@code str} is {@code null}, then the four characters
{@code "null"} are inserted into this sequence.
<p>
The character at index <i>k</i> in the new character sequence is
equal to:
<ul>
<li>the character at index <i>k</i> in the old character sequence, if
<i>k</i> is less than {@code offset}
<li>the character at index <i>k</i>{@code -offset} in the
argument {@code str}, if <i>k</i> is not less than
{@code offset} but is less than {@code offset+str.length()}
<li>the character at index <i>k</i>{@code -str.length()} in the
old character sequence, if <i>k</i> is not less than
{@code offset+str.length()}
</ul><p>
The {@code offset} argument must be greater than or equal to
{@code 0}, and less than or equal to the {@linkplain #length() length}
of this sequence.
@param offset the offset.
@param str a string.
@return a reference to this object.
@throws StringIndexOutOfBoundsException if the offset is invalid.
| AbstractStringBuilder::insert | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder insert(int offset, char[] str) {
if ((offset < 0) || (offset > length()))
throw new StringIndexOutOfBoundsException(offset);
int len = str.length;
ensureCapacityInternal(count + len);
System.arraycopy(value, offset, value, offset + len, count - offset);
System.arraycopy(str, 0, value, offset, len);
count += len;
return this;
} |
Inserts the string representation of the {@code char} array
argument into this sequence.
<p>
The characters of the array argument are inserted into the
contents of this sequence at the position indicated by
{@code offset}. The length of this sequence increases by
the length of the argument.
<p>
The overall effect is exactly as if the second argument were
converted to a string by the method {@link String#valueOf(char[])},
and the characters of that string were then
{@link #insert(int,String) inserted} into this character
sequence at the indicated offset.
<p>
The {@code offset} argument must be greater than or equal to
{@code 0}, and less than or equal to the {@linkplain #length() length}
of this sequence.
@param offset the offset.
@param str a character array.
@return a reference to this object.
@throws StringIndexOutOfBoundsException if the offset is invalid.
| AbstractStringBuilder::insert | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder insert(int dstOffset, CharSequence s) {
if (s == null)
s = "null";
if (s instanceof String)
return this.insert(dstOffset, (String)s);
return this.insert(dstOffset, s, 0, s.length());
} |
Inserts the specified {@code CharSequence} into this sequence.
<p>
The characters of the {@code CharSequence} argument are inserted,
in order, into this sequence at the indicated offset, moving up
any characters originally above that position and increasing the length
of this sequence by the length of the argument s.
<p>
The result of this method is exactly the same as if it were an
invocation of this object's
{@link #insert(int,CharSequence,int,int) insert}(dstOffset, s, 0, s.length())
method.
<p>If {@code s} is {@code null}, then the four characters
{@code "null"} are inserted into this sequence.
@param dstOffset the offset.
@param s the sequence to be inserted
@return a reference to this object.
@throws IndexOutOfBoundsException if the offset is invalid.
| AbstractStringBuilder::insert | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder insert(int dstOffset, CharSequence s,
int start, int end) {
if (s == null)
s = "null";
if ((dstOffset < 0) || (dstOffset > this.length()))
throw new IndexOutOfBoundsException("dstOffset "+dstOffset);
if ((start < 0) || (end < 0) || (start > end) || (end > s.length()))
throw new IndexOutOfBoundsException(
"start " + start + ", end " + end + ", s.length() "
+ s.length());
int len = end - start;
ensureCapacityInternal(count + len);
System.arraycopy(value, dstOffset, value, dstOffset + len,
count - dstOffset);
for (int i=start; i<end; i++)
value[dstOffset++] = s.charAt(i);
count += len;
return this;
} |
Inserts a subsequence of the specified {@code CharSequence} into
this sequence.
<p>
The subsequence of the argument {@code s} specified by
{@code start} and {@code end} are inserted,
in order, into this sequence at the specified destination offset, moving
up any characters originally above that position. The length of this
sequence is increased by {@code end - start}.
<p>
The character at index <i>k</i> in this sequence becomes equal to:
<ul>
<li>the character at index <i>k</i> in this sequence, if
<i>k</i> is less than {@code dstOffset}
<li>the character at index <i>k</i>{@code +start-dstOffset} in
the argument {@code s}, if <i>k</i> is greater than or equal to
{@code dstOffset} but is less than {@code dstOffset+end-start}
<li>the character at index <i>k</i>{@code -(end-start)} in this
sequence, if <i>k</i> is greater than or equal to
{@code dstOffset+end-start}
</ul><p>
The {@code dstOffset} argument must be greater than or equal to
{@code 0}, and less than or equal to the {@linkplain #length() length}
of this sequence.
<p>The start argument must be nonnegative, and not greater than
{@code end}.
<p>The end argument must be greater than or equal to
{@code start}, and less than or equal to the length of s.
<p>If {@code s} is {@code null}, then this method inserts
characters as if the s parameter was a sequence containing the four
characters {@code "null"}.
@param dstOffset the offset in this sequence.
@param s the sequence to be inserted.
@param start the starting index of the subsequence to be inserted.
@param end the end index of the subsequence to be inserted.
@return a reference to this object.
@throws IndexOutOfBoundsException if {@code dstOffset}
is negative or greater than {@code this.length()}, or
{@code start} or {@code end} are negative, or
{@code start} is greater than {@code end} or
{@code end} is greater than {@code s.length()}
| AbstractStringBuilder::insert | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder insert(int offset, boolean b) {
return insert(offset, String.valueOf(b));
} |
Inserts the string representation of the {@code boolean}
argument into this sequence.
<p>
The overall effect is exactly as if the second argument were
converted to a string by the method {@link String#valueOf(boolean)},
and the characters of that string were then
{@link #insert(int,String) inserted} into this character
sequence at the indicated offset.
<p>
The {@code offset} argument must be greater than or equal to
{@code 0}, and less than or equal to the {@linkplain #length() length}
of this sequence.
@param offset the offset.
@param b a {@code boolean}.
@return a reference to this object.
@throws StringIndexOutOfBoundsException if the offset is invalid.
| AbstractStringBuilder::insert | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
public AbstractStringBuilder insert(int offset, char c) {
ensureCapacityInternal(count + 1);
System.arraycopy(value, offset, value, offset + 1, count - offset);
value[offset] = c;
count += 1;
return this;
} |
Inserts the string representation of the {@code char}
argument into this sequence.
<p>
The overall effect is exactly as if the second argument were
converted to a string by the method {@link String#valueOf(char)},
and the character in that string were then
{@link #insert(int,String) inserted} into this character
sequence at the indicated offset.
<p>
The {@code offset} argument must be greater than or equal to
{@code 0}, and less than or equal to the {@linkplain #length() length}
of this sequence.
@param offset the offset.
@param c a {@code char}.
@return a reference to this object.
@throws IndexOutOfBoundsException if the offset is invalid.
| AbstractStringBuilder::insert | java | Reginer/aosp-android-jar | android-32/src/java/lang/AbstractStringBuilder.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AbstractStringBuilder.java | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.