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 BinaryContentHandlerBinary Content Handler referenceThe node's DEF nameprotected VRMLFieldReaderThe field parserprotected ContentHandlerContent Handler referencestatic final intContent Handler Typesstatic final intstatic final intprotected intFlag indicating that the content handler is an instance of a BinaryContentHandler, a StringContentHandler, or nullfinal StringThe name of this nodeprotected StringContentHandlerString Content Handler referenceThe node's USE name -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseEncodable(String nodeName) ConstructorprotectedBaseEncodable(String nodeName, String defName) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the node fields to their initial valuesclone(boolean full) Create and return a copy of this object.protected voidcopy(BaseEncodable enc, boolean deep) Copy the working objects of this into the argument.booleandeepEquals(Encodable enc) Compares this appearance to another and checks if all fields are the same and that all children fields are the same.voidencode()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 nodevoidsetContentHandler(ContentHandler handler) Set the content handler.voidsetDefName(String defName) Set the DEF name of the nodevoidsetFieldReader(VRMLFieldReader fieldReader) Set the reader to use for parsing field values.voidsetMetadata(Encodable metadata) Set the Metadata node wrappervoidsetUseName(String useName) Set the USE name of the nodevoidSet the value of the named field.voidSet 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:
getNodeNamein interfaceEncodable- Returns:
- the name of the node
-
getDefName
Return the DEF name of the node- Specified by:
getDefNamein interfaceEncodable- Returns:
- the DEF name of the node
-
setDefName
Set the DEF name of the node- Specified by:
setDefNamein interfaceEncodable- Parameters:
defName- the DEF name of the node
-
getUseName
Return the USE name of the node- Specified by:
getUseNamein interfaceEncodable- Returns:
- the USE name of the node
-
setUseName
Set the USE name of the node- Specified by:
setUseNamein 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:
setFieldReaderin interfaceEncodable- Parameters:
fieldReader- The reader
-
setContentHandler
Set the content handler.- Specified by:
setContentHandlerin 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:
deepEqualsin interfaceEncodable- Returns:
-