Package xj3d.filter.filters
Class NodeCountInfoFilter
java.lang.Object
xj3d.filter.AbstractFilter
xj3d.filter.NewAbstractFilter
xj3d.filter.filters.NodeCountInfoFilter
- All Implemented Interfaces:
Comparator<Map.Entry<String,
,Integer>> BinaryContentHandler
,ContentHandler
,ProtoHandler
,RouteHandler
,ScriptHandler
,StringContentHandler
public class NodeCountInfoFilter
extends NewAbstractFilter
implements Comparator<Map.Entry<String,Integer>>
Counts the number of nodes in a file. Will output its list in
descending sorted order.
USE of a node will increase its count
- Version:
- $Revision: 1.7 $
- Author:
- Alan Hudson
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe node counts, Node Name -> CountMapping between DEF and nodeNameFields inherited from class xj3d.filter.NewAbstractFilter
fieldHasEndedImplicitly, parentTypeStack, suppressCalls
Fields inherited from class xj3d.filter.AbstractFilter
contentHandler, documentLocator, errorHandler, fieldHandler, fieldReader, fieldStack, lastErrorCode, majorVersion, minorVersion, nodeStack, parsingType, protoHandler, routeHandler, scriptHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
void
Declaration of the end of the document.parseOutput
(String txt) Parse the output from this filter to get a map.void
Notification of the start of a node.void
The field value is a USE for the given node name.Methods inherited from class xj3d.filter.NewAbstractFilter
componentDecl, endExternProtoDecl, endField, endNode, endProtoBody, endProtoDecl, endScriptDecl, exportDecl, externProtoURI, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, getContentHandler, getErrorReporter, getLastErrorCode, getProtoHandler, getRouteHandler, getScriptHandler, importDecl, metaDecl, profileDecl, protoFieldDecl, protoIsDecl, routeDecl, scriptFieldDecl, setArguments, setContentHandler, setDebug, setDocumentLocator, setErrorReporter, setProtoHandler, setRouteHandler, setScriptHandler, startDocument, startExternProtoDecl, startField, startProtoBody, startProtoDecl, startScriptDecl, suppressCalls
Methods inherited from class xj3d.filter.AbstractFilter
setParsingType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
counts
-
defMap
-
-
Constructor Details
-
NodeCountInfoFilter
public NodeCountInfoFilter()Construct a default instance of the filter.
-
-
Method Details
-
parseOutput
-
endDocument
Declaration of the end of the document. There will be no further parsing and hence events after this.- Specified by:
endDocument
in interfaceContentHandler
- Overrides:
endDocument
in classNewAbstractFilter
- Throws:
SAVException
- This call is taken at the wrong time in the structure of the document.VRMLException
- This call is taken at the wrong time in the structure of the document.
-
startNode
Notification of the start of a node. This is the opening statement of a node and it's DEF name. USE declarations are handled in a separate method.- Specified by:
startNode
in interfaceContentHandler
- Overrides:
startNode
in classNewAbstractFilter
- Parameters:
name
- The name of the node that we are about to parsedefName
- The string associated with the DEF name. Null if not given for this node.- Throws:
SAVException
- This call is taken at the wrong time in the structure of the document.VRMLException
- This call is taken at the wrong time in the structure of the document.
-
useDecl
The field value is a USE for the given node name. This is a terminating call for startField as well. The next call will either be anotherstartField()
orendNode()
.- Specified by:
useDecl
in interfaceContentHandler
- Overrides:
useDecl
in classNewAbstractFilter
- Parameters:
defName
- The name of the DEF string to use- Throws:
SAVException
- This call is taken at the wrong time in the structure of the document.VRMLException
- This call is taken at the wrong time in the structure of the document.
-
compare
-