24 package org.lightjason.agentspeak.language;
26 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
34 import javax.annotation.Nonnull;
35 import javax.annotation.Nullable;
36 import java.util.Arrays;
37 import java.util.Objects;
76 @SuppressWarnings(
"unchecked" )
77 public <N>
CRawTerm( @Nullable final N p_value )
79 if ( p_value instanceof
ITerm )
81 final ITerm l_term = (ITerm) p_value;
82 m_value = l_term.
raw();
87 m_value = (T) p_value;
91 m_hashcode = Objects.isNull( m_value ) ? 0 : m_value.hashCode();
117 @SuppressWarnings(
"unchecked" )
118 @SuppressFBWarnings(
"EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS" )
119 public final
boolean equals( final Object p_object )
121 return ( Objects.nonNull( p_object ) )
125 && ( ( (IVariable<?>) p_object ).
allocated() )
128 || ( ( p_object instanceof
ITerm ) && ( this.
hashCode() == p_object.hashCode() ) )
166 @SuppressWarnings(
"unchecked" )
191 return Arrays.stream( p_class ).anyMatch( i -> i.isAssignableFrom(
m_value.getClass() ) );
IPath subpath(final int p_fromindex)
creates a path of the start index until the end
final ITerm deepcopy(final IPath... p_prefix)
final boolean hasVariable()
checks if the literal has variables
final IPath fqnfunctor()
returns the full-qualified functor with path and name
illegal argument exception
common structure for execution definition
final boolean valueassignableto( @Nonnull final Class<?>... p_class)
final IRawTerm< T > thrownotallocated()
static IPath from( @Nonnull final String p_string)
factor method to build path
static< T > String languagestring(final T p_source, final String p_label, final Object... p_parameter)
returns the language depend string on any object
final< N > N raw()
cast to any raw value type
class to create a path structure
final String functor()
returns the functor without path
IPath fqnfunctor()
returns the full-qualified functor with path and name
static final ITerm EMPTY
empty raw term
final int m_hashcode
hash code cache
final IPath functorpath()
returns the path of the functor
final boolean equals(final Object p_object)
final int structurehash()
returns a hash value which defines a hash ove rthe structure
final ITerm deepcopysuffix()
final IPath m_functor
functor
< T > T raw()
cast to any raw value type
final boolean allocated()
static< N > CRawTerm< N > from(final N p_value)
factory for a raw term
class for any helper calls
static< T > T deepclone( @Nullable final T p_object)
creates a deep-clone of an object
String suffix()
returns the last part of the path
static final long serialVersionUID
serial id
final T m_value
value data
int size()
returns the number of path elements
final IRawTerm< T > throwvaluenotassignableto( @Nonnull final Class<?>... p_class)
term structure for simple datatypes