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