MetaDone
metadone.util.Objects Class Reference

List of all members.

Static Public Member Functions

static boolean equal (Object a, Object b)
static int hashCode (Object...objs)
static int hashCodeIter (Iterator<?> objs)
static final< T > T cast (Class< T > cla, Object value)
static final< T > T cast (Class< T > cla, Object value, T def)
static< T > T castUnsafe (Class<?> cla, Object value, T def)

Private Member Functions

 Objects ()

Detailed Description

Collection of methods often used with any object.

It includes functions to:

  • cast classes
  • compute the hashcode for several objects

Partially copied from another project.

Author:
Krzysztof Magusiak

Constructor & Destructor Documentation

metadone.util.Objects.Objects ( ) [private]

Member Function Documentation

static final<T> T metadone.util.Objects.cast ( Class< T >  cla,
Object  value 
) [static]

Casts a value to the given type and returns null instead of throwing an exception.

Parameters:
<T>The expected type
claThe class
valueThe value to cast
Returns:
A value of the expected type or null
Exceptions:
NullPointerExceptionwhen cla is null

References metadone.util.Objects.castUnsafe().

Referenced by metadone.client.grasyla2.value.UpdaterEngine.abortEvaluate(), metadone.client.grasyla2.swing.JMenuValueAdaptor.adapt(), metadone.client.grasyla2.swing.JAdaptValue.adapt(), metadone.client.grasyla2.swing.JAdaptString.adapt(), metadone.publish_subscribe.EventTowerEq< M >.NodeEq.add(), metadone.client.grasyla2.BaseGrasylaFactoryConfig.addComponentValueUnBuilder(), metadone.metabusiness.impl.MetaObject_impl.addSuperType(), metadone.client.grasyla2.visuallibrary.GrasylaScene.MyGraphVizLayout.clearControlPoints(), metadone.metabusiness.impl.MetaObject_impl.compareTo(), metadone.metabusiness.impl.ConcreteObject_impl.compareTo(), metadone.util.Pair< A, B >.equals(), metadone.util.MapFcts.Compose< A, C >.equals(), metadone.util.MapFcts.Equal.equals(), metadone.util.ImmutableList< E >.equals(), metadone.metabusiness.syntax.grasyla.GrasylaPhenomenon.equals(), metadone.metabusiness.syntax.grasyla.GrasylaEquationHeader.equals(), metadone.metabusiness.syntax.grasyla.GrasylaEquation.equals(), metadone.metabusiness.syntax.AbstractView.equals(), metadone.metabusiness.script.ScriptEvaluator.ScriptResult.Abstract.equals(), metadone.metabusiness.impl.MetaObject_impl.equals(), metadone.metabusiness.impl.ConcreteObject_impl.equals(), metadone.metabusiness.impl.ConcreteDef_impl.equals(), metadone.metabusiness.annex.User.equals(), metadone.client.grasyla2.visuallibrary.widgets.RotateWidget.RotateDependency.equals(), metadone.client.grasyla2.visuallibrary.AnchorKey.equals(), metadone.client.grasyla2.visuallibrary.AnchorDefinition.equals(), metadone.client.grasyla2.value.Value.equals(), metadone.client.grasyla2.swing.TableRow.equals(), metadone.client.grasyla2.SelectorBestEquation.PartialHeader.equals(), metadone.client.grasyla2.ref.SidedMetaObject.equals(), metadone.client.grasyla2.GrasylaEngineFactory.CacheKey.equals(), metadone.client.grasyla2.GrasylaEngine.HasType.equals(), metadone.client.grasyla2.base.GrasylaComponent< C >.equals(), metadone.client.display.ConcreteObjectGroup.equals(), metadone.client.dialog.swing.genConcreteObject.Wmetaproperty.equals(), metadone.client.grasyla2.swing.JTreeEngine.evaluateComponent(), metadone.client.grasyla2.swing.TreeNode.eventWillCollapse(), metadone.client.grasyla2.swing.TreeNode.eventWillExpand(), metadone.client.grasyla2.actions.GAction.execute(), metadone.client.grasyla2.actions.GAction.getContext(), metadone.client.grasyla2.visuallibrary.GrasylaScene.MyGraphVizLayout.getEdges(), metadone.client.grasyla2.swing.TreeNode.getModel(), metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.getParentStrategy(), metadone.client.grasyla2.value.Value.getValueAsException(), metadone.client.grasyla2.GrasylaEngine.isAdapted(), metadone.metabusiness.impl.ConcreteModel_impl.isOrdered(), metadone.client.grasyla2.visuallibrary.GraphEngine.makeContextMenu(), metadone.client.grasyla2.visuallibrary.GrasylaScene.MyControlAddRemoveAction.mouseClicked(), metadone.client.grasyla2.GrasylaFactoryConfig.newBuilder(), metadone.client.grasyla2.visuallibrary.VLRotateEngine.notifyChildChanged(), metadone.client.grasyla2.visuallibrary.VLEdgeEngine.notifyChildChanged(), metadone.client.grasyla2.visuallibrary.VLBoxEngine.notifyChildChanged(), metadone.client.grasyla2.swing.JBoxEngine.notifyChildChanged(), metadone.publish_subscribe.EventTowerEq< M >.NodeEq.remove(), metadone_bundle_repository.RepositoryTracker.removedService(), metadone.client.grasyla2.visuallibrary.widgets.W_Box.setLayout(), metadone.client.grasyla2.visuallibrary.GraphEngine.trigger(), metadone.client.grasyla2.GrasylaEngine.trigger(), metadone.client.grasyla2.visuallibrary.GrasylaScene.MakeFreeWidget.update(), metadone.client.grasyla2.visuallibrary.GrasylaScene.MyGraphVizLayout.updateControlPoints(), metadone.client.MetadoneDesktopPane.updateModelMenuItems(), metadone.client.grasyla2.value.UpdaterEngine.updateValue(), and metadone.client.grasyla2.actions.GrasylaActionAttributeHandler.valueChanged().

