public abstract class AbstractArray<V> extends java.lang.Object implements BaseItem, java.lang.Iterable<V>
| Modifier and Type | Field and Description |
|---|---|
static byte |
ALLOWDUPLICATE
Is Allow Duplicate Items in List
|
static byte |
ALLOWEMPTYVALUE
Is Allow Empty Value in List (null)
|
static byte |
BIDI
Is List is Key,Value and Value, Key
|
static byte |
CASESENSITIVE
Is Key is String and is Allow Casesensitive
|
byte |
flag
The Flag of List.
|
static byte |
MAP
Is The List has Key,Value
|
static byte |
READONLY
Is List is ReadOnly
|
static java.lang.Integer |
REMOVED |
static byte |
VISIBLE
Is The List is Visible for Tree Editors
|
| Constructor and Description |
|---|
AbstractArray() |
| Modifier and Type | Method and Description |
|---|---|
protected int |
addHashItem(int pos,
java.lang.Object newValue,
java.lang.Object[] items)
Add a Key to internal List and Array if nesessary
|
protected int |
addKeyValue(int pos,
java.lang.Object key,
java.lang.Object value) |
protected boolean |
checkValue(java.lang.Object a,
java.lang.Object b) |
void |
clear() |
java.util.Comparator<java.lang.Object> |
comparator() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
protected boolean |
fireProperty(java.lang.String type,
java.lang.Object oldElement,
java.lang.Object newElement,
java.lang.Object beforeElement,
java.lang.Object value) |
V |
first() |
byte |
flag() |
V |
get(int index) |
protected java.lang.Object |
getByIndex(int offset,
int index,
int size) |
java.lang.Object |
getKeyByIndex(int index) |
abstract BaseItem |
getNewList(boolean keyValue) |
int |
getPositionKey(java.lang.Object o,
boolean last) |
java.lang.Object |
getValue(java.lang.Object key) |
protected int |
hashKey(int hashKey,
int len)
Get the HashKey from a Object with Max HashTableIndex and StepSize of
EntitySize
|
protected int |
hasKeyAndPos(java.lang.Object element)
Add a Element to the List
|
int |
indexOf(java.lang.Object o)
Returns the index of the first occurrence of the specified element in
this list, or -1 if this list does not contain the element.
|
<ST extends AbstractArray<V>> |
init(java.util.Collection<?> list)
Init-List with Collection
|
<ST extends AbstractArray<V>> |
init(int initSize)
Init-List with Size-Integer
|
<ST extends AbstractArray<V>> |
init(java.lang.Object[] items,
int size,
int offset)
Init-List with Size-Integer
|
boolean |
isAllowDuplicate()
Is Allow Duplicate Entity in the List
|
boolean |
isAllowEmptyValue()
Is Allow Duplicate Entity in the List
|
boolean |
isCaseSensitive()
Is Item is CaseSensitive
|
boolean |
isComparator() |
boolean |
isEmpty()
If the List is Empty
|
boolean |
isReadOnly()
Is Allow Duplicate Entity in the List
|
boolean |
isVisible()
Is Visible Entity
|
java.util.Iterator<V> |
iterator() |
V |
last() |
int |
lastIndexOf(java.lang.Object o)
Returns the index of the first occurrence of the specified element in
this list, or -1 if this list does not contain the element.
|
boolean |
move(int from,
int to) |
void |
pack() |
protected java.lang.String |
parseItem(EntityStringConverter converter) |
boolean |
removeAll(java.util.Collection<?> c)
This implementation iterates over this collection, checking each element
returned by the iterator in turn to see if it's contained in the
specified collection.
|
int |
removeByObject(java.lang.Object key) |
void |
reset() |
boolean |
retainAll(java.util.Collection<?> c)
This implementation iterates over this collection, checking each element
returned by the iterator in turn to see if it's contained in the
specified collection.
|
void |
setAllowEmptyValue(boolean value) |
void |
setFlag(byte flag) |
protected void |
setValue(int pos,
java.lang.Object value,
int offset) |
int |
size() |
BaseItem |
subList(int fromIndex,
int toIndex)
Returns a view of the portion of this list between the specified
fromIndex, inclusive, and toIndex, exclusive.
|
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a)
Returns an array containing all of the elements in this list in proper
sequence (from first to last element); the runtime type of the returned
array is that of the specified array.
|
java.lang.String |
toString() |
java.lang.String |
toString(Converter converter)
Make a prettyprinted Text of this Entity.
|
AbstractArray<V> |
with(java.lang.Object... values)
Add Elements to List or KeyValue
if param Modulo 2 the Params can be Key,Value
or add all Values to List
|
<ST extends AbstractArray<V>> |
withAllowDuplicate(boolean value) |
<ST extends AbstractArray<V>> |
withAllowEmptyValue(boolean value) |
<ST extends AbstractArray<V>> |
withCaseSensitive(boolean value) |
<ST extends AbstractArray<V>> |
withFlag(byte value) |
AbstractArray<V> |
withList(java.util.Collection<?> list) |
AbstractArray<V> |
without(java.lang.Object... values) |
<ST extends AbstractArray<V>> |
withSize(int size) |
AbstractArray<V> |
withVisible(boolean value) |
public static final byte ALLOWDUPLICATE
public static final byte ALLOWEMPTYVALUE
public static final byte VISIBLE
public static final byte CASESENSITIVE
public static final byte READONLY
public static final byte MAP
public static final byte BIDI
public static final java.lang.Integer REMOVED
public byte flag
ALLOWDUPLICATE,
ALLOWEMPTYVALUE,
VISIBLE,
CASESENSITIVE,
MAP,
BIDIpublic <ST extends AbstractArray<V>> ST init(java.util.Collection<?> list)
ST - Container Classlist - add all new Itemspublic <ST extends AbstractArray<V>> ST init(int initSize)
ST - Container ClassinitSize - the new Size of the Listpublic <ST extends AbstractArray<V>> ST init(java.lang.Object[] items, int size, int offset)
ST - Container Classitems - Array of the new Listsize - the new Size of the Listoffset - the startoffset of Itemspublic <ST extends AbstractArray<V>> ST withFlag(byte value)
public byte flag()
public int size()
public final boolean isEmpty()
public final boolean isAllowEmptyValue()
public <ST extends AbstractArray<V>> ST withAllowEmptyValue(boolean value)
public void setAllowEmptyValue(boolean value)
public final boolean isVisible()
public AbstractArray<V> withVisible(boolean value)
public final boolean isCaseSensitive()
public <ST extends AbstractArray<V>> ST withCaseSensitive(boolean value)
public final boolean isAllowDuplicate()
public <ST extends AbstractArray<V>> ST withAllowDuplicate(boolean value)
public final boolean isReadOnly()
public void reset()
public void clear()
protected int hashKey(int hashKey,
int len)
hashKey - the hashKey of a Objectlen - the max Length of all Hashvaluespublic java.util.Comparator<java.lang.Object> comparator()
public boolean isComparator()
protected int addHashItem(int pos,
java.lang.Object newValue,
java.lang.Object[] items)
newValue - the new Valuepos - the new Position -1 = Enditems - the HashList for searchingprotected int hasKeyAndPos(java.lang.Object element)
element - to add a Valuepublic java.lang.Object getKeyByIndex(int index)
protected java.lang.Object getByIndex(int offset,
int index,
int size)
protected int addKeyValue(int pos,
java.lang.Object key,
java.lang.Object value)
public java.lang.String toString()
public AbstractArray<V> with(java.lang.Object... values)
BaseItempublic AbstractArray<V> without(java.lang.Object... values)
protected void setValue(int pos,
java.lang.Object value,
int offset)
public AbstractArray<V> withList(java.util.Collection<?> list)
public int indexOf(java.lang.Object o)
o - Element for searchpublic int lastIndexOf(java.lang.Object o)
o - Element for searchpublic int getPositionKey(java.lang.Object o,
boolean last)
protected boolean checkValue(java.lang.Object a,
java.lang.Object b)
public boolean contains(java.lang.Object o)
public boolean containsAll(java.util.Collection<?> c)
public boolean removeAll(java.util.Collection<?> c)
This implementation iterates over this collection, checking each element returned by the iterator in turn to see if it's contained in the specified collection. If it's so contained, it's removed from this collection with the iterator's remove method.
Note that this implementation will throw an UnsupportedOperationException if the iterator returned by the iterator method does not implement the remove method and this collection contains one or more elements in common with the specified collection.
java.lang.UnsupportedOperationExceptionjava.lang.ClassCastExceptionjava.lang.NullPointerExceptioncontains(Object)public int removeByObject(java.lang.Object key)
public java.lang.Object[] toArray()
public java.lang.Object getValue(java.lang.Object key)
public boolean retainAll(java.util.Collection<?> c)
This implementation iterates over this collection, checking each element returned by the iterator in turn to see if it's contained in the specified collection. If it's not so contained, it's removed from this collection with the iterator's remove method.
Note that this implementation will throw an UnsupportedOperationException if the iterator returned by the iterator method does not implement the remove method and this collection contains one or more elements not present in the specified collection.
java.lang.UnsupportedOperationExceptionjava.lang.ClassCastExceptionjava.lang.NullPointerExceptioncontains(Object)public java.util.Iterator<V> iterator()
iterator in interface java.lang.Iterable<V>public <T> T[] toArray(T[] a)
If the list fits in the specified array with room to spare (i.e., the array has more elements than the list), the element in the array immediately following the end of the collection is set to null. (This is useful in determining the length of the list only if the caller knows that the list does not contain any null elements.)
T - the ContainerClassa - the array into which the elements of the list are to be
stored, if it is big enough; otherwise, a new array of the
same runtime type is allocated for this purpose.java.lang.ArrayStoreException - if the runtime type of the specified array is not a supertype
of the runtime type of every element in this listjava.lang.NullPointerException - if the specified array is nullpublic V get(int index)
public V first()
public V last()
public abstract BaseItem getNewList(boolean keyValue)
getNewList in interface BaseItempublic BaseItem subList(int fromIndex, int toIndex)
fromIndex - low endpoint (inclusive) of the subListtoIndex - high endpoint (exclusive) of the subListpublic <ST extends AbstractArray<V>> ST withSize(int size)
public void pack()
protected boolean fireProperty(java.lang.String type,
java.lang.Object oldElement,
java.lang.Object newElement,
java.lang.Object beforeElement,
java.lang.Object value)
public boolean move(int from,
int to)
protected java.lang.String parseItem(EntityStringConverter converter)
public java.lang.String toString(Converter converter)
public void setFlag(byte flag)