Android Programming Press on the image to return to the main documentation page.

DataCollection

Written by Fr\u00e9d\u00e9ric Leneuf-Magaud

List of types:

dcArrayDeque
dcBitSet
dcCollectionSerializer
dcIterator
dcPriorityQueue
dcSparseArray
dcStack
dcTreeMap
dcTreeSet

dcArrayDeque


Events:

None

Members:


  AddFirst (Obj As Object)

  AddLast (Obj As Object)

  Clear

  Contains (Obj As Object) As Boolean

  DescendingIterator As dcIterator

  Get (Index As Int) As Object

  Initialize

  Initialize2 (InitialCapacity As Int)

  IsEmpty As Boolean

  IsInitialized As Boolean

  Iterator As dcIterator

  PeekFirst As Object

  PeekLast As Object

  PollFirst As Object

  PollLast As Object

  Remove (Obj As Object) As Boolean

  Size As Int

  toArray As Object()

Members description:

AddFirst (Obj As Object)
Inserts the specified object at the front of this deque.
AddLast (Obj As Object)
Inserts the specified object at the end of this deque.
Clear
Removes all objects from this deque, leaving it empty.
Contains (Obj As Object) As Boolean
Returns True if this deque contains the specified object.
DescendingIterator As dcIterator
Returns an iterator over the objects in this deque in reverse sequential order. The elements will be returned in order from last (tail) to first (head).
Get (Index As Int) As Object
Returns the object at the given index in this deque, or Null if not found.
Initialize
Constructs an empty array deque with an initial capacity sufficient to hold 16 objects.
Initialize2 (InitialCapacity As Int)
Constructs an empty array deque with an initial capacity sufficient to hold the specified number of objects.
IsEmpty As Boolean
Returns true if this deque contains no objects.
IsInitialized As Boolean
Iterator As dcIterator
Returns an iterator over the objects in this deque. The objects will be ordered from first (head) to last (tail).
PeekFirst As Object
Retrieves, but does not remove, the first object of this deque, or returns Null if this deque is empty.
PeekLast As Object
Retrieves, but does not remove, the last object of this deque, or returns Null if this deque is empty.
PollFirst As Object
Retrieves and removes the first object of this deque, or returns Null if this deque is empty.
PollLast As Object
Retrieves and removes the last object of this deque, or returns Null if this deque is empty.
Remove (Obj As Object) As Boolean
Removes the first occurrence of the specified object in this deque (when traversing the deque from head to tail). If the deque does not contain the object, it is unchanged.
Returns True if this deque contained the specified object.
Size As Int
Returns the number of objects in this deque.
toArray As Object()
Returns an array containing all of the objects in this deque in proper sequence (from first to last element).

dcBitSet


Events:

None

Members:


  And (BS As dcBitSet)

  AndNot (BS As dcBitSet)

  Cardinality As Int [read only]

  Clear

  Flip (Index As Int)

  Get (Index As Int) As Boolean

  Initialize

  Initialize2 (BitCount As Int)

  IsEmpty As Boolean

  IsInitialized As Boolean

  Length As Int [read only]

  Or (BS As dcBitSet)

  Set (Index As Int, State As Boolean)

  SetRange (FromIndex As Int, ToIndex As Int, State As Boolean)

  toString As String

  Xor (BS As dcBitSet)

Members description:

And (BS As dcBitSet)
Performs a logical AND of this BitSet with BS.
AndNot (BS As dcBitSet)
Clears all bits in this BitSet which are also set in BS.
Cardinality As Int [read only]
Returns the number of bits that are True in this BitSet.
Clear
Clears all the bits in this BitSet. This function does not change the capacity.
Flip (Index As Int)
Flips the bit at the given index.
Get (Index As Int) As Boolean
Returns the bit at the given index. Indexes greater than the current length return False.
Initialize
Initializes a new BitSet with size equal to 64 bits.
Initialize2 (BitCount As Int)
Initializes a new BitSet with size equal to BitCount, rounded up to a multiple of 64.
IsEmpty As Boolean
Returns True if all the bits in this BitSet are set to False, otherwise False.
IsInitialized As Boolean
Length As Int [read only]
Returns the number of bits up to and including the highest bit set. This is unrelated to the capacity of the BitSet.
Or (BS As dcBitSet)
Performs a logical OR of this BitSet with BS.
Set (Index As Int, State As Boolean)
Sets the bit at the given index to State.
SetRange (FromIndex As Int, ToIndex As Int, State As Boolean)
Sets the range of bits FromIndex...ToIndex to State.
toString As String
Xor (BS As dcBitSet)
Performs a logical XOR of this BitSet with BS.

dcCollectionSerializer


Events:

None

Members:


  ArrayDequeToBytes (ArrayDeque As dcArrayDeque) As Byte()

  ArrayDequeToCompressedBytes (ArrayDeque As dcArrayDeque) As Byte()

  BitSetToBytes (BitSet As dcBitSet) As Byte()

  BitSetToCompressedBytes (BitSet As dcBitSet) As Byte()

  BytesToArrayDeque (arrBytes() As Byte) As dcArrayDeque

  BytesToBitSet (arrBytes() As Byte) As dcBitSet

  BytesToList (arrBytes() As Byte) As List

  BytesToMap (arrBytes() As Byte) As Map

  BytesToObject (arrBytes() As Byte) As Object

  BytesToPriorityQueue (arrBytes() As Byte) As dcPriorityQueue

  BytesToSparseArray (arrBytes() As Byte) As dcSparseArray

  BytesToStack (arrBytes() As Byte) As dcStack

  BytesToTreeMap (arrBytes() As Byte) As dcTreeMap

  BytesToTreeSet (arrBytes() As Byte) As dcTreeSet

  CompressedBytesToArrayDeque (arrBytes() As Byte) As dcArrayDeque

  CompressedBytesToBitSet (arrBytes() As Byte) As dcBitSet

  CompressedBytesToList (arrBytes() As Byte) As List

  CompressedBytesToMap (arrBytes() As Byte) As Map

  CompressedBytesToObject (arrBytes() As Byte) As Object

  CompressedBytesToPriorityQueue (arrBytes() As Byte) As dcPriorityQueue

  CompressedBytesToSparseArray (arrBytes() As Byte) As dcSparseArray

  CompressedBytesToStack (arrBytes() As Byte) As dcStack

  CompressedBytesToTreeMap (arrBytes() As Byte) As dcTreeMap

  CompressedBytesToTreeSet (arrBytes() As Byte) As dcTreeSet

  FillWithMap (Obj As Object, Map As Map)

  ListToBytes (List As List) As Byte()

  ListToCompressedBytes (List As List) As Byte()

  MapToBytes (Map As Map) As Byte()

  MapToCompressedBytes (Map As Map) As Byte()

  ObjectToBytes (Object As Object) As Byte()

  ObjectToCompressedBytes (Object As Object) As Byte()

  PriorityQueueToBytes (PriorityQueue As dcPriorityQueue) As Byte()

  PriorityQueueToCompressedBytes (PriorityQueue As dcPriorityQueue) As Byte()

  SparseArrayToBytes (SpArr As dcSparseArray) As Byte()

  SparseArrayToCompressedBytes (SpArr As dcSparseArray) As Byte()

  StackToBytes (Stack As dcStack) As Byte()

  StackToCompressedBytes (Stack As dcStack) As Byte()

  TreeMapToBytes (TreeMap As dcTreeMap) As Byte()

  TreeMapToCompressedBytes (TreeMap As dcTreeMap) As Byte()

  TreeSetToBytes (TreeSet As dcTreeSet) As Byte()

  TreeSetToCompressedBytes (TreeSet As dcTreeSet) As Byte()

Members description:

