本文整理汇总了Java中android.database.CharArrayBuffer类的典型用法代码示例。如果您正苦于以下问题:Java CharArrayBuffer类的具体用法?Java CharArrayBuffer怎么用?Java CharArrayBuffer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CharArrayBuffer类属于android.database包,在下文中一共展示了CharArrayBuffer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: copyStringToBuffer
import android.database.CharArrayBuffer; //导入依赖的package包/类
@Override
public void copyStringToBuffer(int columnIndex, CharArrayBuffer buffer) {
// Default implementation, uses getString
String result = getString(columnIndex);
if (result != null) {
char[] data = buffer.data;
if (data == null || data.length < result.length()) {
buffer.data = result.toCharArray();
} else {
result.getChars(0, result.length(), data, 0);
}
buffer.sizeCopied = result.length();
} else {
buffer.sizeCopied = 0;
}
}
示例2: newView
import android.database.CharArrayBuffer; //导入依赖的package包/类
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
View v = super.newView(context, cursor, parent);
ViewHolder vh = new ViewHolder();
vh.line1 = (TextView) v.findViewById(R.id.line1);
vh.line1.setTextAppearance(NowPlayingActivity.this, android.R.style.TextAppearance_Medium);
vh.line2 = (TextView) v.findViewById(R.id.line2);
vh.line2.setTextAppearance(NowPlayingActivity.this, android.R.style.TextAppearance_Small);
vh.duration = (TextView) v.findViewById(R.id.duration);
TypedValue tv = new TypedValue();
if (getTheme().resolveAttribute(android.R.attr.textColorPrimary, tv, true)) {
vh.duration.setTextColor(context.getResources().getColor(tv.resourceId));
}
vh.play_indicator = (ImageView) v.findViewById(R.id.play_indicator);
vh.buffer1 = new CharArrayBuffer(100);
vh.buffer2 = new char[200];
vh.icon = (RecyclingImageView) v.findViewById(R.id.icon);
v.setTag(vh);
return v;
}
示例3: copyStringToBuffer
import android.database.CharArrayBuffer; //导入依赖的package包/类
public void copyStringToBuffer(int columnIndex, CharArrayBuffer buffer) {
checkPosition();
if (columnIndex == mDeltaColumn) {
long value = getDeltaValue();
String strValue = Long.toString(value);
int len = strValue.length();
char[] data = buffer.data;
if (data == null || data.length < len) {
buffer.data = strValue.toCharArray();
} else {
strValue.getChars(0, len, data, 0);
}
buffer.sizeCopied = strValue.length();
} else {
mInnerCursor.copyStringToBuffer(columnIndex, buffer);
}
}
示例4: newView
import android.database.CharArrayBuffer; //导入依赖的package包/类
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
View v = super.newView(context, cursor, parent);
ImageView iv = (ImageView) v.findViewById(R.id.icon);
iv.setVisibility(View.GONE);
ViewHolder vh = new ViewHolder();
vh.line1 = (TextView) v.findViewById(R.id.line1);
vh.line2 = (TextView) v.findViewById(R.id.line2);
vh.duration = (TextView) v.findViewById(R.id.duration);
vh.play_indicator = (ImageView) v.findViewById(R.id.play_indicator);
vh.buffer1 = new CharArrayBuffer(100);
vh.buffer2 = new char[200];
v.setTag(vh);
return v;
}
开发者ID:AndroidLearnerchn,项目名称:Android-Application-Using-CAF-Library,代码行数:17,代码来源:TrackBrowserActivity.java
示例5: copyStringToBuffer
import android.database.CharArrayBuffer; //导入依赖的package包/类
/**
* copy the text for the given field in the provided char array.
*
* @param row the row to read from, row - getStartPosition() being the actual row in the window
* @param col the column to read from
* @param buffer the CharArrayBuffer to copy the text into,
* If the requested string is larger than the buffer
* a new char buffer will be created to hold the string. and assigne to
* CharArrayBuffer.data
*/
public void copyStringToBuffer(int row, int col, CharArrayBuffer buffer) {
if (buffer == null) {
throw new IllegalArgumentException("CharArrayBuffer should not be null");
}
if (buffer.data == null) {
buffer.data = new char[64];
}
acquireReference();
try {
char[] newbuf = copyStringToBuffer_native(
row - mStartPos, col, buffer.data.length, buffer);
if (newbuf != null) {
buffer.data = newbuf;
}
} finally {
releaseReference();
}
}
示例6: newView
import android.database.CharArrayBuffer; //导入依赖的package包/类
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
View v = super.newView(context, cursor, parent);
ViewHolder vh = new ViewHolder();
vh.line1 = (TextView) v.findViewById(R.id.line1);
vh.line2 = (TextView) v.findViewById(R.id.line2);
vh.duration = (TextView) v.findViewById(R.id.duration);
vh.buffer1 = new CharArrayBuffer(100);
vh.buffer2 = new char[200];
v.setTag(vh);
return v;
}
示例7: newView
import android.database.CharArrayBuffer; //导入依赖的package包/类
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
View v = super.newView(context, cursor, parent);
ViewHolder vh = new ViewHolder();
vh.line1 = (TextView) v.findViewById(R.id.line1);
vh.line2 = (TextView) v.findViewById(R.id.line2);
vh.duration = (TextView) v.findViewById(R.id.duration);
vh.radio = (RadioButton) v.findViewById(R.id.radio);
vh.play_indicator = (ImageView) v.findViewById(R.id.play_indicator);
vh.buffer1 = new CharArrayBuffer(100);
vh.buffer2 = new char[200];
v.setTag(vh);
return v;
}
示例8: testCopyStringToBuffer
import android.database.CharArrayBuffer; //导入依赖的package包/类
@Test
public void testCopyStringToBuffer() {
final Cursor emptyCursor = EmptyCursor.create();
final CharArrayBuffer buffer = new CharArrayBuffer(0);
for (int i = 0; i < 10; i++) {
emptyCursor.copyStringToBuffer(i, buffer);
}
assertThat(buffer.sizeCopied, is(0));
}
示例9: copyStringToBuffer
import android.database.CharArrayBuffer; //导入依赖的package包/类
@Override
public void copyStringToBuffer(int columnIndex, CharArrayBuffer buffer) {
for (int chance = 0; chance < LOCK_RETRY_CHANCES; chance++) {
try {
cursor.copyStringToBuffer(columnIndex, buffer);
} catch (RuntimeException e) {
if (!isSQLiteDatabaseLockedException(e)) {
throw e;
}
}
}
}
示例10: getScoreHolderDisplayName
import android.database.CharArrayBuffer; //导入依赖的package包/类
public final void getScoreHolderDisplayName(CharArrayBuffer paramCharArrayBuffer)
{
if (this.vS == null)
{
fc.b(this.vP, paramCharArrayBuffer);
return;
}
this.vS.getDisplayName(paramCharArrayBuffer);
}
示例11: getScoreHolderDisplayName
import android.database.CharArrayBuffer; //导入依赖的package包/类
public final void getScoreHolderDisplayName(CharArrayBuffer paramCharArrayBuffer)
{
if (M("external_player_id"))
{
a("default_display_name", paramCharArrayBuffer);
return;
}
this.vU.getDisplayName(paramCharArrayBuffer);
}
示例12: getDisplayName
import android.database.CharArrayBuffer; //导入依赖的package包/类
public final void getDisplayName(CharArrayBuffer paramCharArrayBuffer)
{
if (M("external_player_id"))
{
a("default_display_name", paramCharArrayBuffer);
return;
}
this.wx.getDisplayName(paramCharArrayBuffer);
}
示例13: getDisplayName
import android.database.CharArrayBuffer; //导入依赖的package包/类
public final void getDisplayName(CharArrayBuffer paramCharArrayBuffer)
{
if (this.wu == null)
{
fc.b(this.qa, paramCharArrayBuffer);
return;
}
this.wu.getDisplayName(paramCharArrayBuffer);
}
示例14: getFormattedCurrentSteps
import android.database.CharArrayBuffer; //导入依赖的package包/类
public final void getFormattedCurrentSteps(CharArrayBuffer paramCharArrayBuffer)
{
boolean bool;
if (getType() == 1)
bool = true;
else
bool = false;
ds.p(bool);
a("formatted_current_steps", paramCharArrayBuffer);
}
示例15: getFormattedTotalSteps
import android.database.CharArrayBuffer; //导入依赖的package包/类
public final void getFormattedTotalSteps(CharArrayBuffer paramCharArrayBuffer)
{
boolean bool;
if (getType() == 1)
bool = true;
else
bool = false;
ds.p(bool);
a("formatted_total_steps", paramCharArrayBuffer);
}