APIdia Launch Partner
Top Fields Constructors Methods
javax.swing

pack-priv Class ArrayTable

extends Object
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Imports
java.io.IOException, .ObjectOutputStream, .Serializable, java.util.Enumeration, .Hashtable

Field Summary

Modifier and TypeField and Description
private static final int
private Object

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Removes all the mappings.

public Object
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

public boolean
public Object
get(Object key)

public Object[]

Returns:

an array of bindings
getKeys
(Object[]
array of keys
keys
)

Returns the keys of the table, or null if there are currently no bindings.

private void
grow()

private boolean
public void
put(Object key, Object value)

public Object
private void
public int
size()

pack-priv static void
writeArrayTable(ObjectOutputStream s, ArrayTable table)

Writes the passed in ArrayTable to the passed in ObjectOutputStream.

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ARRAY_BOUNDARYback to summary
private static final int ARRAY_BOUNDARY
tableback to summary
private Object table

Constructor Detail

ArrayTableback to summary
pack-priv ArrayTable()

Method Detail

clearback to summary
public void clear()

Removes all the mappings.

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

containsKeyback to summary
public boolean containsKey(Object key)
getback to summary
public Object get(Object key)
getKeysback to summary
public Object[] getKeys(Object[] keys)

Returns the keys of the table, or null if there are currently no bindings.

Parameters
keys:Object[]

array of keys

Returns:Object[]

an array of bindings

growback to summary
private void grow()
isArrayback to summary
private boolean isArray()
putback to summary
public void put(Object key, Object value)
removeback to summary
public Object remove(Object key)
shrinkback to summary
private void shrink()
sizeback to summary
public int size()
writeArrayTableback to summary
pack-priv static void writeArrayTable(ObjectOutputStream s, ArrayTable table) throws IOException

Writes the passed in ArrayTable to the passed in ObjectOutputStream. The data is saved as an integer indicating how many key/value pairs are being archived, followed by the key/value pairs. If table is null, 0 will be written to s.

This is a convenience method that ActionMap/InputMap and AbstractAction use to avoid having the same code in each class.