int v = ( aValue & channel.getMask() ) >> channel.getIndex(); aStream.print( this.colSeparator ); aStream.print( v );
/** * Creates a new {@link ChannelImpl} instance based on a given channel. * * @param aChannel * the channel to copy, cannot be <code>null</code>; * @param aRetainAnnotation * <code>true</code> if any annotations should be retained, * <code>false</code> otherwise. */ public ChannelImpl( final Channel aChannel, final boolean aRetainAnnotation ) { if ( aChannel == null ) { throw new IllegalArgumentException( "Channel cannot be null!" ); } this.propertyChangeSupport = new PropertyChangeSupport( this ); this.index = aChannel.getIndex(); this.mask = aChannel.getMask(); this.label = aChannel.hasName() ? aChannel.getLabel() : null; this.enabled = aChannel.isEnabled(); this.annotations = new CopyOnWriteArrayList<Annotation<?>>(); if ( aRetainAnnotation ) { this.annotations.addAll( aChannel.getAnnotations() ); } }
/** * Factory method for creating a {@link SignalElement} instance representing a * digital signal. * * @param aChannel * the channel to create a channel element for, cannot be * <code>null</code>. * @return a new {@link SignalElement} instance, never <code>null</code>. */ public static SignalElement createDigitalSignalElement( final Channel aChannel, final ElementGroup aGroup ) { int index = aGroup.getElementCount(); SignalElement channelElement = new SignalElement( SignalElementType.DIGITAL_SIGNAL, index, aChannel.getMask() ); channelElement.channel = aChannel; channelElement.group = aGroup; channelElement.height = UIManager.getInt( CHANNEL_HEIGHT ); channelElement.signalHeight = UIManager.getInt( DIGITAL_SIGNAL_HEIGHT ); channelElement.alignment = SignalAlignment.valueOf( getUIManagerValue( SIGNALVIEW_SIGNAL_ALIGNMENT, "CENTER" ) ); return channelElement; }
if ( ( refIdx >= 0 ) && ( refIdx < values.length ) ) final int mask = channel.getMask(); final int refValue = ( values[refIdx] & mask );