ref_send API 2.17
defensive programming in Java

org.ref_send.scope
Class Layout<T>

java.lang.Object
  extended by org.ref_send.scope.Layout<T>
Type Parameters:
T - nominal type
All Implemented Interfaces:
java.io.Serializable, Immutable, Powerless, Selfless, Record

public final class Layout<T>
extends java.lang.Object
implements Powerless, Record, Selfless, java.io.Serializable

Structural type of a Scope.

See Also:
Serialized Form

Field Summary
 PowerlessArray<java.lang.String> names
          each member name
 
Constructor Summary
Layout(PowerlessArray<java.lang.String> names)
          Constructs an instance.
 
Method Summary
static
<T> Layout<T>
define(java.lang.String... names)
          Defines a new structural type.
 boolean equals(java.lang.Object o)
          Is the given object the same?
 int find(java.lang.String name)
          Finds the index of the named member.
 int hashCode()
          Calculates the hash code.
 Scope<T> make(java.lang.Object... values)
          Constructs a scope.
 boolean of(Scope<T> scope)
          Does a given scope conform to this structural type?
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

names

public final PowerlessArray<java.lang.String> names
each member name

A member name MUST NOT be either null or "@", and MUST be unique within the list of member names.

Constructor Detail

Layout

public Layout(PowerlessArray<java.lang.String> names)
Constructs an instance.

Parameters:
names - names
Method Detail

define

public static <T> Layout<T> define(java.lang.String... names)
Defines a new structural type.

Type Parameters:
T - nominal type
Parameters:
names - names

equals

public boolean equals(java.lang.Object o)
Is the given object the same?

Overrides:
equals in class java.lang.Object
Parameters:
o - compared to object
Returns:
true if the same, else false

hashCode

public int hashCode()
Calculates the hash code.

Specified by:
hashCode in interface Selfless
Overrides:
hashCode in class java.lang.Object

make

public Scope<T> make(java.lang.Object... values)
Constructs a scope.

Parameters:
values - Scope.values

of

public boolean of(Scope<T> scope)
Does a given scope conform to this structural type?

Parameters:
scope - instance to check

find

public int find(java.lang.String name)
Finds the index of the named member.

Parameters:
name - searched for member name
Returns:
found index, or -1 if not found

ref_send API 2.17
defensive programming in Java

Submit a bug or feature, or get help

Copyright 1998-2009 Waterken Inc. under the terms of the MIT X license.