Package edu.cmu.tetrad.data
Class DataModelList
- All Implemented Interfaces:
- DataModel,- KnowledgeTransferable,- VariableSource,- TetradSerializable,- Serializable,- Iterable<DataModel>,- Collection<DataModel>,- List<DataModel>,- SequencedCollection<DataModel>
Stores a list of data models and keeps track of which one is selected.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionConstructor for DataModelList.DataModelList(DataModelList dataModelList) Constructor for DataModelList.
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds the given DataModel to the list at the given index.booleanUse this to check if the dataModelList only contains the default empty dataset that is being used to populat the empty spreadsheet - Added by Kevincopy()copy.booleanget(int index) Getter for the fieldknowledge.Getter for the fieldmodelList.getName()Gets the name of the data model list.Getter for the fieldselectedModel.getVariable(String name) getVariable.getVariableNames.getVariables.inthashCode()hashCode.booleanisContinuous.booleanisDiscrete.booleanisEmpty()booleanisMixed()isMixed.remove(int index) static DataModelListGenerates a simple exemplar of this class to test serialization.voidsetKnowledge(Knowledge knowledge) Sets knowledge to a copy of the given object.voidSets the name of the data model (may be null).voidsetSelectedModel(DataModel model) Setter for the fieldselectedModel.intsize()toString()toString.Methods inherited from class java.util.AbstractListadd, addAll, clear, indexOf, iterator, lastIndexOf, listIterator, listIterator, set, subListMethods inherited from class java.util.AbstractCollectionaddAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArrayMethods inherited from interface java.util.CollectionparallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.ListaddAll, addFirst, addLast, contains, containsAll, getFirst, getLast, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, toArray, toArray
- 
Constructor Details- 
DataModelListpublic DataModelList()Constructor for DataModelList. 
- 
DataModelListConstructor for DataModelList. - Parameters:
- dataModelList- a- DataModelListobject
 
 
- 
- 
Method Details- 
serializableInstanceGenerates a simple exemplar of this class to test serialization.- Returns:
- a DataModelListobject
 
- 
get
- 
sizepublic int size()- Specified by:
- sizein interface- Collection<DataModel>
- Specified by:
- sizein interface- List<DataModel>
- Specified by:
- sizein class- AbstractCollection<DataModel>
 
- 
getVariablesgetVariables. - Specified by:
- getVariablesin interface- VariableSource
- Returns:
- a Listobject
 
- 
getKnowledgeGetter for the field knowledge.- Specified by:
- getKnowledgein interface- KnowledgeTransferable
- Returns:
- a Knowledgeobject
 
- 
setKnowledgeSets knowledge to a copy of the given object.- Specified by:
- setKnowledgein interface- KnowledgeTransferable
- Parameters:
- knowledge- the knowledge to set
 
- 
getVariableNamesgetVariableNames. - Specified by:
- getVariableNamesin interface- VariableSource
- Returns:
- the list of variable names for columns, in order.
 
- 
addAdds the given DataModel to the list at the given index. Required for AbstractList.
- 
isEmptypublic boolean isEmpty()Check if the modeList is empty Need to override this since this class is extending AbstractList. - Specified by:
- isEmptyin interface- Collection<DataModel>
- Specified by:
- isEmptyin interface- List<DataModel>
- Overrides:
- isEmptyin class- AbstractCollection<DataModel>
 
- 
containsEmptyDatapublic boolean containsEmptyData()Use this to check if the dataModelList only contains the default empty dataset that is being used to populat the empty spreadsheet - Added by Kevin- Returns:
- a boolean
 
- 
getModelListGetter for the field modelList.- Returns:
- a Listobject
 
- 
removeRemoves the DataModel at the given index. Required for AbstractList. Required for AbstractList. 
- 
getSelectedModelGetter for the field selectedModel.- Returns:
- the model that is currently selected. The default is the first model. If there are no models in the list, null is returned.
 
- 
setSelectedModelSetter for the field selectedModel.- Parameters:
- model- a- DataModelobject
 
- 
getNameGets the name of the data model list.
- 
setNameSets the name of the data model (may be null).Sets the name of the data model list.. 
- 
toStringtoString. - Specified by:
- toStringin interface- DataModel
- Overrides:
- toStringin class- AbstractCollection<DataModel>
- Returns:
- a string representation of the data model list.
 
- 
isContinuouspublic boolean isContinuous()isContinuous. - Specified by:
- isContinuousin interface- DataModel
- Returns:
- true if the data model is continuous, false otherwise.
 
- 
isDiscretepublic boolean isDiscrete()isDiscrete. - Specified by:
- isDiscretein interface- DataModel
- Returns:
- true if the data model is discrete, false otherwise.
 
- 
isMixedpublic boolean isMixed()isMixed. 
- 
getVariablegetVariable. - Specified by:
- getVariablein interface- DataModel
- Parameters:
- name- a- Stringobject
- Returns:
- the variable with the given name, or null if no such variable exists.
 
- 
copycopy. 
- 
hashCodepublic int hashCode()hashCode. - Specified by:
- hashCodein interface- Collection<DataModel>
- Specified by:
- hashCodein interface- List<DataModel>
- Overrides:
- hashCodein class- AbstractList<DataModel>
- Returns:
- a int
 
- 
equals- Specified by:
- equalsin interface- Collection<DataModel>
- Specified by:
- equalsin interface- List<DataModel>
- Overrides:
- equalsin class- AbstractList<DataModel>
 
 
-