Tabnine Logo
SparseArray.keyAt
Code IndexAdd Tabnine to your IDE (free)

How to use
keyAt
method
in
com.heaven7.java.base.util.SparseArray

Best Java code snippets using com.heaven7.java.base.util.SparseArray.keyAt (Showing top 10 results out of 315)

origin: LightSun/data-mediator

@Override
public int keyAt(int index) {
  return mMap.keyAt(index);
}
origin: LightSun/data-mediator

@Override
public int keyAt(int index) {
  return mMap.keyAt(index);
}
origin: LightSun/data-mediator

@Override
public void write(JsonWriter out, SparseArray<T> value) throws IOException {
  out.beginObject();
  if(value != null) {
    for (int size = value.size(), i = size - 1; i >= 0; i--) {
      out.name(value.keyAt(i) + "");
      mAdapter.write(out, value.valueAt(i));
    }
  }
  out.endObject();
}
origin: LightSun/data-mediator

@Override
public boolean removeByValue(V value, int[] keyArr){
  final int index = mMap.indexOfValue(value, false);
  if(index < 0){
    return false;
  }
  if(keyArr != null) {
    keyArr[0] = mMap.keyAt(index);
  }
  mMap.removeAt(index);
  return true;
}
origin: LightSun/data-mediator

@Override
public boolean removeByValue(V value, int[] keyArr){
  final int index = mMap.indexOfValue(value, false);
  if(index < 0){
    return false;
  }
  if(keyArr != null) {
    keyArr[0] = mMap.keyAt(index);
  }
  mMap.removeAt(index);
  return true;
}
origin: LightSun/data-mediator

  static void writeSparseArray0(Parcel in, SparseArray val) {
    if (val == null) {
      in.writeInt(-1);
      return;
    }
    int N = val.size();
    in.writeInt(N);
    int i=0;
    while (i < N) {
      in.writeInt(val.keyAt(i));
      in.writeValue(val.valueAt(i));
      i++;
    }
  }
}
origin: LightSun/data-mediator

@Override
public void write(JsonWriter out,  GsonProperty property, Object value) throws IOException {
  final Class<?> simpleType = property.getType();
  out.beginObject();
  if(value != null) {
    final SparseArray sa = (SparseArray) value;
    if(simpleType.isPrimitive() || isBoxedClass(simpleType)){
      for (int size = sa.size(), i = size - 1; i >= 0; i--) {
        out.name(sa.keyAt(i) + "");
        writePrimitiveOrItsBox(out, simpleType, sa.valueAt(i));
      }
    }else {
      TypeAdapter adapter = getTypeAdapter(simpleType);
      for (int size = sa.size(), i = size - 1; i >= 0; i--) {
        out.name(sa.keyAt(i) + "");
        adapter.write(out, sa.valueAt(i));
      }
    }
  }
  out.endObject();
}
origin: LightSun/data-mediator

@Override
public boolean clearTo(SparseArrayDelegate<V> out) {
  final int size = mMap.size();
  if(size == 0){
    return false;
  }
  if(out != null) {
    for (int i = size -1 ; i>=0 ; i--){
      out.put(mMap.keyAt(i), mMap.valueAt(i), null);
    }
  }
  mMap.clear();
  return true;
}
origin: LightSun/data-mediator

@Override
public boolean clearTo(SparseArrayDelegate<V> out) {
  final int size = mMap.size();
  if(size == 0){
    return false;
  }
  if(out != null) {
    for (int i = size -1 ; i>=0 ; i--){
      out.put(mMap.keyAt(i), mMap.valueAt(i), null);
    }
  }
  mMap.clear();
  return true;
}
origin: LightSun/data-mediator

@Override
public void write(JsonWriter out, SparseArray<Car3> value) throws IOException {
  out.beginObject();
  if(value != null) {
    for (int size = value.size(), i = size - 1; i >= 0; i--) {
      out.name(value.keyAt(i) + "");
      mAdapter.write(out, value.valueAt(i));
    }
  }
  out.endObject();
}
com.heaven7.java.base.utilSparseArraykeyAt

Popular methods of SparseArray

  • <init>
  • put
  • size
  • valueAt
  • get
  • clear
  • getAndRemove
  • indexOfValue
  • removeAt
  • setValueAt
  • append
  • toString
  • append,
  • toString

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (Timer)
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JComboBox (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now