public boolean add ( Tag tag ) throws IllegalArgumentException { if ( tag == null ) { return false ; } // If empty list, use this as tag type. if ( this . type == null ) { this . type = tag . getClass ( ) ; } else if ( tag . getClass ( ) != this . type ) { throw new IllegalArgumentException ( "Tag type cannot differ from ListTag type." ) ; } return this . value . add ( tag ) ; }
Adds a tag to this list tag . If the list does not yet have a type it will be set to the type of the tag being added .