public class IndexingScheme extends Object
Constructor and Description |
---|
IndexingScheme(HashMap<String,Integer> indexMapping)
Constructs an IndexingScheme from a mapping of strings to indices.
|
IndexingScheme(IndexingScheme other)
This performs a shallow copy of the given other IndexingScheme,
meaning that only references are copied and manipulations of the
given other IndexingScheme will influence the copy as well.
|
IndexingScheme(String symbols)
Constructor for symbols either encoded as single characters without
delimiter or as strings with | as delimiter.
|
IndexingScheme(String[] keywords)
Constructs an IndexingScheme from a mapping of indices to strings.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getKeyword(int index)
Returns the keyword for the given index.
|
int |
getKeywordIndex(String keyword)
Returns the index of the given keyword.
|
String[] |
getKeywords()
Returns the keywords that are mapped.
|
int |
hashCode() |
boolean |
hasKeyword(String keyword)
Returns true if and only if this keyword is contained in the mapping.
|
int |
size()
Returns the number of mapped keywords.
|
public IndexingScheme(IndexingScheme other)
other
- another IndexingScheme.public IndexingScheme(HashMap<String,Integer> indexMapping)
indexMapping
- some mapping of Strings to Integers.public IndexingScheme(String[] keywords)
keywords
- a mapping of indices to stringspublic IndexingScheme(String symbols)
symbols
- a string specifying the symbols this IndexingScheme should
be initialized with.public boolean hasKeyword(String keyword)
keyword
- a keywordpublic int size()
public String[] getKeywords()
public int getKeywordIndex(String keyword) throws UnsupportedOperationException
keyword
- a keyword.UnsupportedOperationException
- is thrown if the given keyword is
not contained in this mapping.public String getKeyword(int index) throws ArrayIndexOutOfBoundsException
index
- a index.ArrayIndexOutOfBoundsException
- is thrown if the given index is
not used in this mapping.Copyright (C) 2013-2015 Benjamin Paaßen, Georg Zentgraf, AG Theoretical Computer Science, Centre of Excellence Cognitive Interaction Technology (CITEC), University of Bielefeld, licensed under the AGPL v. 3: http://openresearch.cit-ec.de/projects/tcs