public 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 int |
BIG_KEY |
static int |
BIG_VALUE |
static byte |
CASESENSITIVE
Is Key is String and is Allow Casesensitive
|
static int |
DELETED |
java.lang.Object[] |
elements
May be
[...] elements for simple List or
[
SimpleList<K>,
BigList<K + Index>,
DeleteItem<Index-Sorted>,
SimpleValue<V>,
BigList<V + Index> for BIDIMAP
]
|
static java.lang.Object[] |
emptyArray |
byte |
flag
The Flag of List.
|
static byte |
MAP
Is The List has Key,Value
|
static int |
MAXDELETED |
static float |
MAXUSEDLIST |
static int |
MINHASHINGSIZE |
static byte |
MINSIZE |
static float |
MINUSEDLIST |
static byte |
READONLY
Is List is ReadOnly
|
static int |
SIZE_BIG |
static int |
SMALL_KEY |
static int |
SMALL_VALUE |
static byte |
VISIBLE
Is The List is Visible for Tree Editors
|
| Constructor and Description |
|---|
AbstractArray() |
| Modifier and Type | Method and Description |
|---|---|
<ST extends AbstractArray<V>> |
addFlag(byte flag) |
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 |
addKey(int pos,
java.lang.Object element,
int size)
Add a Key to internal List and Array if nesessary
Method to manipulate Array
|
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 void |
fireProperty(java.lang.Object oldElement,
java.lang.Object newElement,
java.lang.Object beforeElement,
java.lang.Object value) |
V |
first() |
java.lang.String |
flag() |
V |
get(int index) |
protected java.lang.Object |
getByIndex(int offset,
int index,
int size) |
java.lang.Object |
getKeyByIndex(int index) |
int |
getLastPositionKey(java.lang.Object o) |
BaseItem |
getNewList(boolean keyValue) |
int |
getPositionKey(java.lang.Object o) |
int |
getPositionValue(java.lang.Object o) |
byte |
getSignalFlag() |
java.lang.Object |
getValueItem(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 |
hasKey(java.lang.Object element,
int size)
Add a Element to the List
|
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)
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.
|
void |
move(int from,
int to) |
void |
pack() |
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) |
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.
|
protected void |
setValue(int pos,
java.lang.Object value,
int offset) |
int |
size() |
BaseItem |
subList(int fromIndex,
int toIndex) |
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.
|
AbstractArray<V> |
withAll(java.lang.Object... values) |
<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(int value) |
AbstractArray<V> |
withList(java.util.Collection<?> list) |
AbstractArray<V> |
without(java.lang.Object... values) |
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 byte MINSIZE
public static final int MAXDELETED
public static final int MINHASHINGSIZE
public static final float MINUSEDLIST
public static final float MAXUSEDLIST
public static final int SMALL_KEY
public static final int BIG_KEY
public static final int DELETED
public static final int SMALL_VALUE
public static final int BIG_VALUE
public static final int SIZE_BIG
public byte flag
ALLOWDUPLICATE,
ALLOWEMPTYVALUE,
VISIBLE,
CASESENSITIVE,
MAP,
BIDIpublic java.lang.Object[] elements
public static final java.lang.Object[] emptyArray
public <ST extends AbstractArray<V>> ST addFlag(byte flag)
public <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)
ST - Container Classitems - Array of the new Listsize - the new Size of the Listpublic <ST extends AbstractArray<V>> ST withFlag(int value)
public byte getSignalFlag()
public int size()
public boolean isEmpty()
public boolean isAllowEmptyValue()
public <ST extends AbstractArray<V>> ST withAllowEmptyValue(boolean value)
public boolean isVisible()
public AbstractArray<V> withVisible(boolean value)
public boolean isCaseSensitive()
public <ST extends AbstractArray<V>> ST withCaseSensitive(boolean value)
public boolean isAllowDuplicate()
public <ST extends AbstractArray<V>> ST withAllowDuplicate(boolean value)
public boolean isReadOnly()
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 hasKey(java.lang.Object element,
int size)
element - to add a Valuesize - the new Size of the Listprotected 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)
protected int addKey(int pos,
java.lang.Object element,
int size)
element - the new Valuepos - the new Position -1 = Endsize - the newSize of the Listpublic java.lang.String flag()
public AbstractArray<V> withAll(java.lang.Object... values)
public 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)
public int getPositionValue(java.lang.Object o)
public int getLastPositionKey(java.lang.Object o)
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 getValueItem(java.lang.Object key)
getValueItem in interface BaseItempublic 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 BaseItem getNewList(boolean keyValue)
getNewList in interface BaseItempublic BaseItem subList(int fromIndex, int toIndex)
public void pack()
protected void fireProperty(java.lang.Object oldElement,
java.lang.Object newElement,
java.lang.Object beforeElement,
java.lang.Object value)
public void move(int from,
int to)