Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Constructor for nominal attributes and string attributes. If a null vector
- * of attribute values is passed to the method, the attribute is assumed to be
- * a string.
- *
- * @param attributeName the name for the attribute
- * @param attributeValues a vector of strings denoting the attribute values.
- * Null if the attribute is a string attribute.
- */
- // @ requires attributeName != null;
- // @ ensures m_Name == attributeName;
- public Attribute(String attributeName, List<String> attributeValues) {
- this(attributeName, attributeValues, (ProtectedProperties)null);
- }
- /**
- * Constructor for nominal attributes and string attributes, where metadata is
- * supplied. If a null vector of attribute values is passed to the method, the
- * attribute is assumed to be a string.
- *
- * @param attributeName the name for the attribute
- * @param attributeValues a vector of strings denoting the attribute values.
- * Null if the attribute is a string attribute.
- * @param metadata the attribute's properties
- */
- // @ requires attributeName != null;
- // @ requires metadata != null;
- /*
- * @ ensures m_Name == attributeName; ensures m_Index == -1; ensures
- * attributeValues == null && m_Type == STRING || attributeValues != null &&
- * m_Type == NOMINAL && m_Values.size() == attributeValues.size(); signals
- * (IllegalArgumentException ex) (* if duplicate strings in attributeValues
- * *);
- */
- public Attribute(String attributeName, List<String> attributeValues,
- ProtectedProperties metadata) {
- m_Name = attributeName;
- m_AttributeInfo = new NominalAttributeInfo(attributeValues, attributeName);
- if (attributeValues == null) {
- m_Type = STRING;
- } else {
- m_Type = NOMINAL;
- }
- if (metadata != null) {
- m_AttributeMetaInfo = new AttributeMetaInfo(metadata, this);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement