1 6 7 package com.hp.hpl.jena.graph.query.regexptrees; 8 9 import java.util.List ; 10 11 18 public class Sequence extends MultiOperandTree 19 { 20 protected Sequence( RegexpTree [] operands ) 21 { super( operands ); } 22 23 public static RegexpTree create( List operands ) 24 { 25 if (operands.size() == 0) 26 return NON; 27 else if (operands.size() == 1) 28 return (RegexpTree) operands.get(0); 29 else 30 return new Sequence( (RegexpTree []) operands.toArray( new RegexpTree [operands.size()] )); 31 } 32 33 public boolean equals( Object other ) 34 { 35 return other instanceof Sequence && sameOperands( (MultiOperandTree) other ); 36 } 37 38 public int hashCode() 39 { return hashCode( 0 ); } 40 41 public String toString() 42 { return toString( "seq" ); } 43 44 } 45 46 47 | Popular Tags |