|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.android.dx.util.MutabilityControl
com.android.dx.util.FixedSizeList
public class FixedSizeList
Simple (mostly) fixed-size list of objects, which may be made immutable.
| Constructor Summary | |
|---|---|
FixedSizeList(int size)
Constructs an instance. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object other)
|
protected Object |
get0(int n)
Gets the indicated element. |
protected Object |
getOrNull0(int n)
Gets the indicated element, allowing nulls to be
returned. |
int |
hashCode()
|
protected void |
set0(int n,
Object obj)
Sets the element at the given index, but without doing any type checks on the element. |
void |
shrinkToFit()
Shrinks this instance to fit, by removing any unset ( null) elements, leaving the remaining elements in
their original order. |
int |
size()
Gets the number of elements in this list. |
String |
toHuman()
Return the "human" string form of this instance. |
String |
toHuman(String prefix,
String separator,
String suffix)
Gets a customized human string for this instance. |
String |
toString()
|
String |
toString(String prefix,
String separator,
String suffix)
Gets a customized string form for this instance. |
| Methods inherited from class com.android.dx.util.MutabilityControl |
|---|
isImmutable, isMutable, setImmutable, throwIfImmutable, throwIfMutable |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FixedSizeList(int size)
null.
size - the size of the list| Method Detail |
|---|
public boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic String toHuman()
toString().
This method will only work if every element of the list
implements ToHuman.
toHuman in interface ToHumannon-null; the human string form
public String toString(String prefix,
String separator,
String suffix)
prefix - null-ok; prefix for the start of the resultseparator - null-ok; separator to insert between each itemsuffix - null-ok; suffix for the end of the result
non-null; the custom string
public String toHuman(String prefix,
String separator,
String suffix)
ToHuman.
prefix - null-ok; prefix for the start of the resultseparator - null-ok; separator to insert between each itemsuffix - null-ok; suffix for the end of the result
non-null; the custom stringpublic final int size()
public void shrinkToFit()
null) elements, leaving the remaining elements in
their original order.
protected final Object get0(int n)
NullPointerException. This method is
protected so that subclasses may offer a safe type-checked
public interface to their clients.
n - >= 0, < size(); which element
non-null; the indicated elementprotected final Object getOrNull0(int n)
nulls to be
returned. This method is protected so that subclasses may
(optionally) offer a safe type-checked public interface to
their clients.
n - >= 0, < size(); which element
null-ok; the indicated element
protected final void set0(int n,
Object obj)
n - >= 0, < size(); which elementobj - null-ok; the value to store
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||