ArrayDequeToBytes (ArrayDeque As dcArrayDeque) As Byte()
ArrayDequeToCompressedBytes (ArrayDeque As dcArrayDeque) As Byte()
BitSetToBytes (BitSet As dcBitSet) As Byte()
BitSetToCompressedBytes (BitSet As dcBitSet) As Byte()
BytesToArrayDeque (arrBytes() As Byte) As dcArrayDeque
BytesToBitSet (arrBytes() As Byte) As dcBitSet
BytesToList (arrBytes() As Byte) As List
BytesToMap (arrBytes() As Byte) As Map
BytesToObject (arrBytes() As Byte) As Object
BytesToPriorityQueue (arrBytes() As Byte) As dcPriorityQueue
BytesToSparseArray (arrBytes() As Byte) As dcSparseArray
BytesToStack (arrBytes() As Byte) As dcStack
BytesToTreeMap (arrBytes() As Byte) As dcTreeMap
BytesToTreeSet (arrBytes() As Byte) As dcTreeSet
CompressedBytesToArrayDeque (arrBytes() As Byte) As dcArrayDeque
CompressedBytesToBitSet (arrBytes() As Byte) As dcBitSet
CompressedBytesToList (arrBytes() As Byte) As List
CompressedBytesToMap (arrBytes() As Byte) As Map
CompressedBytesToObject (arrBytes() As Byte) As Object
CompressedBytesToPriorityQueue (arrBytes() As Byte) As dcPriorityQueue
CompressedBytesToSparseArray (arrBytes() As Byte) As dcSparseArray
CompressedBytesToStack (arrBytes() As Byte) As dcStack
CompressedBytesToTreeMap (arrBytes() As Byte) As dcTreeMap
CompressedBytesToTreeSet (arrBytes() As Byte) As dcTreeSet
FillWithMap (Obj As Object, Map As Map)
Fills Obj with the Map data returned by a deserialization function (BytesTo... or CompressedBytesTo...).
The two structures may not fully match. If a field is not found in the map, its value stays unchanged.
It is recommended to initialize Obj before calling this function.
ListToBytes (List As List) As Byte()
ListToCompressedBytes (List As List) As Byte()
MapToBytes (Map As Map) As Byte()
MapToCompressedBytes (Map As Map) As Byte()
ObjectToBytes (Object As Object) As Byte()
ObjectToCompressedBytes (Object As Object) As Byte()
PriorityQueueToBytes (PriorityQueue As dcPriorityQueue) As Byte()
PriorityQueueToCompressedBytes (PriorityQueue As dcPriorityQueue) As Byte()
SparseArrayToBytes (SpArr As dcSparseArray) As Byte()
SparseArrayToCompressedBytes (SpArr As dcSparseArray) As Byte()
StackToBytes (Stack As dcStack) As Byte()
StackToCompressedBytes (Stack As dcStack) As Byte()
TreeMapToBytes (TreeMap As dcTreeMap) As Byte()
TreeMapToCompressedBytes (TreeMap As dcTreeMap) As Byte()
TreeSetToBytes (TreeSet As dcTreeSet) As Byte()
TreeSetToCompressedBytes (TreeSet As dcTreeSet) As Byte()

dcIterator


Events:

None

Members:


  HasNext As Boolean

  NextObject As Object

  Remove

Members description:

HasNext As Boolean
Returns True if there is at least one more element, False otherwise.
NextObject As Object
Returns the next object and advances the iterator.
Remove
Removes the last object returned by NextObject from the collection. This function can only be called once between each call to NextObject.

dcPriorityQueue


Events:

Compare(Obj1 As Object, Obj2 As Object) As Int

Members:


  Add (Obj As Object)

  Clear

  Contains (Obj As Object) As Boolean

  Initialize

  Initialize2 (InitialCapacity As Int)

  Initialize3 (InitialCapacity As Int, Comparator As String)

  IsEmpty As Boolean

  IsInitialized As Boolean

  Iterator As dcIterator

  Peek As Object

  Poll As Object

  Remove (Obj As Object) As Boolean

  Size As Int

  toArray As Object()

Members description:

Add (Obj As Object)
Adds the specified object to the priority queue.
Clear
Removes all the objects of the priority queue.
Contains (Obj As Object) As Boolean
Returns True if this queue contains the specified object.
Initialize
Initializes a priority queue with an initial capacity of 11 and natural ordering.
Initialize2 (InitialCapacity As Int)
Initializes a priority queue with the specified capacity and natural ordering.
Initialize3 (InitialCapacity As Int, Comparator As String)
Initializes a priority queue with the specified capacity.
This queue orders the objects with the specified comparison function, which must return:
an integer < 0 if Obj1 is less than Obj2;
0 if they are equal;
an integer > 0 if Obj1 is greater than Obj2.
IsEmpty As Boolean
Returns whether the queue is empty or not.
IsInitialized As Boolean
Iterator As dcIterator
Returns an iterator over the objects in this queue. The iterator does not return the objects in any particular order.
Peek As Object
Gets but does not remove the head of the queue.
Poll As Object
Gets and removes the head of the queue.
Remove (Obj As Object) As Boolean
Removes the specified object from the priority queue.
Size As Int
Returns the number of objects in this queue.
toArray As Object()
Returns a new array containing all objects contained in this queue. The objects are in no particular order.

dcSparseArray


Events:

None

Members:


  Append (Key As Int, Value As Object)

  Clear

  Get (Key As Int) As Object

  GetDefault (Key As Int, DefaultValue As Object) As Object

  GetKeyAt (Index As Int) As Int

  GetValueAt (Index As Int) As Object

  IndexOfKey (Key As Int) As Int

  IndexOfValue (Value As Object) As Int

  Initialize

  Initialize2 (Capacity As Int)

  IsInitialized As Boolean

  Put (Key As Int, Value As Object)

  Remove (Key As Int)

  SetValueAt (Index As Int, Value As Object)

  Size As Int

  toString As String

Members description:

Append (Key As Int, Value As Object)
Same as Put but faster to append mappings where the key is greater than all existing keys in the array.
Clear
Removes all key-value mappings from this SparseArray.
Get (Key As Int) As Object
Gets the Object mapped from the specified key, or Null if no such mapping has been made.
GetDefault (Key As Int, DefaultValue As Object) As Object
Gets the Object mapped from the specified key, or the specified default value if no such mapping has been made.
GetKeyAt (Index As Int) As Int
Returns the key from the Indexth key-value mapping that this SparseArray stores. Index must be in the range 0..Size-1.
GetValueAt (Index As Int) As Object
Returns the value from the Indexth key-value mapping that this SparseArray stores. Index must be in the range 0..Size-1.
IndexOfKey (Key As Int) As Int
Returns an index for which GetKeyAt would return the specified key, or a negative number if the specified key is not mapped.
IndexOfValue (Value As Object) As Int
Returns an index for which GetValueAt would return the specified value, or a negative number if no key maps to the specified value.
Initialize
Creates a new SparseArray containing no mappings.
Initialize2 (Capacity As Int)
Creates a new SparseArray containing no mappings that will not require any additional memory allocation to store the specified number of mappings.
IsInitialized As Boolean
Put (Key As Int, Value As Object)
Adds a mapping from the specified key to the specified value, replacing the previous mapping from the specified key if there was one.
Remove (Key As Int)
Removes the mapping from the specified key, if there was any.
SetValueAt (Index As Int, Value As Object)
Sets a new value for the Indexth key-value mapping that this SparseArray stores. Index must be in the range 0..Size-1.
Size As Int
Returns the number of key-value mappings that this SparseArray currently stores.
toString As String
Returns a string containing a concise, human-readable description of this object.

dcStack


Events:

None

Members:


  Clear

  Get (Index As Int) As Object

  IndexOf (Obj As Object) As Int

  Initialize

  InsertAt (Obj As Object, Index As Int)

  IsEmpty As Boolean

  IsInitialized As Boolean

  Peek As Object

  Pop As Object

  Push (Obj As Object)

  RemoveAt (Index As Int)

  Set (Index As Int, Obj As Object) As Object

  Size As Int

  toArray As Object()

Members description:

Clear
Removes all objects from this stack, leaving it empty.
Get (Index As Int) As Object
Returns the object at the specified location in this stack.
IndexOf (Obj As Object) As Int
Returns the index of the first occurrence of the object, starting from the top of the stack, or -1 if not found.
Initialize
InsertAt (Obj As Object, Index As Int)
Inserts the specified object into this stack at the specified location.
IsEmpty As Boolean
Returns whether the stack is empty or not.
IsInitialized As Boolean
Peek As Object
Returns the object at the top of the stack without removing it.
Pop As Object
Returns the object at the top of the stack and removes it.
Push (Obj As Object)
Pushes the specified object onto the top of the stack.
RemoveAt (Index As Int)
Removes the object at the specified location from this stack.
Set (Index As Int, Obj As Object) As Object
Replaces the object at the specified location in this stack with the specified object.
Size As Int
Returns the number of objects in this stack.
toArray As Object()
Returns a new array containing all objects contained in this stack.

dcTreeMap


Events:

Compare(Obj1 As Object, Obj2 As Object) As Int

Members:


  Clear

  ContainsKey (Key As Object) As Boolean

  ContainsValue (Value As Object) As Boolean

  Get (Key As Object) As Object

  GetDefault (Key As Object, Default As Object) As Object

  GetKeyAt (Index As Int) As Object

  GetValueAt (Index As Int) As Object

  Initialize

  Initialize2 (Comparator As String)

  IsEmpty As Boolean

  IsInitialized As Boolean

  Keys As IterableList

  KeysIterator As dcIterator

  Put (Key As Object, Value As Object) As Object

  Remove (Key As Object) As Object

  Size As Int

  Values As IterableList

  ValuesIterator As dcIterator

