com.netflix.nfgraph.spec
Class NFPropertySpec

java.lang.Object
  extended by com.netflix.nfgraph.spec.NFPropertySpec

public class NFPropertySpec
extends java.lang.Object

This class defines a specification for a single property.

The recommended interface for creating a property is to instantiate with the flag method below.

By default, an NFPropertySpec is GLOBAL, MULTIPLE, and COMPACT.

 import static com.netflix.nfgraph.spec.NFPropertySpec.*;
 
 ...
 
 NFPropertySpec spec1 = new NFPropertySpec( "property1", "foreignNodeType1", MULTIPLE | HASH );
 NFPropertySpec spec2 = new NFPropertySpec( "property2", "foreignNodeType2", MULTIPLE | COMPACT | MODEL_SPECIFIC);
 NFPropertySpec spec3 = new NFPropertySpec( "property2", "foreignNodeType3", SINGLE );
 
 


Field Summary
static int COMPACT
          A MULTIPLE property instantiated with this flag will be represented as a CompactOrdinalSet in an NFCompressedGraph.
static int GLOBAL
          A property spec instantiated with this flag will not be separable into connection models.
static int HASH
          A MULTIPLE property instantiated with this flag will be represented as a BitSetOrdinalSet in an NFCompressedGraph.
static int MODEL_SPECIFIC
          A property spec instantiated with this flag will be separable into connection models.
static int MULTIPLE
          A property spec instantiated with this flag will be allowed multiple connections.
static int SINGLE
          A property spec instantiated with this flag will be allowed only a single connection.
 
Constructor Summary
NFPropertySpec(java.lang.String name, java.lang.String toNodeType, boolean isGlobal, boolean isMultiple, boolean isHashed)
           
NFPropertySpec(java.lang.String name, java.lang.String toNodeType, int flags)
          The recommended constructor.
 
Method Summary
 java.lang.String getName()
           
 int getPropertyIndex()
          Used by the NFBuildGraph.
 java.lang.String getToNodeType()
           
 boolean isCompact()
           
 boolean isConnectionModelSpecific()
           
 boolean isGlobal()
           
 boolean isHashed()
           
 boolean isMultiple()
           
 boolean isSingle()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GLOBAL

public static final int GLOBAL
A property spec instantiated with this flag will not be separable into connection models.

See Also:
Constant Field Values

MODEL_SPECIFIC

public static final int MODEL_SPECIFIC
A property spec instantiated with this flag will be separable into connection models.

See Also:
Constant Field Values

MULTIPLE

public static final int MULTIPLE
A property spec instantiated with this flag will be allowed multiple connections.

See Also:
Constant Field Values

SINGLE

public static final int SINGLE
A property spec instantiated with this flag will be allowed only a single connection.

See Also:
Constant Field Values

HASH

public static final int HASH
A MULTIPLE property instantiated with this flag will be represented as a BitSetOrdinalSet in an NFCompressedGraph.

See Also:
BitSetOrdinalSet, Constant Field Values

COMPACT

public static final int COMPACT
A MULTIPLE property instantiated with this flag will be represented as a CompactOrdinalSet in an NFCompressedGraph.

See Also:
CompactOrdinalSet, Constant Field Values
Constructor Detail

NFPropertySpec

public NFPropertySpec(java.lang.String name,
                      java.lang.String toNodeType,
                      int flags)
The recommended constructor.

Parameters:
name - the name of the property.
toNodeType - the node type to which this property connects
flags - a bitwise-or of the various flags defined as constants in NFPropertySpec.
For example, a global, multiple, compact property would take the value NFPropertySpec.GLOBAL | NFPropertySpec.MULTIPLE | NFPropertySpec.COMPACT

NFPropertySpec

public NFPropertySpec(java.lang.String name,
                      java.lang.String toNodeType,
                      boolean isGlobal,
                      boolean isMultiple,
                      boolean isHashed)
Method Detail

isConnectionModelSpecific

public boolean isConnectionModelSpecific()

isGlobal

public boolean isGlobal()

isMultiple

public boolean isMultiple()

isSingle

public boolean isSingle()

isHashed

public boolean isHashed()

isCompact

public boolean isCompact()

getName

public java.lang.String getName()

getToNodeType

public java.lang.String getToNodeType()

getPropertyIndex

public int getPropertyIndex()
Used by the NFBuildGraph. It is unlikely that this method will be required externally.