org.apache.directory.shared.ldap.name.DN.size()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(132)

本文整理了Java中org.apache.directory.shared.ldap.name.DN.size()方法的一些代码示例,展示了DN.size()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DN.size()方法的具体详情如下:
包路径:org.apache.directory.shared.ldap.name.DN
类名称:DN
方法名:size

DN.size介绍

暂无

代码示例

代码示例来源:origin: org.apache.directory.shared/shared-ldap

/**
 * {@inheritDoc}
 */
public int compareTo( DN dn )
{
  if ( dn.size() != size() )
  {
    return size() - dn.size();
  }
  for ( int i = rdns.size(); i > 0; i-- )
  {
    RDN rdn1 = rdns.get( i - 1 );
    RDN rdn2 = dn.rdns.get( i - 1 );
    int res = rdn1.compareTo( rdn2 );
    if ( res != 0 )
    {
      return res;
    }
  }
  return EQUAL;
}

代码示例来源:origin: org.apache.directory.shared/shared-ldap

if ( dn.size() == 0 )
if ( dn.size() > size() )
for ( int i = 0; i < dn.size(); i++ )

代码示例来源:origin: org.apache.directory.shared/shared-ldap

if ( dn.size() == 0 )
if ( dn.size() > size() )
for ( int i = dn.size() - 1; i >= 0; i-- )

代码示例来源:origin: org.apache.directory.shared/shared-ldap

if ( name.size() != this.size() )
for ( int i = 0; i < this.size(); i++ )

代码示例来源:origin: org.apache.directory.shared/shared-ldap

/**
 * Checks to see if two names are siblings.
 * 
 * @param name1 the first name
 * @param name2 the second name
 * @return true if the names are siblings, false otherwise.
 */
public static boolean isSibling( DN name1, DN name2 ) throws LdapInvalidDnException
{
  if ( name1.size() == name2.size() )
  {
    DN parentDn = ( DN ) name1.clone();
    parentDn.remove( name1.size() - 1 );
    return name2.isChildOf( parentDn );
  }
  return false;
}

代码示例来源:origin: org.apache.directory.shared/shared-ldap

/**
 * Copies a DN to an DN.
 *
 * @param name composed of String name components.
 * @throws LdapInvalidDnException If the Name is invalid.
 */
public DN( DN dn ) throws LdapInvalidDnException
{
  if ( ( dn != null ) && ( dn.size() != 0 ) )
  {
    for ( int ii = 0; ii < dn.size(); ii++ )
    {
      String nameComponent = dn.get( ii );
      add( nameComponent );
    }
  }
  normalized = false;
}

代码示例来源:origin: org.apache.directory.shared/shared-ldap

/**
 * {@inheritDoc}
 */
public RDN remove( int posn ) throws LdapInvalidDnException
{
  if ( rdns.size() == 0 )
  {
    return RDN.EMPTY_RDN;
  }
  if ( ( posn < 0 ) || ( posn >= rdns.size() ) )
  {
    String message = I18n.err( I18n.ERR_04206, posn, rdns.size() );
    LOG.error( message );
    throw new ArrayIndexOutOfBoundsException( message );
  }
  int realPos = size() - posn - 1;
  RDN rdn = rdns.remove( realPos );
  normalizeInternal();
  toUpName();
  return rdn;
}

代码示例来源:origin: org.apache.directory.server/apacheds-xdbm-base

newParentDNClone.remove( newParentDNClone.size() - 1 );
if ( newParentDn.size() >= oldChildDn.size() )
  for ( int i = 0; i < oldChildDn.size(); i++ )

代码示例来源:origin: org.apache.directory.shared/shared-ldap

/**
 * {@inheritDoc}
 */
public DN getSuffix( int posn )
{
  if ( rdns.size() == 0 )
  {
    return EMPTY_DN;
  }
  if ( ( posn < 0 ) || ( posn > rdns.size() ) )
  {
    String message = I18n.err( I18n.ERR_04206, posn, rdns.size() );
    LOG.error( message );
    throw new ArrayIndexOutOfBoundsException( message );
  }
  DN newDN = new DN();
  for ( int i = 0; i < size() - posn; i++ )
  {
    // Don't forget to clone the rdns !
    newDN.rdns.add( ( RDN ) rdns.get( i ).clone() );
  }
  newDN.normName = newDN.toNormName();
  newDN.upName = getUpNameSuffix( posn );
  return newDN;
}

代码示例来源:origin: org.apache.directory.shared/shared-ldap

/**
 * {@inheritDoc}
 */
public DN add( int posn, String comp ) throws LdapInvalidDnException
{
  if ( ( posn < 0 ) || ( posn > size() ) )
  {
    String message = I18n.err( I18n.ERR_04206, posn, rdns.size() );
    LOG.error( message );
    throw new ArrayIndexOutOfBoundsException( message );
  }
  //FIXME this try-catch block is for the time being, during removal of
  // java.naming.Name we have to remove this
  try
  {
    // We have to parse the nameComponent which is given as an argument
    RDN newRdn = new RDN( comp );
    
    int realPos = size() - posn;
    rdns.add( realPos, newRdn );
  }
  catch( LdapInvalidDnException le )
  {
    throw new LdapInvalidDnException( le.getMessage() );
  }
  normalizeInternal();
  toUpName();
  return this;
}

代码示例来源:origin: org.apache.directory.shared/shared-ldap

/**
 * {@inheritDoc}
 */
public DN addAll( int posn, DN dn ) throws LdapInvalidDnException
{
  if ( ( dn == null ) || ( dn.size() == 0 ) )
  {
    return this;
  }
  // Concatenate the rdns
  rdns.addAll( size() - posn, dn.rdns );
  // Regenerate the normalized name and the original string
  if ( this.isNormalized() && dn.isNormalized() )
  {
    if ( this.size() != 0 )
    {
      normName = dn.getNormName() + "," + normName;
      bytes = StringTools.getBytesUtf8( normName );
      upName = dn.getName() + "," + upName;
    }
  }
  else
  {
    normalizeInternal();
    toUpName();
  }
  return this;
}

代码示例来源:origin: org.apache.directory.shared/shared-ldap

if ( ( dn == null ) || ( dn.size() == 0 ) || ( oidsMap == null ) || ( oidsMap.size() == 0 ) )

代码示例来源:origin: org.apache.directory.shared/shared-ldap

if ( size() == 0 )

代码示例来源:origin: org.apache.directory.shared/shared-ldap

/**
 * {@inheritDoc}
 */
public DN addAll( int posn, Name name ) throws InvalidNameException, LdapInvalidDnException
{
  if ( ( name == null ) || ( name.size() == 0 ) )
  {
    return this;
  }
  for ( int i = name.size() - 1; i >= 0; i-- )
  {
    RDN rdn = new RDN( name.get( i ) );
    rdns.add( size() - posn, rdn );
  }
  normalizeInternal();
  toUpName();
  return this;
}

代码示例来源:origin: org.apache.directory.server/apacheds-avl-partition

ancestorDn.remove( aliasDN.size() - 1 );
Long ancestorId = getEntryId( ancestorDn.getNormName() );
subAliasIdx.drop( ancestorId, targetId );
while ( !ancestorDn.equals( suffixDn ) && ancestorDn.size() > suffixDn.size() )
  ancestorDn = ( DN ) ancestorDn.getPrefix( ancestorDn.size() - 1 );
  ancestorId = getEntryId( ancestorDn.getNormName() );

代码示例来源:origin: org.apache.directory.shared/shared-ldif

if ( modifiedDn.size() == 0 )
currentParent.remove( currentParent.size() - 1 );

代码示例来源:origin: org.apache.directory.shared/shared-ldap

for ( int ii = 0; ii < ancestor.size(); ii++ )

代码示例来源:origin: org.apache.directory.server/apacheds-avl-partition

String childRdn = childUpdn.get( childUpdn.size() - 1 );
DN newUpdn = new DN( getEntryUpdn( newParentId ) );
newUpdn.add( newUpdn.size(), childRdn );

代码示例来源:origin: org.apache.directory.shared/shared-ldif

oldSuperior.remove( oldSuperior.size() - 1 );
reverted.setNewSuperior( oldSuperior.getName() );

代码示例来源:origin: org.apache.directory.shared/shared-ldif

oldSuperior.remove( oldSuperior.size() - 1 );
reverted.setNewSuperior( oldSuperior.getName() );

相关文章