Members description:

Clear
Removes all elements from this map, leaving it empty.
ContainsKey (Key As Object) As Boolean
Returns whether this map contains the specified key.
ContainsValue (Value As Object) As Boolean
Returns whether this map contains the specified value.
Get (Key As Object) As Object
Returns the value of the mapping with the specified key, or Null if no mapping for the specified key is found.
GetDefault (Key As Object, Default As Object) As Object
Returns the value of the mapping with the specified key, or the specified default value if no mapping for the specified key is found.
GetKeyAt (Index As Int) As Object
Returns the key of the mapping at the given index, or Null if not found.
GetValueAt (Index As Int) As Object
Returns the value of the mapping at the given index, or Null if not found.
Initialize
Initializes a new TreeMap which uses natural ordering.
Initialize2 (Comparator As String)
Initializes a new TreeMap which uses the specified comparison function.
The comparison function must return:
an integer < 0 if Obj1 is less than Obj2;
0 if they are equal;
an integer > 0 if Obj1 is greater than Obj2.
IsEmpty As Boolean
Returns whether this map is empty.
IsInitialized As Boolean
Keys As IterableList
Returns an object which can be used to iterate over all the keys with a For Each block.
KeysIterator As dcIterator
Returns an iterator on the keys of this map.
Put (Key As Object, Value As Object) As Object
Maps the specified key to the specified value. Returns the value of any previous mapping with the specified key or Null if there was no mapping.
Remove (Key As Object) As Object
Removes a mapping with the specified key from this map. Returns the value of the removed mapping or Null if no mapping for the specified key was found.
Size As Int
Returns the number of mappings in this map.
Values As IterableList
Returns an object which can be used to iterate over all the values with a For Each block.
ValuesIterator As dcIterator
Returns an iterator on the values of this map.

dcTreeSet


Events:

Compare(Obj1 As Object, Obj2 As Object) As Int

Members:


  Add (Obj As Object) As Boolean

  Ceiling (Obj As Object) As Object

  Clear

  Contains (Obj As Object) As Boolean

  DescendingIterator As dcIterator

  First As Object

  Floor (Obj As Object) As Object

  Get (Index As Int) As Object

  Higher (Obj As Object) As Object

  Initialize

  Initialize2 (Comparator As String)

  IsEmpty As Boolean

  IsInitialized As Boolean

  Iterator As dcIterator

  Last As Object

  Lower (Obj As Object) As Object

  PollFirst As Object

  PollLast As Object

  Remove (Obj As Object) As Boolean

  Size As Int

Members description:

Add (Obj As Object) As Boolean
Adds the specified object to this set.
Ceiling (Obj As Object) As Object
Returns the least element in this set greater than or equal to the given object, or Null if there is no such element.
Clear
Removes all objects from this set, leaving it empty.
Contains (Obj As Object) As Boolean
Searches this set for the specified object.
DescendingIterator As dcIterator
Returns an iterator on the objects of this set, in descending order.
First As Object
Returns the first object in this set.
Floor (Obj As Object) As Object
Returns the greatest element in this set less than or equal to the given object, or Null if there is no such element.
Get (Index As Int) As Object
Returns the object at the given index in this set, or Null if not found.
Higher (Obj As Object) As Object
Returns the least element in this set strictly greater than the given object, or Null if there is no such element.
Initialize
Initializes a new TreeSet which uses natural ordering.
Initialize2 (Comparator As String)
Initializes a new TreeSet which uses the specified comparison function.
The comparison function must return:
an integer < 0 if Obj1 is less than Obj2;
0 if they are equal;
an integer > 0 if Obj1 is greater than Obj2.
IsEmpty As Boolean
Returns True if this set has no element, otherwise False.
IsInitialized As Boolean
Iterator As dcIterator
Returns an iterator on the objects of this set.
Last As Object
Returns the last object in this set.
Lower (Obj As Object) As Object
Returns the greatest element in this set strictly less than the given object, or Null if there is no such element.
PollFirst As Object
Retrieves and removes the first object, or returns Null if this set is empty.
PollLast As Object
Retrieves and removes the last object, or returns Null if this set is empty.
Remove (Obj As Object) As Boolean
Removes an occurrence of the specified object from this set.
Size As Int
Returns the number of objects in this set.
Top