|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mit.jwi.data.DataType<T>
T - the type of object for the content typepublic class DataType<T>
A concrete implementation of the IDataType interface. This class
provides the data types necessary for Wordnet in the form of static
fields. It is not implemented as an Enum so that clients may add
their own content types by instantiating this class.
| Field Summary | |
|---|---|
static DataType<ISynset> |
DATA
|
static DataType<IExceptionEntryProxy> |
EXCEPTION
|
static DataType<IIndexWord> |
INDEX
|
static DataType<ISenseEntry> |
SENSE
|
| Constructor Summary | |
|---|---|
DataType(java.lang.String userFriendlyName,
boolean hasVersion,
ILineParser<T> parser,
java.util.Collection<java.lang.String> hints)
Constructs a new data type. |
|
DataType(java.lang.String userFriendlyName,
boolean hasVersion,
ILineParser<T> parser,
java.lang.String... hints)
Constructs a new data type. |
|
| Method Summary | |
|---|---|
static boolean |
containsOneOf(java.lang.String target,
java.util.Set<java.lang.String> patterns)
Checks to see if one of the string patterns specified in the set of strings is found in the specified target string. |
static java.io.File |
find(IDataType<?> type,
POS pos,
java.util.Collection<? extends java.io.File> files)
Finds the first file that satisfies the naming constraints of both the data type and part of speech. |
ILineParser<T> |
getParser()
Returns the line parser that can be used to process lines of data retrieved from an IDataSource file with this type. |
java.util.Set<java.lang.String> |
getResourceNameHints()
Returns an immutable set of strings that can be used as keywords to identify resources that are of this type. |
boolean |
hasVersion()
Indicates whether this content type usually has wordnet version information encoded in its header. |
java.lang.String |
toString()
|
static java.util.Collection<DataType<?>> |
values()
Emulates the Enum.values() function. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final DataType<IIndexWord> INDEX
public static final DataType<ISynset> DATA
public static final DataType<IExceptionEntryProxy> EXCEPTION
public static final DataType<ISenseEntry> SENSE
| Constructor Detail |
|---|
public DataType(java.lang.String userFriendlyName,
boolean hasVersion,
ILineParser<T> parser,
java.lang.String... hints)
userFriendlyName - a user-friendly name, for easy identification of this data
type; may be nullhasVersion - true if the comment header for this data type
usually contains a version numberparser - the line parser for transforming lines from this data type
into objects; may not be nullhints - a varargs array of resource name hints for identifying the
resource that contains the data. may be null, but
may not contain null
java.lang.NullPointerException - if the specified parser is null
public DataType(java.lang.String userFriendlyName,
boolean hasVersion,
ILineParser<T> parser,
java.util.Collection<java.lang.String> hints)
userFriendlyName - a user-friendly name, for easy identification of this data
type; may be nullhasVersion - true if the comment header for this data type
usually contains a version numberparser - the line parser for transforming lines from this data type
into objects; may not be nullhints - a collection of resource name hints for identifying the
resource that contains the data. May be null, but
may not contain null
java.lang.NullPointerException - if the specified parser is null| Method Detail |
|---|
public boolean hasVersion()
IDataType
hasVersion in interface IDataType<T>true if the content file that underlies this content
usually has wordnet version information in its comment header;
false otherwise.public java.util.Set<java.lang.String> getResourceNameHints()
IDataType
getResourceNameHints in interface IDataType<T>public ILineParser<T> getParser()
IDataTypeIDataSource file with this type.
getParser in interface IDataType<T>IDataSource file with this type.public java.lang.String toString()
toString in class java.lang.Objectpublic static java.util.Collection<DataType<?>> values()
public static java.io.File find(IDataType<?> type,
POS pos,
java.util.Collection<? extends java.io.File> files)
type - the data type whose resource name hints should be used, may
not be nullpos - the part of speech whose resource name hints should be used,
may be nullfiles - the files to be search, may be empty but not null
null if none is found.
java.lang.NullPointerException - if the data type or file collection is null
public static boolean containsOneOf(java.lang.String target,
java.util.Set<java.lang.String> patterns)
true. If a pattern is found in the
target string, returns true. Otherwise, returns
false.
target - the string to be searchedpatterns - the patterns to search for
true if the target contains one of the patterns;
false otherwise
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||