com.ihr.xbrl.xbrlq
Class QueryParser
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<java.lang.String>
com.ihr.xbrl.xbrlq.QueryParser
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<java.lang.String>, java.util.Collection<java.lang.String>, java.util.List<java.lang.String>, java.util.RandomAccess
public class QueryParser
- extends java.util.ArrayList<java.lang.String>
- Author:
- Ignacio
- See Also:
- Serialized Form
|
Constructor Summary |
QueryParser(java.lang.String query)
|
|
Method Summary |
QueryParser.Position |
getPosition()
|
boolean |
hasNext()
|
java.lang.String |
peek()
|
java.lang.String |
remainingString()
Used to obtain the unparsed query string. |
java.lang.String |
searchToken(java.lang.String[] tokenList)
Search the remaining tokens in the query for any of the tokens
in the array received as a parameter. |
java.lang.String[] |
searchTwoTokens(java.lang.String[] firstToken,
java.lang.String[] nextToken)
Search for any of the tokens in the list of firstTokens. |
void |
setPosition(QueryParser.Position newPosition)
|
java.lang.String |
textBeforeTwoTokens(java.lang.String[] operators,
java.lang.String[] tokens)
returns the text from the current position to the position of the next two tokens. |
| Methods inherited from class java.util.ArrayList |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, set, size, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
equals, hashCode, iterator, listIterator, listIterator, subList |
| Methods inherited from class java.util.AbstractCollection |
containsAll, removeAll, retainAll, toString |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
QueryParser
public QueryParser(java.lang.String query)
peek
public java.lang.String peek()
hasNext
public boolean hasNext()
getPosition
public QueryParser.Position getPosition()
setPosition
public void setPosition(QueryParser.Position newPosition)
searchToken
public java.lang.String searchToken(java.lang.String[] tokenList)
- Search the remaining tokens in the query for any of the tokens
in the array received as a parameter. If the token is found then the
queue is advanced to the position of the token found.
- Parameters:
tokenList -
- Returns:
searchTwoTokens
public java.lang.String[] searchTwoTokens(java.lang.String[] firstToken,
java.lang.String[] nextToken)
- Search for any of the tokens in the list of firstTokens. If one is found
then the next token in the tokens list is compared against the list of
nextTokens. if one is found then the queue is advanced to the end of the
second token and the two consecutive tokens are returned. If it is not found
then the queue is not advanced.
- Parameters:
firstToken - nextToken -
- Returns:
remainingString
public java.lang.String remainingString()
- Used to obtain the unparsed query string. Useful for generating error messages
- Returns:
textBeforeTwoTokens
public java.lang.String textBeforeTwoTokens(java.lang.String[] operators,
java.lang.String[] tokens)
- returns the text from the current position to the position of the next two tokens.
- Parameters:
operators - tokens -
- Returns:
Copyright 2006-2009 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa