public Field(String name, TokenStream tokenStream, IndexableFieldType type) {if (name == null) {throw new IllegalArgumentException("name must not be null");}if (tokenStream == null) {throw new NullPointerException("tokenStream must not be null");}if (type.indexOptions() == IndexOptions.NONE || !type.tokenized()) {throw new IllegalArgumentException("TokenStream fields must be indexed and tokenized");}if (type.stored()) {throw new IllegalArgumentException("TokenStream fields cannot be stored");}this.name = name;this.fieldsData = null;this.tokenStream = tokenStream;this.type = type;}

public Field(string name, TokenStream tokenStream, FieldType type){if (name == null){throw new System.ArgumentNullException("name", "name cannot be null");}if (tokenStream == null){throw new System.ArgumentNullException("tokenStream", "tokenStream cannot be null");}if (type == null){throw new System.ArgumentNullException("type", "type cannot be null");}if (!type.IsIndexed || !type.IsTokenized){throw new System.ArgumentException("TokenStream fields must be indexed and tokenized");}if (type.IsStored){throw new System.ArgumentException("TokenStream fields cannot be stored");}this.m_name = name;this.FieldsData = null;this.m_tokenStream = tokenStream;this.m_type = type;}