static final<T> T metadone.util.Objects.cast ( Class< T >  cla,
Object  value,
def 
) [static]

Casts a value to the given type and returns a default value instead of throwing an exception.

Parameters:
<T>The expected type
claThe class
valueThe value to cast
defThe default value
Returns:
A value of the expected type
Exceptions:
NullPointerExceptionwhen cla is null

References metadone.util.Objects.castUnsafe().

static <T> T metadone.util.Objects.castUnsafe ( Class<?>  cla,
Object  value,
def 
) [static]

Casts a value to the given type and returns a default value instead of throwing an exception.

Parameters:
<T>The expected type
claThe class
valueThe value to cast
defThe default value
Returns:
A value of the expected type
Exceptions:
NullPointerExceptionwhen cla is null

Referenced by metadone.util.Objects.cast().

static boolean metadone.util.Objects.equal ( Object  a,
Object  b 
) [static]

Tests if two objects are equal (null is permitted).

Parameters:
aThe first object or null
bThe second object or null
Returns:
True only if both objects are equal
See also:
Object.equals(Object)

Referenced by metadone.metabusiness.syntax.grasyla.BootstrapGrasyla.createScript(), metadone.util.IteratorUtil.equal(), metadone.util.Pair< A, B >.equals(), metadone.util.MapFcts.Compose< A, C >.equals(), metadone.util.MapFcts.Equal.equals(), metadone.util.ImmutableList< E >.equals(), metadone.metabusiness.syntax.grasyla.GrasylaEquationHeader.equals(), metadone.metabusiness.script.ScriptEvaluator.ScriptResult.Abstract.equals(), metadone.metabusiness.impl.ConcreteDef_impl.equals(), metadone.client.grasyla2.visuallibrary.widgets.RotateWidget.RotateDependency.equals(), metadone.client.grasyla2.visuallibrary.RootWidget.equals(), metadone.client.grasyla2.visuallibrary.AnchorKey.equals(), metadone.client.grasyla2.visuallibrary.AnchorDefinition.equals(), metadone.client.grasyla2.value.Value.equals(), metadone.client.grasyla2.SelectorBestEquation.PartialHeader.equals(), metadone.client.grasyla2.base.GrasylaComponent< C >.equals(), metadone.client.dialog.swing.genConcreteObject.Wmetaproperty.equals(), metadone.client.grasyla2.GrasylaEngineFactory.equivalentContext(), metadone.client.grasyla2.bool.MatchEngine.evaluate(), metadone.metabusiness.impl.ConcreteProperty_impl< T >.findEnumeratedValue(), metadone.metabusiness.script.groovy.GroovyProxyCO.findMetaProperty(), metadone.metabusiness.syntax.AbstractView.getElement(), metadone.metabusiness.syntax.grasyla.BootstrapGrasyla.getExpressionValue(), metadone.metabusiness.syntax.grasyla.GrasylaScript.hasFeatureOption(), metadone.client.grasyla2.actions.UserEvent.hasName(), metadone.client.grasyla2.visuallibrary.GrasylaScene.MyGraphVizLayout.ignoreChild(), metadone.util.ImmutableList< E >.indexOf(), metadone.client.grasyla2.GrasylaEngine.isAdapted(), metadone.util.ImmutableList< E >.lastIndexOf(), metadone.util.MapFcts.Equal.map(), metadone.client.grasyla2.visuallibrary.widgets.RotateWidget.registerRotateDependency(), metadone.client.grasyla2.swing.JOptionGroupEngine.reselect(), metadone.client.grasyla2.visuallibrary.VLEdgeEngine.setAnchorKey(), metadone.client.grasyla2.GrasylaContext.setPhenomenonValue(), metadone.metabusiness.impl.ConcreteProperty_impl< T >.setValue(), metadone.client.grasyla2.GrasylaFactoryStore.setWorkspace(), metadone.metabusiness.events.Question< T >.toString(), metadone.client.grasyla2.GrasylaEngine.unregisterSubscriber(), metadone.client.grasyla2.GrasylaEngine.updateComponent(), metadone.client.grasyla2.visuallibrary.GrasylaScene.MyGraphVizLayout.updateControlPoints(), and metadone.client.grasyla2.swing.JBorderBoxEngine.ChildComponentAttributeHandler.valueChanged().

static int metadone.util.Objects.hashCodeIter ( Iterator<?>  objs) [static]

Produces a hash code for a sequence of objects.

Parameters:
objsThe object sequence
Returns:
A hash value for these objects
Exceptions:
NullPointerExceptionwhen objs is null
See also:
hashCode(Object...)

Referenced by metadone.util.ImmutableList< E >.hashCode(), and metadone.client.grasyla2.base.GrasylaComponent< C >.hashCode().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations