Package xj3d.filter.node
Class BaseEncodable
java.lang.Object
xj3d.filter.node.BaseEncodable
- All Implemented Interfaces:
Encodable
- Direct Known Subclasses:
Appearance
,BaseGeometry
,BaseGroup
,BaseMetadata
,BaseTexture2D
,Color
,ColorRGBA
,Coordinate
,FillProperties
,LineProperties
,Material
,MultiTexture
,MultiTextureCoordinate
,MultiTextureTransform
,Normal
,Scene
,Shape
,TextureCoordinate
,TextureProperties
,TextureTransform
,Viewpoint
Common impl for encoding node representations in this package.
- Version:
- $Revision: 1.2 $
- Author:
- Rex Melton
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BinaryContentHandler
Binary Content Handler referenceThe node's DEF nameprotected VRMLFieldReader
The field parserprotected ContentHandler
Content Handler referencestatic final int
Content Handler Typesstatic final int
static final int
protected int
Flag indicating that the content handler is an instance of a BinaryContentHandler, a StringContentHandler, or nullfinal String
The name of this nodeprotected StringContentHandler
String Content Handler referenceThe node's USE name -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BaseEncodable
(String nodeName) Constructorprotected
BaseEncodable
(String nodeName, String defName) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear the node fields to their initial valuesclone
(boolean full) Create and return a copy of this object.protected void
copy
(BaseEncodable enc, boolean deep) Copy the working objects of this into the argument.boolean
deepEquals
(Encodable enc) Compares this appearance to another and checks if all fields are the same and that all children fields are the same.void
encode()
Push the node contents to the ContentHandlerReturn the DEF name of the nodeGet the Metadata node wrapperReturn the name of the nodeReturn the USE name of the nodevoid
setContentHandler
(ContentHandler handler) Set the content handler.void
setDefName
(String defName) Set the DEF name of the nodevoid
setFieldReader
(VRMLFieldReader fieldReader) Set the reader to use for parsing field values.void
setMetadata
(Encodable metadata) Set the Metadata node wrappervoid
setUseName
(String useName) Set the USE name of the nodevoid
Set the value of the named field.void
Set the value of the named field.
-
Field Details
-
HANDLER_BINARY
public static final int HANDLER_BINARYContent Handler Types- See Also:
-
HANDLER_STRING
public static final int HANDLER_STRING- See Also:
-
HANDLER_NULL
public static final int HANDLER_NULL- See Also:
-
nodeName
The name of this node -
defName
The node's DEF name -
useName
The node's USE name -
fieldReader
The field parser -
handlerType
protected int handlerTypeFlag indicating that the content handler is an instance of a BinaryContentHandler, a StringContentHandler, or null -
handler
Content Handler reference -
bch
Binary Content Handler reference -
sch
String Content Handler reference
-
-
Constructor Details
-
BaseEncodable
-
BaseEncodable
-
-
Method Details
-
getNodeName
Return the name of the node- Specified by:
getNodeName
in interfaceEncodable
- Returns:
- the name of the node
-
getDefName
Return the DEF name of the node- Specified by:
getDefName
in interfaceEncodable
- Returns:
- the DEF name of the node
-
setDefName
Set the DEF name of the node- Specified by:
setDefName
in interfaceEncodable
- Parameters:
defName
- the DEF name of the node
-
getUseName
Return the USE name of the node- Specified by:
getUseName
in interfaceEncodable
- Returns:
- the USE name of the node
-
setUseName
Set the USE name of the node- Specified by:
setUseName
in interfaceEncodable
- Parameters:
useName
- the USE name of the node
-
clear
-
encode
-
setValue
-
setValue
-
setFieldReader
Set the reader to use for parsing field values.- Specified by:
setFieldReader
in interfaceEncodable
- Parameters:
fieldReader
- The reader
-
setContentHandler
Set the content handler.- Specified by:
setContentHandler
in interfaceEncodable
- Parameters:
handler
- The ContentHandler instance to use
-
clone
Create and return a copy of this object. Must be overridden, by default returns null. -
setMetadata
Set the Metadata node wrapper- Parameters:
metadata
- The Metadata node wrapper
-
getMetadata
-
copy
Copy the working objects of this into the argument. Used by subclasses to initialize a clone. The defName and useName are never copied. The deep flag has no effect on this level, the base objects are always copied.- Parameters:
enc
- The encodable to initialize.deep
- true to initialize this nodes fields, false otherwise.
-
deepEquals
Compares this appearance to another and checks if all fields are the same and that all children fields are the same.- Specified by:
deepEquals
in interfaceEncodable
- Returns:
-