Package com.bayesserver.data
Class DataColumnCollection
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<DataColumn>
-
- com.bayesserver.data.DataColumnCollection
-
- All Implemented Interfaces:
Iterable<DataColumn>,Collection<DataColumn>,List<DataColumn>
public final class DataColumnCollection extends AbstractList<DataColumn>
Represents a collection of columns in a DataTable, a simple in-memory data store.
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, DataColumn element)Adds a DataColumn instance at the given index.DataColumnadd(String columnName, Class dataType)Adds a new DataColumn to the collection.voidclear()Removes all columns for the collection.DataColumnget(int index)Gets the DataColumn at the given index.DataColumnget(String columnName)Gets the column with the specified name, or null if the name if not found.intindexOf(String columnName)Gets the index of the column with the given name.DataColumnremove(int index)Removes the DataColumn at the given index.intsize()Gets the number of columns in the collection.-
Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, set, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
-
-
-
Method Detail
-
get
public DataColumn get(String columnName)
Gets the column with the specified name, or null if the name if not found.- Parameters:
columnName- The name to find.- Returns:
- The DataColumn instance with the specified name or null if not found.
-
add
public DataColumn add(String columnName, Class dataType)
Adds a new DataColumn to the collection.- Parameters:
columnName- The name of the new column.dataType- The data type for the new column.- Returns:
- The new DataColumn instance.
-
indexOf
public int indexOf(String columnName)
Gets the index of the column with the given name.
-
get
public DataColumn get(int index)
Gets the DataColumn at the given index.- Specified by:
getin interfaceList<DataColumn>- Specified by:
getin classAbstractList<DataColumn>- Parameters:
index- The zero based index for the column to retrieve.- Returns:
- The DataColumn at the specified index.
-
remove
public DataColumn remove(int index)
Removes the DataColumn at the given index.- Specified by:
removein interfaceList<DataColumn>- Overrides:
removein classAbstractList<DataColumn>- Parameters:
index- The zero based index of the column to remove.- Returns:
- The DataColumn instance that was removed.
-
add
public void add(int index, DataColumn element)Adds a DataColumn instance at the given index.- Specified by:
addin interfaceList<DataColumn>- Overrides:
addin classAbstractList<DataColumn>- Parameters:
index- The zero based index.element- The column to add.
-
clear
public void clear()
Removes all columns for the collection.- Specified by:
clearin interfaceCollection<DataColumn>- Specified by:
clearin interfaceList<DataColumn>- Overrides:
clearin classAbstractList<DataColumn>
-
size
public int size()
Gets the number of columns in the collection.- Specified by:
sizein interfaceCollection<DataColumn>- Specified by:
sizein interfaceList<DataColumn>- Specified by:
sizein classAbstractCollection<DataColumn>
-
-