Top Description Fields Constructors Methods
com.fasterxml.aalto.out

public abstract Class WName

extends Object
Class Inheritance
Known Direct Subclasses
com.fasterxml.aalto.out.ByteWName, com.fasterxml.aalto.out.CharWName
Imports
java.io.IOException, .OutputStream, .Writer

This class is similar to com.fasterxml.aalto.in.PName, in that it implements an efficient representation of prefixed names, but one used on output (Writer) side.

Note

unlike with Reader-side prefixed names, here we can not assume that components are intern()ed.

Field Summary

Modifier and TypeField and Description
protected final String
protected final String

Constructor Summary

AccessConstructor and Description
protected
protected
WName(String prefix, String ln)

Method Summary

Modifier and TypeMethod and Description
public abstract int
appendBytes(byte[] buffer, int offset)

public abstract int
appendChars(char[] buffer, int offset)

public final boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public final String
public final String
public final String
public int
hashCode()

Overrides java.lang.Object.hashCode.

Whether we should use internal hash, or the hash of prefixed name string itself is an open question.
public final boolean
hasName(String localName)

public final boolean
hasName(String prefix, String localName)

public final boolean
public abstract int

Returns:

Length of full (qualified) name, in native serialization units (bytes or characters)
serializedLength
()

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public abstract void
public abstract void
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

_localNameback to summary
protected final String _localName
_prefixback to summary
protected final String _prefix

Constructor Detail

WNameback to summary
protected WName(String ln)
WNameback to summary
protected WName(String prefix, String ln)

Method Detail

appendBytesback to summary
public abstract int appendBytes(byte[] buffer, int offset)
appendCharsback to summary
public abstract int appendChars(char[] buffer, int offset)
equalsback to summary
public final boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getLocalNameback to summary
public final String getLocalName()
getPrefixback to summary
public final String getPrefix()
getPrefixedNameback to summary
public final String getPrefixedName()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Whether we should use internal hash, or the hash of prefixed name string itself is an open question. For now, let's use former.

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

Annotations
@Override
hasNameback to summary
public final boolean hasName(String localName)
hasNameback to summary
public final boolean hasName(String prefix, String localName)
hasPrefixback to summary
public final boolean hasPrefix()
serializedLengthback to summary
public abstract int serializedLength()
Returns:int

Length of full (qualified) name, in native serialization units (bytes or characters)

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
writeBytesback to summary
public abstract void writeBytes(OutputStream out) throws IOException
writeCharsback to summary
public abstract void writeChars(Writer w) throws IOException