Class VariableSet
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Variable>,Map<String,,Variable> NavigableMap<String,,Variable> SequencedMap<String,,Variable> SortedMap<String,Variable>
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
ConstructorsConstructorDescriptionVariableSet(Variable variable) Creates a new variable set with a variable inside -
Method Summary
Modifier and TypeMethodDescriptionvoidaddVariable(Variable variable) Adds the given Variable object to the VariableSet.static Collector<Variable, VariableSet, VariableSet> booleanIndicates whether of not this object contains one or more Variable objects of data type Fundamental.booleanIndicates whether of not this object contains one or more Variable objects of data type NumericStatus.booleanIndicates whether of not this object contains one or more Variable objects of data type Numeric.booleanIndicates whether of not this object contains one or more Variable objects of data type String.booleancontainsVariable(String name) Indicates whether of not this object contains a Variable with the given name.booleanIndicates whether of not this object contains one or more Variable objects of data type VectorNumeric.static VariableSetstatic VariableSetfromCalsVars(Set<Variable> vars) Gets a Collection of all the FUNDAMENTAL Variable objects within the VariableSet.Gets a Collection of all the NUMERIC STATUS Variable objects within the VariableSet.Gets a Collection of all the NUMERIC Variable objects within the VariableSet.Gets a Collection of all the TEXT Variable objects within the VariableSet.getVariable(int idx) Deprecated.you should not try to obtain an n-th element of a set, even if it is an ordered set.getVariable(String name) Gets a Variable with the given name from the VariableSet if it exists.intGets a count of the number of Variable objects within the VariableSet.Get a set of the distinct data types of the Variable objects within the VariableSet.Get a set of the names of the Variable objects within the VariableSet.Gets a Collection of all the Variable objects within the VariableSet.Gets a Collection of all the VECTORNUMERIC Variable objects within the VariableSet.iterator()voidRemoves all Variable objects from the VariableSet.booleanremoveVariable(String name) Removes the Variable with the given name from the VariableSet.toString()Methods inherited from class java.util.TreeMap
ceilingEntry, ceilingKey, clear, clone, comparator, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, forEach, get, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, merge, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, putFirst, putIfAbsent, putLast, remove, replace, replace, replaceAll, size, subMap, subMap, tailMap, tailMap, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, isEmptyMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface java.util.NavigableMap
reversedMethods inherited from interface java.util.SequencedMap
sequencedEntrySet, sequencedKeySet, sequencedValues
-
Constructor Details
-
VariableSet
Creates a new variable set with a variable inside- Parameters:
variable- The Variable object to be added to the VariableSet.
-
VariableSet
public VariableSet()
-
-
Method Details
-
from
-
fromCalsVars
-
collector
-
getVariable
Gets a Variable with the given name from the VariableSet if it exists.- Parameters:
name- - the name of the required Variable.- Returns:
- the Variable with given name if it exists within the VariableSet. Returns null if does not exist.
-
getVariable
Deprecated.you should not try to obtain an n-th element of a set, even if it is an ordered set. Very inefficient.Gets a Variable from the given index in the VariableSet if it exists.- Parameters:
idx- - the index of the required Variable in the VariableSet.- Returns:
- the Variable with given index if it exists within the VariableSet. Returns null if does not exist.
-
getVariableCount
public int getVariableCount()Gets a count of the number of Variable objects within the VariableSet.- Returns:
- a count of the number of Variable objects within the VariableSet.
-
getVariableNames
Get a set of the names of the Variable objects within the VariableSet.- Returns:
- a set of the names of the Variable objects within the VariableSet.
-
getVariableDataTypes
Get a set of the distinct data types of the Variable objects within the VariableSet.- Returns:
- a set of the distinct data types of the Variable objects within the VariableSet.
-
getVariables
Gets a Collection of all the Variable objects within the VariableSet.- Returns:
- - a Collection of all the Variable objects within the VariableSet.
-
addVariable
Adds the given Variable object to the VariableSet. If the variable already exists with a different datasource, the datasource is updated- Parameters:
variable- The Variable object to be added to the VariableSet.
-
containsVariable
Indicates whether of not this object contains a Variable with the given name.- Parameters:
name- - the name of the Variable object to search for.- Returns:
- - true if this object is representing a Variable with the given name.
-
iterator
-
removeVariable
Removes the Variable with the given name from the VariableSet.- Parameters:
name- - the name of the Variable to be removed from the VariableSet.- Returns:
- - true if the Variable with the given name was removed from the VariableSet.
-
removeAllVariables
public void removeAllVariables()Removes all Variable objects from the VariableSet. -
containsNumericVariables
public boolean containsNumericVariables()Indicates whether of not this object contains one or more Variable objects of data type Numeric.- Returns:
- - true if this object contains one or more Variable objects of data type Numeric.
-
containsVectorNumericVariables
public boolean containsVectorNumericVariables()Indicates whether of not this object contains one or more Variable objects of data type VectorNumeric.- Returns:
- - true if this object contains one or more Variable objects of data type VectorNumeric.
-
containsNumericStatusVariables
public boolean containsNumericStatusVariables()Indicates whether of not this object contains one or more Variable objects of data type NumericStatus.- Returns:
- - true if this object contains one or more Variable objects of data type NumericStatus.
-
containsStringVariables
public boolean containsStringVariables()Indicates whether of not this object contains one or more Variable objects of data type String.- Returns:
- - true if this object contains one or more Variable objects of data type String.
-
containsFundamentalVariables
public boolean containsFundamentalVariables()Indicates whether of not this object contains one or more Variable objects of data type Fundamental.- Returns:
- - true if this object contains one or more Variable objects of data type Fundamental.
-
getNumericVariables
Gets a Collection of all the NUMERIC Variable objects within the VariableSet.- Returns:
- - a Collection of all the NUMERIC Variable objects within the VariableSet.
-
getNumericStatusVariables
Gets a Collection of all the NUMERIC STATUS Variable objects within the VariableSet.- Returns:
- - a Collection of all the NUMERIC STATUS Variable objects within the VariableSet.
-
getVectorNumericVariables
Gets a Collection of all the VECTORNUMERIC Variable objects within the VariableSet.- Returns:
- - a Collection of all the VECTORNUMERIC Variable objects within the VariableSet.
-
getStringVariables
Gets a Collection of all the TEXT Variable objects within the VariableSet.- Returns:
- - a Collection of all the TEXT Variable objects within the VariableSet.
-
getFundamentalVariables
Gets a Collection of all the FUNDAMENTAL Variable objects within the VariableSet.- Returns:
- - a Collection of all the FUNDAMENTAL Variable objects within the VariableSet.
-
toString
- Overrides:
toStringin classAbstractMap<String,Variable>
-