public abstract class BaseExpression extends Object implements Expression, Configurable
Find command. Provides default
behavior for a no-argument primary expression.| Constructor and Description |
|---|
BaseExpression() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addArgument(String arg)
Add a single argument to this expression.
|
void |
addArguments(Deque<String> args)
Adds arguments to this expression.
|
protected void |
addArguments(Deque<String> args,
int count)
Add a specific number of arguments to this expression.
|
void |
addChildren(Deque<Expression> exprs)
Adds children to this expression.
|
protected void |
addChildren(Deque<Expression> exprs,
int count)
Add a specific number of children to this expression.
|
void |
finish()
Finishes the expression, called once after processing all items.
|
protected String |
getArgument(int position)
Returns the argument at the given position (starting from 1).
|
protected List<String> |
getArguments()
Returns the arguments of this expression
|
protected List<Expression> |
getChildren()
Returns the children of this expression.
|
Configuration |
getConf()
Return the configuration used by this object.
|
protected FileStatus |
getFileStatus(org.apache.hadoop.fs.shell.PathData item,
int depth)
Returns the
FileStatus from the PathData item. |
protected FileSystem |
getFileSystem(org.apache.hadoop.fs.shell.PathData item)
Returns the
FileSystem associated with the PathData item. |
String[] |
getHelp()
Returns a description of the expression for use in help.
|
protected FindOptions |
getOptions()
Return the options to be used by this expression.
|
protected Path |
getPath(org.apache.hadoop.fs.shell.PathData item)
Returns the
Path from the PathData item. |
int |
getPrecedence()
Returns the precedence of this expression
(only applicable to operators).
|
String[] |
getUsage()
Returns brief usage instructions for this expression.
|
boolean |
isAction()
Indicates whether this expression performs an action, i.e.
|
boolean |
isOperator()
Identifies the expression as an operator rather than a primary.
|
void |
prepare()
Prepares the expression for execution, called once after setting options
and before processing any options.
|
void |
setConf(Configuration conf)
Set the configuration to be used by this object.
|
protected void |
setHelp(String[] help)
Sets the help text for this
Expression |
void |
setOptions(FindOptions options)
Set the options for this expression, called once before processing any
items.
|
protected void |
setUsage(String[] usage)
Sets the usage text for this
Expression |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyprotected void setUsage(String[] usage)
Expressionprotected void setHelp(String[] help)
Expressionpublic String[] getUsage()
ExpressiongetUsage in interface Expressionpublic String[] getHelp()
ExpressiongetHelp in interface Expressionpublic void setOptions(FindOptions options) throws IOException
ExpressionsetOptions in interface ExpressionIOExceptionpublic void prepare()
throws IOException
Expressionprepare in interface ExpressionIOExceptionpublic void finish()
throws IOException
Expressionfinish in interface ExpressionIOExceptionprotected FindOptions getOptions()
public void setConf(Configuration conf)
ConfigurablesetConf in interface Configurablepublic Configuration getConf()
ConfigurablegetConf in interface Configurablepublic boolean isAction()
ExpressionisAction in interface Expressionpublic boolean isOperator()
ExpressionisOperator in interface Expressionprotected List<String> getArguments()
protected String getArgument(int position) throws IOException
position - argument to be returnedIOException - if the argument doesn't exist or is nullprotected List<Expression> getChildren()
public int getPrecedence()
ExpressiongetPrecedence in interface Expressionpublic void addChildren(Deque<Expression> exprs)
ExpressionaddChildren in interface Expressionexprs - deque of expressions from which to take the childrenprotected void addChildren(Deque<Expression> exprs, int count)
exprs - deque of expressions from which to take the childrencount - number of children to be addedpublic void addArguments(Deque<String> args)
ExpressionaddArguments in interface Expressionargs - deque of arguments from which to take expression argumentsprotected void addArguments(Deque<String> args, int count)
args - deque of arguments from which to take the argumentcount - number of children to be addedprotected void addArgument(String arg)
arg - argument to add to the expressionprotected FileStatus getFileStatus(org.apache.hadoop.fs.shell.PathData item, int depth) throws IOException
FileStatus from the PathData item. If the
current options require links to be followed then the returned file status
is that of the linked file.item - PathDatadepth - current depth in the process directoriesIOExceptionprotected Path getPath(org.apache.hadoop.fs.shell.PathData item) throws IOException
Path from the PathData item.item - PathDataIOExceptionprotected FileSystem getFileSystem(org.apache.hadoop.fs.shell.PathData item) throws IOException
FileSystem associated with the PathData item.item - PathDataIOExceptionCopyright © 2008–2022 Apache Software Foundation. All rights reserved.