public interface

ITypeIdProvider

com.pnfsoftware.jeb.util.serialization.ITypeIdProvider
Known Indirect Subclasses

Class Overview

Definition of a type-id provider, mapping a type to a unique id, and vice-versa.

Summary

Public Methods
abstract void addAll(ITypeIdProvider provider)
Add of types from a provider to this provider.
abstract int getId(Class<?> c)
Get the ype-id of a given type.
abstract Map<Class<?>, Integer> getMap()
Get the map of type to type-id.
abstract Map<Integer, Class<?>> getReverseMap()
Get the reverse type-id map, mapping a type-id to a type.
abstract Class<?> getType(int id)
Get a type by type-id.

Public Methods

public abstract void addAll (ITypeIdProvider provider)

Add of types from a provider to this provider.

Parameters
provider another provider

public abstract int getId (Class<?> c)

Get the ype-id of a given type.

Parameters
c the non-null type
Returns
  • 0 if the provider cannot find a corresponding type-id for the provided type

public abstract Map<Class<?>, Integer> getMap ()

Get the map of type to type-id.

Returns
  • the type-id map

public abstract Map<Integer, Class<?>> getReverseMap ()

Get the reverse type-id map, mapping a type-id to a type.

Returns
  • the reverse type-id map

public abstract Class<?> getType (int id)

Get a type by type-id.

Parameters
id the non-zero type-id
Returns
  • the type, null if not found