Top Description Inners Fields Constructors Methods
org.jboss.jandex

pack-priv final Class FieldInternal

extends Object
Class Inheritance
Imports
java.util.Arrays, .Comparator, .List

The shared internal representation for FieldInfo objects.
Author
Jason T. Greene

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private AnnotationInstance[]
pack-priv static final FieldInternal[]
private final short
private final byte[]
pack-priv static final FieldInternal.NameComparator
private Type

Constructor Summary

AccessConstructor and Description
pack-priv
FieldInternal(byte[] name, Type type, short flags)

pack-priv
FieldInternal(byte[] name, Type type, short flags, AnnotationInstance[] annotations)

Method Summary

Modifier and TypeMethod and Description
pack-priv final AnnotationInstance
pack-priv final AnnotationInstance[]
pack-priv final List<AnnotationInstance>
public 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.
pack-priv final short
pack-priv final boolean
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
pack-priv boolean
pack-priv int
pack-priv final boolean
pack-priv final String
name()

pack-priv final byte[]
pack-priv void
pack-priv void
setType(Type type)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public String
pack-priv final Type
type()

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

annotationsback to summary
private AnnotationInstance[] annotations
EMPTY_ARRAYback to summary
pack-priv static final FieldInternal[] EMPTY_ARRAY
flagsback to summary
private final short flags
nameback to summary
private final byte[] name
NAME_COMPARATORback to summary
pack-priv static final FieldInternal.NameComparator NAME_COMPARATOR
typeback to summary
private Type type

Constructor Detail

FieldInternalback to summary
pack-priv FieldInternal(byte[] name, Type type, short flags)
FieldInternalback to summary
pack-priv FieldInternal(byte[] name, Type type, short flags, AnnotationInstance[] annotations)

Method Detail

annotationback to summary
pack-priv final AnnotationInstance annotation(DotName name)
annotationArrayback to summary
pack-priv final AnnotationInstance[] annotationArray()
annotationsback to summary
pack-priv final List<AnnotationInstance> annotations()
equalsback to summary
public 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
flagsback to summary
pack-priv final short flags()
hasAnnotationback to summary
pack-priv final boolean hasAnnotation(DotName name)
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
internEqualsback to summary
pack-priv boolean internEquals(Object o)
internHashCodeback to summary
pack-priv int internHashCode()
isEnumConstantback to summary
pack-priv final boolean isEnumConstant()
nameback to summary
pack-priv final String name()
nameBytesback to summary
pack-priv final byte[] nameBytes()
setAnnotationsback to summary
pack-priv void setAnnotations(List<AnnotationInstance> annotations)
setTypeback to summary
pack-priv void setType(Type type)
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
toStringback to summary
public String toString(ClassInfo clazz)
typeback to summary
pack-priv final Type type()
org.jboss.jandex back to summary

pack-priv Class FieldInternal.NameComparator

extends Object
implements Comparator<FieldInternal>
Class Inheritance
All Implemented Interfaces
java.util.Comparator

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private int
compare(byte[]
the first object to be compared.
left
,
byte[]
the second object to be compared.
right
)

Implements java.util.Comparator.compare.

Compares its two arguments for order.
public int
compare(FieldInternal
the first object to be compared.
instance
,
FieldInternal
the second object to be compared.
instance2
)

Implements java.util.Comparator.compare.

Compares its two arguments for order.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NameComparatorback to summary
pack-priv NameComparator()

Method Detail

compareback to summary
private int compare(byte[] left, byte[] right)

Implements java.util.Comparator.compare.

Doc from java.util.Comparator.compare.

Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

The implementor must ensure that signum(compare(x, y)) == -signum(compare(y, x)) for all x and y. (This implies that compare(x, y) must throw an exception if and only if compare(y, x) throws an exception.)

The implementor must also ensure that the relation is transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0.

Finally, the implementor must ensure that compare(x, y)==0 implies that signum(compare(x, z))==signum(compare(y, z)) for all z.

Parameters
left:byte[]

the first object to be compared.

right:byte[]

the second object to be compared.

Returns:int

a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

compareback to summary
public int compare(FieldInternal instance, FieldInternal instance2)

Implements java.util.Comparator.compare.

Doc from java.util.Comparator.compare.

Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

The implementor must ensure that signum(compare(x, y)) == -signum(compare(y, x)) for all x and y. (This implies that compare(x, y) must throw an exception if and only if compare(y, x) throws an exception.)

The implementor must also ensure that the relation is transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0.

Finally, the implementor must ensure that compare(x, y)==0 implies that signum(compare(x, z))==signum(compare(y, z)) for all z.

Parameters
instance:FieldInternal

the first object to be compared.

instance2:FieldInternal

the second object to be compared.

Returns:int

a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.